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 70893 - [50cat] Change in parameterlist of c'tor is not supported in guarded blocks
Summary: [50cat] Change in parameterlist of c'tor is not supported in guarded blocks
Status: RESOLVED DUPLICATE of bug 48288
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 5.x
Hardware: PC Windows XP
: P2 blocker (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-01 19:44 UTC by ieising
Modified: 2006-01-10 17:06 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
screenshot (28.65 KB, image/png)
2006-01-10 17:04 UTC, Tomas Pavek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ieising 2006-01-01 19:44:41 UTC
[ BUILD # : 200512192030 ]
[ JDK VERSION : 1.6 ]

Hi,

Today I changed from one of the c'tors of a class the parameter list.
I added the new parameter thru the refactoring tool, and got a warning that it doesn't work for guarded blocks. Since I can't edit the guarded blocks either I had to open good old Notepad and edit it there.

Iwan
Comment 1 ieising 2006-01-01 19:45:18 UTC
Since using the refactory results in uncompilable code, which previously
compiled, I think it is a P2.
Comment 2 Jan Becicka 2006-01-02 06:49:03 UTC
Form module should handle this.
Comment 3 Jan Stola 2006-01-02 09:31:06 UTC
This is a known issue (48288) that will not be addressed in NetBeans 5.0
unfortunately.

Could you, please, provide more information about your scenario to make sure
that we will consider it while working on the mentioned issue. How does
the invocation of your parameterized constructor get into guarded block?

*** This issue has been marked as a duplicate of 48288 ***
Comment 4 ieising 2006-01-07 23:31:07 UTC
The way I reproduce it:
I have a form that is dragged onto the flow-editor. Now I change the parameter
list of the c'tor using the Refactory functionality. And since I know which
field should be used when constructing the Form, I set it as the default value.
Everywhere I construct the form, the new call is generated using the value I
specified in the Refactory operation, but in the guarded blocks I still get the
old call, and I can't change it, because it is in a guarded block. So....
Notepad, here I come :)

Iwan
Comment 5 Tomas Pavek 2006-01-09 09:34:10 UTC
BTW no need to use notepad, you can do the same using "Custom creation code"
property of the component.
Comment 6 ieising 2006-01-09 21:13:30 UTC
I can't seem to find that Custom Generation Code property. Can you point me into
the right direction?

Btw, it seems that in 20060105 NB picked up the new C'tor signature. Is that
possible, or am I overlooking something and just wish too hard that it is fixed?
Could it be that NB reloads the code and creates new meta data for the components?

Iwan
Comment 7 Tomas Pavek 2006-01-10 13:36:09 UTC
> I can't seem to find that Custom Generation Code property. Can you point me
> into the right direction?

Select the component in designer and click on the "Code" properties category in
the property sheet. Custom Creation Code is the last property.

> Btw, it seems that in 20060105 NB picked up the new C'tor signature. Is that
> possible, or am I overlooking something and just wish too hard that it is
> fixed? Could it be that NB reloads the code and creates new meta data for
> the components?

No. Likely NB did not regenerate the code yet, so you can still see it the way
you changed it externally.
Comment 8 ieising 2006-01-10 14:24:58 UTC
When I click on the component in the designer, it is a custom component (derived
from Canvas) by the way, then there is no such property. I guess that custom
components don't have a custom creation code option, am I right, or is it
something that is not there because the component was already added to the
palette various NB5 versions ago?

Iwan
Comment 9 Tomas Pavek 2006-01-10 17:04:45 UTC
Created attachment 28337 [details]
screenshot
Comment 10 Tomas Pavek 2006-01-10 17:06:04 UTC
The property should be there for every component (see the screenshot above) -
except the root component (representing the whole form) - but in which case you
had not problems with c'tor in guarded code...