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

ClassCastException calling "Implement all abstract methods"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 10.0
    • None
    • None
    • Ubuntu 18.04
      Netbeans is running on OpenJDK 11.0.1+13-Ubuntu-3ubuntu118.04ppa1
      The Java platform for the project is OpenJDK 1.8.0_191-8u191-b12-2ubuntu0.18.04.1-b12

    Description

      Invoking the "Implement all abstract methods" hint action produces a ClassCastException when the type of the parameters of the methods to implement is not in the classpath.

      Here is the stack trace:

      java.lang.ClassCastException: class com.sun.tools.javac.code.Type$ClassType cannot be cast to class com.sun.tools.javac.code.Type$ErrorType (com.sun.tools.javac.code.Type$ClassType and com.sun.tools.javac.code.Type$ErrorType are in unnamed module of loader org.netbeans.StandardModule$OneModuleClassLoader @2fd0241)
      at org.netbeans.modules.java.source.builder.TreeFactory.Type(TreeFactory.java:797)
      at org.netbeans.api.java.source.TreeMaker.Type(TreeMaker.java:1083)
      at org.netbeans.api.java.source.GeneratorUtilities.resolveWildcard(GeneratorUtilities.java:1784)
      at org.netbeans.api.java.source.GeneratorUtilities.createMethod(GeneratorUtilities.java:818)
      at org.netbeans.api.java.source.GeneratorUtilities.createMethod(GeneratorUtilities.java:1693)
      at org.netbeans.api.java.source.GeneratorUtilities.createAbstractMethodImplementation(GeneratorUtilities.java:721)
      at org.netbeans.api.java.source.GeneratorUtilities.createAbstractMethodImplementations(GeneratorUtilities.java:705)
      at org.netbeans.modules.java.hints.errors.ImplementAllAbstractMethods.generateAllAbstractMethodImplementations(ImplementAllAbstractMethods.java:587)
      at org.netbeans.modules.java.hints.errors.ImplementAllAbstractMethods$ImplementFixBase.generateImplementation(ImplementAllAbstractMethods.java:402)
      at org.netbeans.modules.java.hints.errors.ImplementAllAbstractMethods$ImplementAbstractMethodsFix.executeRound(ImplementAllAbstractMethods.java:548)
      at org.netbeans.modules.java.hints.errors.ImplementAllAbstractMethods$ImplementFixBase.run(ImplementAllAbstractMethods.java:363)
      at org.netbeans.modules.java.hints.errors.ImplementAllAbstractMethods$ImplementFixBase.run(ImplementAllAbstractMethods.java:285)
      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$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.api.java.source.JavaSource.runModificationTask(JavaSource.java:683)
      at org.netbeans.modules.java.hints.errors.ImplementAllAbstractMethods$ImplementFixBase.implement(ImplementAllAbstractMethods.java:341)
      [catch] at org.netbeans.modules.editor.hints.HintsUI$1.run(HintsUI.java:810)
      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: