Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-3334

AssertionError when refactoring class name

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Duplicate
    • 11.2
    • None
    • java - Refactoring
    • Windows 10, Apache NetBeans 11.2, Java 13.0.1

    Description

      Hello,

      If I want to rename a class, right click on the file and choose Refactor -> Rename ... and enter a new name.

      However, it only works for the class that contains the start method, and it crashes for others.

      java.lang.AssertionErrorjava.lang.AssertionError at com.sun.tools.javac.util.Assert.error(Assert.java:155) at com.sun.tools.javac.util.Assert.checkNonNull(Assert.java:62) at com.sun.tools.javac.comp.Modules.setCompilationUnitModules(Modules.java:559) at com.sun.tools.javac.comp.Modules.enter(Modules.java:287) at com.sun.tools.javac.comp.Modules.enter(Modules.java:268) at com.sun.tools.javac.comp.Modules.initModules(Modules.java:259) at com.sun.tools.javac.main.JavaCompiler.initModules(JavaCompiler.java:1126) at com.sun.tools.javac.api.JavacTaskImpl.enter(JavacTaskImpl.java:393) at com.sun.tools.javac.api.JavacTaskImpl.enter(JavacTaskImpl.java:327) at org.netbeans.modules.java.source.parsing.JavacParser.moveToPhase(JavacParser.java:660) at org.netbeans.modules.java.source.parsing.CompilationInfoImpl.toPhase(CompilationInfoImpl.java:361) at org.netbeans.api.java.source.CompilationController.toPhase(CompilationController.java:84) at org.netbeans.api.java.source.WorkingCopy.toPhase(WorkingCopy.java:193) at org.netbeans.modules.refactoring.java.spi.RefactoringVisitor.setWorkingCopy(RefactoringVisitor.java:110) at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin$TransformTask.run(JavaRefactoringPlugin.java:425) at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin$TransformTask.run(JavaRefactoringPlugin.java:408) at org.netbeans.api.java.source.JavaSource$1.run(JavaSource.java:673) at org.netbeans.api.java.source.JavaSource$1.run(JavaSource.java:663) at org.netbeans.api.java.source.JavaSource$MultiTask.run(JavaSource.java:502) at org.netbeans.modules.parsing.impl.TaskProcessor.callUserTask(TaskProcessor.java:586) at org.netbeans.modules.parsing.api.ParserManager$MultiUserTaskAction.run(ParserManager.java:166) at org.netbeans.modules.parsing.api.ParserManager$MultiUserTaskAction.run(ParserManager.java:138) 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:83) at org.netbeans.api.java.source.JavaSource.runUserActionTaskImpl(JavaSource.java:452) at org.netbeans.api.java.source.JavaSource.runUserActionTask(JavaSource.java:423) at org.netbeans.api.java.source.JavaSource.runModificationTask(JavaSource.java:684) at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin.processFiles(JavaRefactoringPlugin.java:317) at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin.processFiles(JavaRefactoringPlugin.java:263) at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin.processFiles(JavaRefactoringPlugin.java:245) at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin.createAndAddElements(JavaRefactoringPlugin.java:326) at org.netbeans.modules.refactoring.java.plugins.RenameRefactoringPlugin.prepare(RenameRefactoringPlugin.java:626) 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:1418) at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45) at org.openide.util.lookup.Lookups.executeWith(Lookups.java:278) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)

      I tried it in version 11.1 and there it works without a problem.

      Please repair.

      Thank you

       

      Attachments

        1. picture.png
          10 kB
          Michal Rama

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Michal_cat Michal Rama
              Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: