This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
[4.0 build #20041008; JDK 1.5] Started with a clean userdir, created a new project with main class, added the following line to the 'main' method: List<String> strings = new ArrayList(); Moved up to add the import declarations for List and Array List. Typed: import<space> A RuntimeException "Invalid AST returned from parser" was thrown. It also suggested to submit a dump file var/log/Main.java.dump. However the file is empty.
java.lang.RuntimeException: Invalid AST returned from parser or error parsing 'golem/Main.java'. Please report a bug against java module and attach dump file 'D:\NetBeans\041008\bin/var/log/Main.java.dump'. at org.netbeans.modules.javacore.parser.ASTProvider.dumpSource(ASTProvider.java:520) at org.netbeans.modules.javacore.parser.ASTProvider.createASTree(ASTProvider.java:85) at org.netbeans.modules.javacore.parser.ASTProvider.getASTree(ASTProvider.java:108) at org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.directUpdate(ResourceImpl.java:523) at org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.checkUpToDate(ResourceImpl.java:480) at org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.updateFromDataObject(ResourceImpl.java:386) at org.netbeans.modules.javacore.ExclusiveMutex.parseIfNeeded(ExclusiveMutex.java:222) at org.netbeans.modules.javacore.ExclusiveMutex.enter(ExclusiveMutex.java:141) at org.netbeans.mdr.NBMDRepositoryImpl.beginTrans(NBMDRepositoryImpl.java:227) at org.netbeans.modules.java.JavaEditor$2.run(JavaEditor.java:230) at org.openide.util.Task.run(Task.java:136) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:330) [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:686)
I'm getting the same error (same netbeans build) by partially typing a new method and trying to copy the throws clause from another method. My dump file contains the contents of the file I was working on, but it's truncated after a certain point (the truncation point, however, is not where I was adding the new method). I would attach it, but it's proprietary.
*** Issue 50201 has been marked as a duplicate of this issue. ***
*** Issue 50194 has been marked as a duplicate of this issue. ***
I fixed the dumping of files. Also, since javacore is able to recover from any parser error, the parser error is now notified only as an informational exception. Since the exception is harmless and it now no longer bothers users with an exception dialog, I am changing the priority to P3.
Checking in src/org/netbeans/modules/javacore/parser/ASTProvider.java; /cvs/java/javacore/src/org/netbeans/modules/javacore/parser/ASTProvider.java,v <-- ASTProvider.java new revision: 1.27; previous revision: 1.26 done
After I fixed the problem with dumping of erroneous files, I found out there seems to be a regression in gjast (with older gjast I do not get this error). I will attach the dump containing the file and the exception that get's thrown from gjast. This is not critical, since as I said previously, javacore is able to handle it, however all information from the parser is lost unnecessarily. So IMO it should be fixed. Reassigning to Tom for evaluation.
Created attachment 18186 [details] Dump in case of an unfinished import statement.
Created attachment 18187 [details] Dump in case of an unfinished throws clause.
Tom, isn't this fixed already?
Fixed cloning of ERRONEOUS tree types.
*** Issue 50390 has been marked as a duplicate of this issue. ***
Reorganization of java component