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 133153 - BeanEditor generates wrong method signatures
Summary: BeanEditor generates wrong method signatures
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Beans (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Jan Pokorsky
URL:
Keywords:
: 134345 135220 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-04-17 21:57 UTC by jmborer
Modified: 2008-06-04 08:38 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 jmborer 2008-04-17 21:57:01 UTC
By testing the newly re-introduced beanedito in NB 6.1 RC2, I discovered that the when a method for a Pojo uses primitive types, the BeanInfo generator 
creates a wrong signature.

For example I have a method:
    public void drawSpokedWheel(Graphics2D g2, int x, int y, int wheelSize, int tyreSize) ...

the generated signature is:
            methods[METHOD_drawSpokedWheel0] = new MethodDescriptor(carpreview.CarPreview.class.getMethod("drawSpokedWheel", new Class[] 
{java.awt.Graphics2D.class, INT.class, INT.class, INT.class, INT.class})); // NOI18N

which of course is wrong and won't compile. It should be:
            methods[METHOD_drawSpokedWheel0] = new MethodDescriptor(carpreview.CarPreview.class.getMethod("drawSpokedWheel", new Class[] 
{java.awt.Graphics2D.class, int.class, int.class, int.class, int.class})); // NOI18N

or

            methods[METHOD_drawSpokedWheel0] = new MethodDescriptor(carpreview.CarPreview.class.getMethod("drawSpokedWheel", new Class[] 
{java.awt.Graphics2D.class, Integer.TYPE, Integer.TYPE, IInteger.TYPE, Integer.TYPE)); // NOI18N

I have noticed this behavior whith all primitive types.
Comment 1 jmborer 2008-04-17 22:00:21 UTC
I forgot: once the BeanInfo has generated this "uncompilable" code, you can no longer save your beaninfo neither in the designer nor in the code, eventhough 
you fixed the error by removing the offending method from the beaninfo. No errors in the NB log file.
Comment 2 Jiri Prox 2008-04-18 08:44:47 UTC
Temporary workaround:
1) in bean info editor exclude the problematic method
2) in the source editor manually add new element into method fields
Comment 3 jmborer 2008-04-18 08:54:21 UTC
Yep. Already using that workaround. Even though the "save" action doesn't work, strangely you can save your work in the
beaninfo by using "save all"... That's another workaround.
Comment 4 Jiri Prox 2008-04-18 09:26:20 UTC
The * is still shown in editor tab, but changes are stored -> I've reopened the issue 128969 which is related to this
problem. 

I'm downgrading this to P2 in order not to block release of 6.1 but we definitely should fix it ASAP and include the fix
in patch1
Comment 5 Jan Pokorsky 2008-04-18 10:05:29 UTC
I will investigate.
Comment 6 Jan Pokorsky 2008-04-18 10:59:54 UTC
Incorrect primitive type names fixed in dev build as http://hg.netbeans.org/main/rev/e16efb2f59ac

With the applied fix I cannot reproduce the save issue again. Anyway I will track it as issue #128969.
Comment 7 Jiri Prox 2008-04-23 11:20:30 UTC
verified in trunk
Comment 8 pgebauer 2008-04-27 22:29:02 UTC
The fix has been ported into the release61_fixes branch:

http://hg.netbeans.org/release61_fixes/rev/15215aaf23b2
Comment 9 Jan Pokorsky 2008-05-02 15:51:01 UTC
*** Issue 134345 has been marked as a duplicate of this issue. ***
Comment 10 Jan Pokorsky 2008-05-16 15:59:52 UTC
*** Issue 135220 has been marked as a duplicate of this issue. ***