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.
Summary: | Problem with palette custom components when a class name is the same as the package name | ||
---|---|---|---|
Product: | ide | Reporter: | scarpent <scarpent> |
Component: | Code | Assignee: | issues@ide <issues> |
Status: | RESOLVED INVALID | ||
Severity: | blocker | ||
Priority: | P4 | ||
Version: | 5.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: | Sample project demonstrating problem. |
Description
scarpent
2007-11-10 21:56:53 UTC
Created attachment 52840 [details]
Sample project demonstrating problem.
Also, declaring in ExampleUI: private labelExample labelExample2; Doesn't cause any complaint. And now it occurred to me to try a plain old class that doesn't extend anything, and: private Example.Banana abc; Causes the same problem. So it's not really palette/component related at all, it's just that I struggled so long with it in that area that I was fixated on it as a palette custom component problem. Apparently NetBeans is just confused when a class name is the same as the package name, and you refer to any class with the fully qualified path. And! It makes sense, since how should the IDE know if you're referring to the package or the class, and it wouldn't be a problem except that you can't change the declaration generated by the GUI builder, so you're kind of stuck with having the ambiguous "Example" in there. (As far as I can tell.) Try to compile your project with javac outside the IDE. It throws the same errors like the ide. So it is not probably issue on our side. I figured out in the course of filing this report that the behavior is valid, although I still think there is a small issue in that the IDE won't let you change your declaration to something that works. But knowing better now I wouldn't name one of my classes the same as the package. But, thanks, and sorry for false accusations. :-) |