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.
[dev build #200508021800] Steps to reproduce: 1.Create new JFrame form "f1" 2.Rename it to "f2" (some informational exceptions appear in the console) 3.Rename it to "f3" 4.The following exception appears in the dialog: java.lang.NullPointerException at org.netbeans.modules.javacore.internalapi.GuardedQuery.isSectionGuarded(GuardedQuery.java:41) at org.netbeans.modules.refactoring.CheckUtils.isRefactoringElementGuarded(CheckUtils.java:260) at org.netbeans.modules.refactoring.spi.RefactoringElementsBag.add(RefactoringElementsBag.java:73) at org.netbeans.modules.refactoring.plugins.RenameRefactoringPlugin.addElementsForJmiObject(RenameRefactoringPlugin.java:444) at org.netbeans.modules.refactoring.plugins.RenameRefactoringPlugin.prepare(RenameRefactoringPlugin.java:384) at org.netbeans.modules.refactoring.api.AbstractRefactoring.pluginsPrepare(AbstractRefactoring.java:274) at org.netbeans.modules.refactoring.api.AbstractRefactoring.prepare(AbstractRefactoring.java:140) at org.netbeans.modules.refactoring.spi.ui.ParametersPanel$Prepare.run(ParametersPanel.java:675) at org.openide.util.Task.run(Task.java:207) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:469) [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:870)
Created attachment 23437 [details] Ide.log attached
When I click to the editor then the exception as following appears: Annotation: member: class y.f3 Annotation: name: y.f3 Annotation: class org.netbeans.jmi.javamodel.JavaClass$Impl java.lang.IllegalStateException: cannot map class member to source hierarchy element at org.netbeans.modules.java.ui.nodes.BridgeUtils.throwIllegalState(BridgeUtils.java:195) at org.netbeans.modules.java.ui.nodes.BridgeUtils.chooseElement(BridgeUtils.java:184) at org.netbeans.modules.java.ui.nodes.BridgeUtils.getElement(BridgeUtils.java:121) at org.netbeans.modules.java.ui.nodes.BridgeElement2Source.createClassNode(BridgeElement2Source.java:54) at org.netbeans.modules.java.JavaEditor$JavaEditorComponent.createNode(JavaEditor.java:1293) at org.netbeans.modules.java.JavaEditor$JavaEditorComponent.access$800(JavaEditor.java:1189) at org.netbeans.modules.java.JavaEditor$12.run(JavaEditor.java:1241) at org.openide.util.Mutex.readAccess(Mutex.java:195) at org.netbeans.modules.java.JavaEditor$11.run(JavaEditor.java:1239) at org.openide.util.Task.run(Task.java:207) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:469) [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:870)
The issue appear just in case when calling Refactor->Rename while form Design mode is on. Making the stopper of Q-build 200508021800 from this issue.
Adding Honza Stola to cc, because form module is one of potential cause.
I don't see anything related to javacore module - why it is filed against java?. Reassigning to form. Nothing was changed in refactoring module in this part of code. Probably some new assertions was into form module...?
> Probably some new assertions was into form module...? well, some word is missing in this sentence, isn't it? :) I wanted to write: Probably some new assertions was added into form module...?
Sorry, I don't have good day today. I understand, why it was reproted in javacore module. Because of NPE. Anyway, I tried to reproduce this bug, and this assertions were printed to console: java.lang.AssertionError at org.netbeans.modules.form.FormDesigner$FormListener.formChanged(FormDesigner.java:1428)
Created attachment 23478 [details] Stack trace
Here is the better description of reproducible testcase: 1.Create j2se project "xyz" 2.In Projects view click on "xyz" package and invoke popup menu 3.Select New->JFrame Form... 4.Type the Class Name "f1" and push Finish button (don't switch Design mode to Source!) 5.In Projects view click on "f1.java" and invoke popup menu 6.Select Refactor->Rename... 7.Type "f2" to New Name field and push Next> button 8.Push "Do Refactoring" button (some informational exceptions appear in the console) 9.In Projects view click on "f2.java" and invoke popup menu 10.Select Refactor->Rename... 11.Type "f3" to New Name field and push Next> button 12.java.lang.NullPointerException from javacore.internalapi.GuardedQuery.isSectionGuarded(GuardedQuery.java:41) appears in exception dialog 13.Close Exception dialog and push "Do Refactoring" button 14.Switch Design mode to Source 15.Click to editor 16.java.lang.IllegalStateException appears and appears periodicly when working with source editor (I am attaching the message.log again for sure)
Created attachment 23485 [details] Messages.log attached
AssertionError was thrown by form module because we expected some method to be called from event-dispatch thread only which was violated in this case. I have fixed the AssertionError from the form module and the NPE is no longer reproducible. /cvs/form/src/org/netbeans/modules/form/FormEditor.java,v <-- FormEditor.java new revision: 1.74; previous revision: 1.73
Verified in dailz build #200508041800.