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

Travis commented on NETBEANS-2938:
----------------------------------

The attached zip file contains a simple project which demonstrates the issue 
repeatably for me on both Netbeans 11.0 and 11.1.  To trigger the exception 
again and again, I can just run "Source:Scan for External Changes".

I even tried a fresh installation of Netbeans 11.1, this time using the bin.zip 
instead of the Windows .exe installer.  That made no difference... same 
exception happens.

Since same exception happens on two projects with non-overlapping source code, 
I think this has absolutely nothing to do with my source .java code, and would 
happen on any Java project using my environment.

> StringIndexOutOfBoundsException while parsing Java 12 sources
> -------------------------------------------------------------
>
>                 Key: NETBEANS-2938
>                 URL: https://issues.apache.org/jira/browse/NETBEANS-2938
>             Project: NetBeans
>          Issue Type: Bug
>          Components: java - Source
>    Affects Versions: 11.0, 11.1
>         Environment: Windows 10
> Netbeans 11.0 or 11.1, with nb-javac 1.6
> OpenJDK 12
> JavaFX 12
> Gradle 5.5
>            Reporter: Travis
>            Assignee: ARUNAVA SINHA
>            Priority: Major
>         Attachments: tiny-netbeans-gradle-demo-project.zip
>
>
> With Netbeans 11.0 on Windows, after updating from JDK 8 to OpenJDK 12 + 
> JavaFX 12, I started getting the following exception.
> After this exception, since the source scan failed various IDE features don't 
> work (Navigator pane says "Please Wait" forever, can't Navigate sources using 
> operations like "Go to Declaration", code refactoring doesn't work, etc).  
> The IDE is pretty useless while in this state.
> Strangely, I am running Netbeans 11.0 on Linux and didn't have this same 
> problem there.
> I saw this on proprietry code, and can't share it.  If necessary I could try 
> to provide a tiny code example that demonstrates the same issue.
>  
> An error occurred during parsing of 'C:\<redacted>.java'. Please report a bug 
> against java/source and attach dump file 'C:\<redacted>.dump'.
>  Caused: java.lang.StringIndexOutOfBoundsException: String index out of 
> range: -1
>  at java.lang.String.substring(String.java:1967)
>  at 
> org.netbeans.modules.java.j2seplatform.queries.QueriesCache.getURL(QueriesCache.java:156)
>  at 
> org.netbeans.modules.java.j2seplatform.queries.QueriesCache.loadRoots(QueriesCache.java:123)
>  at 
> org.netbeans.modules.java.j2seplatform.queries.QueriesCache.getRoots(QueriesCache.java:71)
>  at 
> org.netbeans.modules.java.j2seplatform.queries.DefaultSourceForBinaryQuery.findSourceRoots2(DefaultSourceForBinaryQuery.java:37)
>  at 
> org.netbeans.api.java.queries.SourceForBinaryQuery.findSourceRoots2(SourceForBinaryQuery.java:101)
>  at 
> org.netbeans.modules.parsing.impl.indexing.PathRegistry.sourceForBinaryQuery(PathRegistry.java:191)
>  at 
> org.netbeans.modules.parsing.impl.indexing.PathRegistry.sourceForBinaryQuery(PathRegistry.java:168)
>  at 
> org.netbeans.modules.java.source.classpath.CacheClassPath.getResources(CacheClassPath.java:148)
>  at org.netbeans.api.java.classpath.ClassPath.entries(ClassPath.java:363)
>  at 
> org.netbeans.modules.java.source.parsing.CachingFileManager.list(CachingFileManager.java:115)
>  at 
> org.netbeans.modules.java.source.parsing.ProxyFileManager.list(ProxyFileManager.java:115)
>  at com.sun.tools.javac.code.ClassFinder.list(ClassFinder.java:801)
>  at com.sun.tools.javac.code.ClassFinder.scanUserPaths(ClassFinder.java:709)
>  at com.sun.tools.javac.code.ClassFinder.fillIn(ClassFinder.java:589)
>  at com.sun.tools.javac.code.ClassFinder.complete(ClassFinder.java:312)
>  at com.sun.tools.javac.code.Symbol.complete(Symbol.java:645)
>  at com.sun.tools.javac.code.Symbol$PackageSymbol.members(Symbol.java:1142)
>  at com.sun.tools.javac.code.Symtab.listPackageModules(Symtab.java:860)
>  at com.sun.tools.javac.comp.Enter.visitTopLevel(Enter.java:390)
>  at 
> com.sun.tools.javadoc.main.JavadocEnter.visitTopLevel(JavadocEnter.java:89)
>  at 
> org.netbeans.lib.nbjavac.services.NBJavadocEnter.visitTopLevel(NBJavadocEnter.java:87)
>  at com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:537)
>  at com.sun.tools.javac.comp.Enter.classEnter(Enter.java:328)
>  at com.sun.tools.javac.comp.Enter.classEnter(Enter.java:343)
>  at com.sun.tools.javac.comp.Enter.complete(Enter.java:813)
>  at 
> org.netbeans.lib.nbjavac.services.NBJavadocEnter.main(NBJavadocEnter.java:67)
>  at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:1142)
>  at com.sun.tools.javac.api.JavacTaskImpl.enter(JavacTaskImpl.java:399)
>  at com.sun.tools.javac.api.JavacTaskImpl.enter(JavacTaskImpl.java:327)
>  at 
> org.netbeans.modules.java.source.parsing.JavacParser.moveToPhase(JavacParser.java:623)
>  at 
> org.netbeans.modules.java.source.parsing.JavacParser.getResult(JavacParser.java:484)
>  at 
> org.netbeans.modules.java.source.parsing.JavacParser.getResult(JavacParser.java:136)
>  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.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>  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.14#76016)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

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

Reply via email to