Matthias Bläsing created NETBEANS-299:
-----------------------------------------
Summary: Opening java class files causes IllegalArgumentException
from JavacTool
Key: NETBEANS-299
URL: https://issues.apache.org/jira/browse/NETBEANS-299
Project: NetBeans
Issue Type: Bug
Components: java - Compiler
Affects Versions: 9.0
Reporter: Matthias Bläsing
I often open class files when browsing the maven dependencies of a project.
With netbeans 9 I get exceptions from the JavacTool. It does not matter whether
the maven project has sources associated or if the disassembler is used.
The exception:
{noformat}
java.lang.IllegalArgumentException: Compilation unit is not of SOURCE kind:
"Encoder.class"
at com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:161)
at
org.netbeans.modules.java.source.parsing.JavacParser.createJavacTask(JavacParser.java:873)
at
org.netbeans.modules.java.source.parsing.JavacParser.createJavacTask(JavacParser.java:727)
at
org.netbeans.modules.java.source.parsing.CompilationInfoImpl.getJavacTask(CompilationInfoImpl.java:374)
at
org.netbeans.modules.java.source.parsing.ClassParser.getResult(ClassParser.java:160)
at
org.netbeans.modules.parsing.impl.TaskProcessor.callGetResult(TaskProcessor.java:608)
at
org.netbeans.modules.parsing.impl.SourceCache.getResult(SourceCache.java:239)
at
org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.run(TaskProcessor.java:775)
at org.openide.util.lookup.Lookups.executeWith(Lookups.java:279)
at
org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.execute(TaskProcessor.java:702)
[catch] 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){noformat}
Steps to reproduce:
* open a maven project with dependencies
* open the dependencies node
* select on dependency and expand it
* open a class file by double clicking on it
When selecting a class file in the favorites window. It does not happen if the
file is opened by the "Go to source" action invoked on the import statement for
the corresponding class.
--
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