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

IllegalArgumentExcedption thrown if var type used for instance variables

    XMLWordPrintableJSON

Details

    Description

      Var type can only be used for local variables but this exception should not be thrown. We should display appropriate hint for invalid var usage.

      java.lang.IllegalArgumentException: Unsupported type: none, kind: NONE
      at org.netbeans.modules.java.source.usages.ClassFileUtil.encodeType(ClassFileUtil.java:294)
      at org.netbeans.modules.java.source.usages.ClassFileUtil.createFieldDescriptor(ClassFileUtil.java:148)
      at org.netbeans.api.java.source.ElementHandle.createImpl(ElementHandle.java:476)
      at org.netbeans.api.java.source.ElementHandle.create(ElementHandle.java:397)
      at org.netbeans.modules.java.navigation.CaretListeningTask.updateNavigatorSelection(CaretListeningTask.java:296)
      at org.netbeans.modules.java.navigation.CaretListeningTask.run(CaretListeningTask.java:153)
      at org.netbeans.modules.java.navigation.CaretListeningTask.run(CaretListeningTask.java:55)
      [catch] at org.netbeans.modules.java.source.JavaSourceAccessor$CancelableTaskWrapper.run(JavaSourceAccessor.java:273)
      at org.netbeans.modules.parsing.impl.TaskProcessor.callParserResultTask(TaskProcessor.java:561)
      at org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.run(TaskProcessor.java:786)
      at org.openide.util.lookup.Lookups.executeWith(Lookups.java:279)
      at org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.execute(TaskProcessor.java:702)
      at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:663)
      at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514)
      at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      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

        1. JavaApplication4.java
          1 kB
          Rick Hegarty

        Issue Links

          Activity

            People

              rtaneja Reema Taneja
              rtaneja Reema Taneja
              Votes:
              0 Vote for this issue
              Watchers:
              3 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 - 2h 20m
                  2h 20m