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

NullPointerException when replacing type of element in List using clipboard

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 10.0
    • None
    • editor - Other
    • None

    Description

      I had this Java code:
      javax.​persistence.Query query = entityManager....;
      List<?> lastKeyIds = query.getResultList();
      if (!lastKeyIds.isEmpty()) ...

      and tried to replace element type from "?" (in "List<?>") by pasting "BigDecimal" from clipboard. When I tried to repeat the same action, it didn't fail.

      NetBeans stacktrace:

      java.lang.NullPointerException
      at org.netbeans.lib.nbjavac.services.NBJavadocMemberEnter.visitVarDef(NBJavadocMemberEnter.java:97)
      at com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:962)
      at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:172)
      at com.sun.tools.javac.comp.Attr.visitVarDef(Attr.java:1184)
      at com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:962)
      at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:673)
      at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:749)
      at com.sun.tools.javac.comp.Attr.attribStats(Attr.java:773)
      at com.sun.tools.javac.comp.Attr.visitBlock(Attr.java:1350)
      at org.netbeans.lib.nbjavac.services.NBAttr.visitBlock(NBAttr.java:73)
      at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1026)
      at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:673)
      at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:749)
      at com.sun.tools.javac.comp.Attr.attribStatToTree(Attr.java:431)
      at com.sun.tools.javac.api.JavacTrees.attribStatToTree(JavacTrees.java:1017)
      at com.sun.tools.javac.api.JavacTrees.getAttrContext(JavacTrees.java:976)
      at com.sun.tools.javac.api.JavacTrees.getScope(JavacTrees.java:835)
      at com.sun.tools.javac.api.JavacTrees.getScope(JavacTrees.java:172)
      at org.netbeans.modules.java.editor.imports.ClipboardHandler$6.run(ClipboardHandler.java:249)
      at org.netbeans.modules.java.editor.imports.ClipboardHandler$6.run(ClipboardHandler.java:243)
      at org.netbeans.modules.java.editor.imports.ClipboardHandler$7$1.run(ClipboardHandler.java:321)
      at org.netbeans.modules.java.editor.imports.ClipboardHandler$7$1.run(ClipboardHandler.java:316)
      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$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:451)
      at org.netbeans.api.java.source.JavaSource.runUserActionTask(JavaSource.java:422)
      at org.netbeans.modules.java.editor.imports.ClipboardHandler$7.run(ClipboardHandler.java:316)
      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)
      Caused: org.openide.util.RequestProcessor$FastItem: task failed due to

      Attachments

        1. ide.log
          175 kB
          Vít Suchánek
        2. ui.log
          323 kB
          Vít Suchánek

        Activity

          People

            Unassigned Unassigned
            vit.suchanek Vít Suchánek
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: