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

Record (preview feature) name refactoring not working.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 12.1
    • java - Editor
    • OpenJDK Runtime Environment 14-ea+27-1339

    Description

      Renaming record name using refactoring(crtl+R) throwing exception. 

      Steps to reproduce:

      1. Create a class of type record:

      e.g public record RecordNameRefactor(){}

      2. Try to change/rename the record class name using Refactor->name option or (crtl + R)

       

      Actual Result :  Throwing exception on UI

      Expected Result : NB UI should allow to rename record

       

      Stack Trace :

      java.lang.IllegalArgumentException: Invalid node's kind. Supported kinds are BREAK, CLASS, CONTINUE, IDENTIFIER, LABELED_STATEMENT, MEMBER_SELECT, METHOD, TYPE_PARAMETER, VARIABLE
      at org.netbeans.api.java.source.TreeMaker.setLabelImpl(TreeMaker.java:2996)
      at org.netbeans.api.java.source.TreeMaker.setLabel(TreeMaker.java:2856)
      at org.netbeans.modules.refactoring.java.plugins.RenameTransformer.renameDeclIfMatch(RenameTransformer.java:435)
      at org.netbeans.modules.refactoring.java.plugins.RenameTransformer.visitClass(RenameTransformer.java:396)
      at org.netbeans.modules.refactoring.java.plugins.RenameTransformer.visitClass(RenameTransformer.java:59)
      at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:824)
      at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
      at org.netbeans.modules.refactoring.java.spi.RefactoringVisitor.scan(RefactoringVisitor.java:192)
      at org.netbeans.modules.refactoring.java.plugins.RenameTransformer.scan(RenameTransformer.java:87)
      at org.netbeans.modules.refactoring.java.plugins.RenameTransformer.scan(RenameTransformer.java:59)
      at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:105)
      at jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:113)
      at jdk.compiler/com.sun.source.util.TreeScanner.visitCompilationUnit(TreeScanner.java:144)
      at org.netbeans.modules.refactoring.java.plugins.RenameTransformer.visitCompilationUnit(RenameTransformer.java:115)
      at org.netbeans.modules.refactoring.java.plugins.RenameTransformer.visitCompilationUnit(RenameTransformer.java:59)
      at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:604)
      at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
      at org.netbeans.modules.refactoring.java.spi.RefactoringVisitor.scan(RefactoringVisitor.java:192)
      at org.netbeans.modules.refactoring.java.plugins.RenameTransformer.scan(RenameTransformer.java:87)
      at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin$TransformTask.run(JavaRefactoringPlugin.java:443)
      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$UserTaskAction.run(ParserManager.java:130)
      at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:114)
      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:81)
      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)
      [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: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:2035)

       

      Attachments

        Activity

          People

            singh-akhilesh Akhilesh Singh
            singh-akhilesh Akhilesh Singh
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 50m
                50m