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.

Bug 50161 - [gjast] 'Invalid AST returned from parser' exception
Summary: [gjast] 'Invalid AST returned from parser' exception
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 4.x
Hardware: All All
: P3 blocker (vote)
Assignee: _ tball
URL:
Keywords:
: 50194 50201 50390 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-10-08 10:41 UTC by Jan Chalupa
Modified: 2007-09-26 09:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Dump in case of an unfinished import statement. (1.78 KB, text/plain)
2004-10-11 10:15 UTC, Martin Matula
Details
Dump in case of an unfinished throws clause. (1.81 KB, text/plain)
2004-10-11 10:19 UTC, Martin Matula
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Chalupa 2004-10-08 10:41:57 UTC
[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.
Comment 1 Jan Chalupa 2004-10-08 10:42:33 UTC
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)

Comment 2 jasondonmoyer 2004-10-08 19:23:25 UTC
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.
Comment 3 Martin Matula 2004-10-11 09:05:26 UTC
*** Issue 50201 has been marked as a duplicate of this issue. ***
Comment 4 Martin Matula 2004-10-11 09:06:03 UTC
*** Issue 50194 has been marked as a duplicate of this issue. ***
Comment 5 Martin Matula 2004-10-11 10:02:00 UTC
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.
Comment 6 Martin Matula 2004-10-11 10:02:19 UTC
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
Comment 7 Martin Matula 2004-10-11 10:13:33 UTC
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.
Comment 8 Martin Matula 2004-10-11 10:15:38 UTC
Created attachment 18186 [details]
Dump in case of an unfinished import statement.
Comment 9 Martin Matula 2004-10-11 10:19:12 UTC
Created attachment 18187 [details]
Dump in case of an unfinished throws clause.
Comment 10 Pavel Flaska 2004-10-12 09:34:40 UTC
Tom, isn't this fixed already?
Comment 11 _ tball 2004-10-12 15:29:17 UTC
Fixed cloning of ERRONEOUS tree types.
Comment 12 Martin Matula 2004-10-13 22:53:31 UTC
*** Issue 50390 has been marked as a duplicate of this issue. ***
Comment 13 Quality Engineering 2007-09-20 12:12:23 UTC
Reorganization of java component