This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 205211 - Bean info generated incorrectly
Summary: Bean info generated incorrectly
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Beans (show other bugs)
Version: 7.1
Hardware: PC Windows 7
: P1 normal (vote)
Assignee: Jan Becicka
URL:
Keywords: REGRESSION
: 205306 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-11-16 16:14 UTC by Jiri Prox
Modified: 2011-11-25 09:17 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Prox 2011-11-16 16:14:57 UTC
Bean info is generated incorrectly, there are doubled return statements in some methods.

Steps to reproduce:
1) create new empty class
2) generate beaninfo for it

-> here are the first 3 method from the generated class, notice that the return statements are doubled. (fortunately the firs return is not in guarded block and can be deleted)

private static BeanDescriptor getBdescriptor(){
        BeanDescriptor beanDescriptor = new BeanDescriptor  ( javaapplication22.JavaApplication22.class , null ); // NOI18N

        // Here you can add code for customizing the BeanDescriptor.

        return beanDescriptor;
        return beanDescriptor;     }
    // Property identifiers 

    // Property array 
    /*lazy PropertyDescriptor*/
    private static PropertyDescriptor[] getPdescriptor(){
        PropertyDescriptor[] properties = new PropertyDescriptor[0];

        // Here you can add code for customizing the properties array.

        return properties;
        return properties;     }
    // EventSet identifiers

    // EventSet array
    /*lazy EventSetDescriptor*/
    private static EventSetDescriptor[] getEdescriptor(){
        EventSetDescriptor[] eventSets = new EventSetDescriptor[0];

        // Here you can add code for customizing the event sets array.

        return eventSets;
        return eventSets;     }



Product Version: NetBeans IDE Dev (Build 20111115-fe19723f7bc6)
Java: 1.7.0_01; Java HotSpot(TM) Client VM 21.1-b02
System: Windows 7 version 6.1 running on x86; Cp1250; en_US (nb)
User directory: D:\udir3
Cache directory: D:\udir3\var\cache
Comment 1 Marian Mirilovic 2011-11-18 18:12:48 UTC
*** Bug 205306 has been marked as a duplicate of this bug. ***
Comment 2 Jan Becicka 2011-11-21 06:28:49 UTC
strange, this code was not touched for years
Comment 3 Jan Becicka 2011-11-21 07:27:05 UTC
Jesse, it is yours I guess:

The templates are screwed up. 
Steps to reproduce: 
Create New | Java Beans Object | BeanInfo
BeanInfo should be created with some parts in guarded sections, but instead of guarded sections you can see //GEN-END and similar comments
The problem is, that some special comments are commented out.

Don't know, how many templates are corrupted.

This was caused by this commit:
http://hg.netbeans.org/main-golden/rev/d4c6057a3f4f
Comment 4 Jesse Glick 2011-11-21 15:22:39 UTC
(In reply to comment #3)
> Create New | Java Beans Object | BeanInfo
> BeanInfo should be created with some parts in guarded sections, but instead of
> guarded sections you can see //GEN-END and similar comments
> The problem is, that some special comments are commented out.

Indeed you do. But when you restart the IDE the guarded blocks appear normally, so this is a bug in the editor.

> This was caused by this commit:
> http://hg.netbeans.org/main-golden/rev/d4c6057a3f4f

No, that commit did not change the contents of the template. Anyway this is not clearly related to the originally reported bug, which is about generating BI for an existing class; creating a BI from File > New File does not result in uncompilable code.
Comment 5 Michel Graciano 2011-11-22 15:40:46 UTC
Shouldn't it be marked with 71_HR_FIX_CANDIDATE?
Comment 6 Jan Becicka 2011-11-23 09:36:58 UTC
This bug *WAS* probably caused by Jesse's changes in templates. JavaBeans templates are not recognized as Beans Data Objects. It never worked transparently by after recent changes those hacks stopped working.
Comment 7 Jan Becicka 2011-11-23 09:37:57 UTC
Changeset: http://hg.netbeans.org/jet-main/rev/b16466f072eb
Author:    Jan Becicka <jbecicka@netbeans.org>
Date:      2011-11-23 10:33
Message:   
Issue #205211 - Bean info generated incorrectly
Comment 8 Michel Graciano 2011-11-23 11:10:33 UTC
Why TM was changed to 7.2? It is supposed to be fixed for 7.1.
Comment 9 Marian Mirilovic 2011-11-23 11:22:07 UTC
(In reply to comment #8)
> Why TM was changed to 7.2? It is supposed to be fixed for 7.1.

Because it's fixed in 7.2, we will change it to 7.1 once the fix is integrated into release71 branch (it's 71_HR_FIX_CANDIDATE and it will be definitely delivered in 7.1)
Comment 10 Michel Graciano 2011-11-23 11:31:24 UTC
Thanks for the clarification :)
Comment 11 Jan Lahoda 2011-11-23 13:43:02 UTC
For the record: I think the patch is fine.
Comment 12 Jiri Prox 2011-11-23 15:05:58 UTC
verified in trunk.

Still there are some formatting problem, but only a minor ( closing bracket is not on separate line) but it only a minor problem. I'll file separate issue for it.
Comment 13 Jan Becicka 2011-11-24 08:10:20 UTC
integrated into release71
http://hg.netbeans.org/releases/rev/bb211e0ba4d1
Comment 14 Quality Engineering 2011-11-24 16:01:02 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/b16466f072eb
User: Jan Becicka <jbecicka@netbeans.org>
Log: Issue #205211 - Bean info generated incorrectly
Comment 15 Quality Engineering 2011-11-25 06:17:39 UTC
Integrated into 'releases'
Changeset: http://hg.netbeans.org/releases/rev/bb211e0ba4d1
User: Jan Becicka <jbecicka@netbeans.org>
Log: Issue #205211 - Bean info generated incorrectly
(transplanted from b16466f072ebbdf7653f5b227e9a4ca44336528d)
Comment 16 Jiri Prox 2011-11-25 09:17:20 UTC
verified