[ 
https://issues.apache.org/jira/browse/NETBEANS-463?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16410328#comment-16410328
 ] 

Rick Hegarty commented on NETBEANS-463:
---------------------------------------

Just to add that the *IllegalArgumentException* is not thrown in most cases of 
invalid *var* declarations. The only two scenarios I could find were two *var* 
declarations for instance variables like this:

*{color:#654982}var a = () -> "hello";{color}*

*{color:#654982}var e;{color}*

See the comments in the attached Java application below for more details.

 

 

NetBeans *Help -> About* details:

 
{color:#205081}*Product Version:* Apache NetBeans IDE Dev (Build 
incubator-netbeans-linux-375-on-20180320){color}

{color:#205081}*Java:* 1.8.0_162; Java HotSpot(TM) 64-Bit Server VM 
25.162-b12{color}

{color:#205081}*Runtime:* Java(TM) SE Runtime Environment 1.8.0_162-b12{color}

{color:#205081}*System:* Windows 10 version 10.0 running on amd64; Cp1252; 
en_US (nb){color}

{color:#205081}*User directory:* 
C:\Users\johndoe\AppData\Roaming\NetBeans\dev{color}

{color:#205081}*Cache directory:* 
C:\Users\johndoe\AppData\Local\NetBeans\Cache\dev{color}

 

 

> IllegalArgumentExcedption thrown if var type used for instance variables
> ------------------------------------------------------------------------
>
>                 Key: NETBEANS-463
>                 URL: https://issues.apache.org/jira/browse/NETBEANS-463
>             Project: NetBeans
>          Issue Type: Bug
>            Reporter: Reema Taneja
>            Assignee: Reema Taneja
>            Priority: Trivial
>              Labels: JDK10-LVTI
>         Attachments: JavaApplication4.java
>
>
> 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)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to