You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "frankvdh (via GitHub)" <gi...@apache.org> on 2025/06/25 21:57:20 UTC

[I] Java Refactoring exception [netbeans]

frankvdh opened a new issue, #8624:
URL: https://github.com/apache/netbeans/issues/8624

   ### Apache NetBeans version
   
   Apache NetBeans 26
   
   ### What happened
   
   Moving a class from one package to another.
   
   java.lang.IllegalStateException: Cannot use Elements.getTypeElement before the TaskEvent.Kind.ENTER finished event.
   	at com.sun.tools.javac.model.JavacElements.ensureEntered(JavacElements.java:890)
   	at com.sun.tools.javac.model.JavacElements.doGetTypeElement(JavacElements.java:177)
   	at com.sun.tools.javac.model.JavacElements.getTypeElement(JavacElements.java:173)
   	at com.sun.tools.javac.model.JavacElements.getTypeElement(JavacElements.java:90)
   	at org.netbeans.modules.java.source.save.ElementOverlay.resolve(ElementOverlay.java:198)
   	at org.netbeans.modules.java.source.save.ElementOverlay.resolve(ElementOverlay.java:187)
   	at org.netbeans.modules.java.source.save.ElementOverlay.unnamedPackage(ElementOverlay.java:428)
   	at org.netbeans.modules.java.source.pretty.ImportAnalysis2.<init>(ImportAnalysis2.java:95)
   	at org.netbeans.modules.java.source.pretty.ImportAnalysis2.<init>(ImportAnalysis2.java:85)
   	at org.netbeans.api.java.source.WorkingCopy.processCurrentCompilationUnit(WorkingCopy.java:783)
   	at org.netbeans.api.java.source.WorkingCopy.getChanges(WorkingCopy.java:1321)
   	at org.netbeans.api.java.source.JavaSource$1.run(JavaSource.java:672)
   	at org.netbeans.api.java.source.JavaSource$1.run(JavaSource.java:661)
   	at org.netbeans.api.java.source.JavaSource$MultiTask.run(JavaSource.java:504)
   	at org.netbeans.modules.parsing.impl.TaskProcessor.callUserTask(TaskProcessor.java:586)
   	at org.netbeans.modules.parsing.api.ParserManager$MultiUserTaskAction.run(ParserManager.java:235)
   	at org.netbeans.modules.parsing.api.ParserManager$MultiUserTaskAction.run(ParserManager.java:205)
   	at org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskProcessor.java:181)
   	at org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskProcessor.java:178)
   	at org.netbeans.modules.masterfs.filebasedfs.utils.FileChangedManager.priorityIO(FileChangedManager.java:153)
   	at org.netbeans.modules.masterfs.providers.ProvidedExtensions.priorityIO(ProvidedExtensions.java:335)
   	at org.netbeans.modules.parsing.nb.DataObjectEnvFactory.runPriorityIO(DataObjectEnvFactory.java:118)
   	at org.netbeans.modules.parsing.impl.Utilities.runPriorityIO(Utilities.java:67)
   	at org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(TaskProcessor.java:178)
   	at org.netbeans.modules.parsing.api.ParserManager.parse(ParserManager.java:85)
   	at org.netbeans.api.java.source.JavaSource.runUserActionTaskImpl(JavaSource.java:454)
   	at org.netbeans.api.java.source.JavaSource.runUserActionTask(JavaSource.java:425)
   	at org.netbeans.api.java.source.JavaSource.runModificationTask(JavaSource.java:680)
   	at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin.processFiles(JavaRefactoringPlugin.java:323)
   	at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin.processFiles(JavaRefactoringPlugin.java:264)
   	at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin.processFiles(JavaRefactoringPlugin.java:246)
   	at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin.createAndAddElements(JavaRefactoringPlugin.java:338)
   	at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin.createAndAddElements(JavaRefactoringPlugin.java:354)
   	at org.netbeans.modules.refactoring.java.plugins.MoveFileRefactoringPlugin.prepare(MoveFileRefactoringPlugin.java:576)
   [catch] at org.netbeans.modules.refactoring.api.AbstractRefactoring.pluginsPrepare2(AbstractRefactoring.java:417)
   	at org.netbeans.modules.refactoring.api.AbstractRefactoring.pluginsPrepare(AbstractRefactoring.java:401)
   	at org.netbeans.modules.refactoring.api.AbstractRefactoring.prepare(AbstractRefactoring.java:212)
   	at org.netbeans.modules.refactoring.spi.impl.ParametersPanel$Prepare.run(ParametersPanel.java:1063)
   	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1403)
   	at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
   	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:287)
   	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2018)
   
   
   ### Language / Project Type / NetBeans Component
   
   Java Maven Project
   
   ### How to reproduce
   
   I'm not sure. 
   
   I have seen this once before. 
   
   Moving the class back to its original package didn't trigger the fault. Moving the class again also didn't trigger the fault. Even when the error occurred, the move appeared to work successfully. The error popup asked me to attach a file from /var/logs/ but I can't find that directory.
   
   ### Did this work correctly in an earlier version?
   
   No / Don't know
   
   ### Operating System
   
   Win11
   
   ### JDK
   
   JDK24
   
   ### Apache NetBeans packaging
   
   Apache NetBeans provided installer
   
   ### Anything else
   
   
   
   
   ### Are you willing to submit a pull request?
   
   No


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: [I] Move Class Refactoring exception [netbeans]

Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien closed issue #8624: Move Class Refactoring exception
URL: https://github.com/apache/netbeans/issues/8624


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: [I] Java Refactoring exception [netbeans]

Posted by "homberghp (via GitHub)" <gi...@apache.org>.
homberghp commented on issue #8624:
URL: https://github.com/apache/netbeans/issues/8624#issuecomment-3023004656

   Duplicate of #8626, added by the same person.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists