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.
Tool Designer generates the .form and .java files for a Swing form. It then needs the form editor to generate the Swing initialization code into the .java file from the definition in the .form file. In Pilsen we used the following technique: 1) Open the data object associated with the form 2) Save it 3) Close it (See the code at the bottom). When I moved to Orion (FFJEE build 011217) I started getting the following exception. It is not deterministic but very likely (happens in about 30% of the forms processed although not always the same ones). TD: --> GenericGeneratorDataObject.forceFormEditorCodeGeneration (gen/src/XSLT/XSLTtesterPanel.java) Fri Jan 04 13:38:05 PST 2002: java.lang.NullPointerException: <no message> java.lang.NullPointerException at javax.swing.text.JTextComponent.getCaretPosition (JTextComponent.java:1139) at org.netbeans.modules.java.JavaEditor$10.actionPerformed (JavaEditor.java:1073) at javax.swing.Timer.fireActionPerformed(Timer.java:150) at javax.swing.Timer$DoPostEvent.run(Timer.java:108) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:154) at java.awt.EventQueue.dispatchEvent(EventQueue.java:337) [catch] at java.awt.EventDispatchThread.pumpOneEventForHierarchy (EventDispatchThread.java:131) at java.awt.EventDispatchThread.pumpEventsForHierarchy (EventDispatchThread.java:98) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:85) TD: <-- GenericGeneratorDataObject.forceFormEditorCodeGeneration Java Method: ------------ public void forceFormEditorCodeGeneration(final String resource) { ctx.logEntry ("GenericGeneratorDataObject.forceFormEditorCodeGeneration", resource); //NOI18N try { FileObject parent = this.getFolder().getPrimaryFile(); FileObject fileObject = Util.getFileObject(parent, resource); if (fileObject == null) { String errMsg = ctx.getMessage("MSG_UnableToOpenFile", resource); Exception e = new Exception(errMsg); throw e; } final DataObject dataObject = DataObject.find(fileObject); ((OpenCookie)dataObject.getCookie(OpenCookie.class)).open(); SwingUtilities.invokeAndWait(new Runnable() { public void run() { if (dataObject.isModified()) { try { ((SaveCookie)dataObject.getCookie (SaveCookie.class)).save(); } catch (Exception ex) { ctx.raiseDialog ("MSG_UnableToForceFormEditorCodeGeneration", resource, ex); //NOI18N } } ((CloseCookie)dataObject.getCookie(CloseCookie.class)).close (); } }); } catch (Exception e) { ctx.raiseDialog("MSG_ExceptionInFormEditorCodeGeneration", resource, e); //NOI18N ctx.logException(e); } ctx.logExit(); }
I don't know what could cause the NPE - looks like it happens in java module. Reassigning...
I don't understand why this is P1 issue. Lowering priority.
fixed in trunk, will be merged to release33 branch tomorrow
I've merged it in - there was additional change, which has to be merged into 3.3 branch, so I've merged them both.
VERIFIED
Resolved for 3.4.x or earlier, no new info since then -> closing.