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

NullPointerException with "Pull up" refactoring

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 11.0
    • None
    • java - Refactoring
    • None

    Description

      Netbeans throws a NPE when I try too pull a method from a class to an interface it implements. In the "Pull up" window the method I wanted to move was selected and marked as "Make Abstract. Also the other methods in my class were marked as "Make Abstract", although not selected.

      This is the exception stack trace:

      java.lang.NullPointerException
      at org.netbeans.modules.refactoring.java.plugins.PullUpTransformer.addAbstractMemberToTarget(PullUpTransformer.java:163)
      at org.netbeans.modules.refactoring.java.plugins.PullUpTransformer.addMembersToTarget(PullUpTransformer.java:108)
      at org.netbeans.modules.refactoring.java.plugins.PullUpTransformer.visitClass(PullUpTransformer.java:82)
      at org.netbeans.modules.refactoring.java.plugins.PullUpTransformer.visitClass(PullUpTransformer.java:57)
      at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:814)
      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.spi.RefactoringVisitor.scan(RefactoringVisitor.java:76)
      at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:106)
      at jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:114)
      at jdk.compiler/com.sun.source.util.TreeScanner.visitCompilationUnit(TreeScanner.java:145)
      at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:597)
      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.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:672)
      at org.netbeans.api.java.source.JavaSource$1.run(JavaSource.java:662)
      at org.netbeans.api.java.source.JavaSource$MultiTask.run(JavaSource.java:501)
      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:451)
      at org.netbeans.api.java.source.JavaSource.runUserActionTask(JavaSource.java:422)
      at org.netbeans.api.java.source.JavaSource.runModificationTask(JavaSource.java:683)
      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.PullUpRefactoringPlugin.prepare(PullUpRefactoringPlugin.java:261)
      [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:2033)
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            aldobrucale Aldo Brucale
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: