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: | Tools > Java Platforms > Add Platform throws NPE if ergonomics enabled | ||
---|---|---|---|
Product: | java | Reporter: | _ tboudreau <tboudreau> |
Component: | Platform | Assignee: | David Strupl <dstrupl> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | dstrupl, jjancura, jtulach, mmirilovic, psuchomel |
Priority: | P2 | Keywords: | ERGONOMICS |
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: |
Module suite demonstrating the problem
Sorry, try this one |
Description
_ tboudreau
2009-03-13 05:57:27 UTC
Generating NPE is definitely problem of the code. Well, yes, but if Java support is disabled, why is there a Tools > Java Platforms menu at all? Potentially because of bug 159923, but I am not sure. I have just tried build from today's trunk and the menu item is not there. Closing as works for me unless someone provides steps to reproduce (having java disabled and have the menu item there). Created attachment 80766 [details]
Module suite demonstrating the problem
Reopenning after Tim provided the test cluster. Created attachment 80773 [details]
Sorry, try this one
Try the attached suite. It does cause the Java Platforms menu item to appear. Create a directory such as C:\fake (the platform install implementation recognizes only dirs named "fake" as java platforms). Skip the empty wizard panel, and press Finish. The exception below is thrown. The culprit is that PlatformsCustomizer tries to look up Templates/Services/Platforms/org-netbeans-api-java-Platform/javaplatform.xml in the system fs and assumes it will exist, but it does not. A bigger problem which I will file separately is that while the Java Platforms menu item is visible, in fact if you browse to your JDK, it is not recognized because the modules the recognize other Java Platforms are not enabled. SEVERE [global] java.lang.IllegalArgumentException: Called DataObject.find on null at org.openide.loaders.DataObject.find(DataObject.java:481) at org.netbeans.modules.java.platform.ui.PlatformsCustomizer.addNewPlatform(PlatformsCustomizer.java:326) at org.netbeans.modules.java.platform.ui.PlatformsCustomizer.access$000(PlatformsCustomizer.java:88) at org.netbeans.modules.java.platform.ui.PlatformsCustomizer$1.actionPerformed(PlatformsCustomizer.java:196) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318) The Templates/Services/Platforms/org-netbeans-api-java-Platform/javaplatform.xml is in org.netbeans.modules.java.j2seplatform module. The action is in org.netbeans.modules.java.platform which does not have any dependency on j2seplatform one. You need to fix your module dependencies or get ready for the file missing. Pavel will help you with the fix in case you want his help. I will fix the module dependencies. The dependency is in the other direction. Investigating. You can make the dependency bidirectional by using OpenIDE-Module-Provides/Needs/Recommends. Or you can just prevent the NPE. What is correct depends on you Java guys. I can imagine that JavaCard development module could easily run without any JavaSE platform, although the current code seems to rely on JavaSE platform being around. I have a patch almost ready that moves the layer registration and couple of files "up" in the dependency chain (from j2seplatform to java.platform. The only problem I have now not to screw something ;-) I will try to finish and commit the move unless there are any concerns. BTW I would like to know the reason why the template file was in one module and its wizard iterator in another - if there was some reason to have it like this my move might break something that I am not aware about. > although the current code seems to rely on JavaSE platform being around.
It doesn't, although I think users might find it a little confusing if Java support is enabled but the IDE doesn't
recognize a JDK install.
Pushed to jet-main as changeset: 128757:c121cd47a5b6 Ergonomics keyword does not mean that the bug was caused by bug in the ergonomics modules. It means that without ergonomics you would not encounter it which I think is true since you would have the whole java cluster enabled whatever would Tim do with JavaCard ... The bug is now correctly in category java/platform - this is where the bug is (was). Any help with the following failure is welcome: http://bertram.netbeans.org/hudson/job/jet-main/532/testReport/org.netbeans.modules.ide.ergonomics/FilesAndAttributesCheck/testCheckAllTemplatesReal/ I have tried to move the template and its display name in the bundle ... did I do it the wrong way? I apologize for the question. I have wrong localizing bundle there ... reopenning. And fixed again in changeset : 128939:fa922dbd78dc in jet-main. *** Issue 162800 has been marked as a duplicate of this issue. *** |