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 46404 - [gjast] Import statements stop working
Summary: [gjast] Import statements stop working
Status: CLOSED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 4.x
Hardware: PC Linux
: P2 blocker (vote)
Assignee: _ tball
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-21 18:27 UTC by Jesse Glick
Modified: 2007-09-26 09:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Log excerpt (22.35 KB, text/plain)
2004-07-21 18:28 UTC, Jesse Glick
Details
Exception now thrown every time I save the file (1.14 KB, text/plain)
2004-07-21 19:13 UTC, Jesse Glick
Details
More exceptions from MDR during my next IDE session, with a cleaned-out var/cache/mdrstorage/ (130.24 KB, text/plain)
2004-07-21 21:25 UTC, Jesse Glick
Details
The class in its finished state (6.32 KB, text/plain)
2004-07-22 18:16 UTC, Jesse Glick
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2004-07-21 18:27:35 UTC
I was just working on some simple Java class, no
dependencies, in its own j2seproject using JDK
1.5. After a while, for no apparent reason, Fast
Import stopped working; trying to import "URI" I
would only get some weird class inside Xerces (not
java.net.*), and for "FileFilter" I could select
the proper import (javax.swing.filechooser.*) but
then nothing was actually imported. Meanwhile, of
course the log file fills up with errors.
Comment 1 Jesse Glick 2004-07-21 18:28:20 UTC
Created attachment 16368 [details]
Log excerpt
Comment 2 Jesse Glick 2004-07-21 18:28:34 UTC
In 040720, JDK 1.5.0 b58.
Comment 3 Jesse Glick 2004-07-21 19:12:15 UTC
As a nice postscript: I then tried Tools > Re-scan Project Classpaths
to recover. About ten minutes later when it had finished (!) I noticed
an InvalidObjectException, which now is thrown every time I save the
file I was working on. I guess I need to shut down the IDE, delete my
cache, and start up again.
Comment 4 Jesse Glick 2004-07-21 19:13:07 UTC
Created attachment 16369 [details]
Exception now thrown every time I save the file
Comment 5 Jesse Glick 2004-07-21 21:22:55 UTC
Shutting down and deleting the cache and restarting *did* help for a
while. Then I changed the JDK for the project to 1.4.2_04 (from the
default platform, 1.5.0 b58) and immediately started getting
exceptions again. Bad, too - could not run the project with F6 because
the IDE thought the main class was not set.
Comment 6 Jesse Glick 2004-07-21 21:25:29 UTC
Created attachment 16376 [details]
More exceptions from MDR during my next IDE session, with a cleaned-out var/cache/mdrstorage/
Comment 7 psuk 2004-07-22 17:11:34 UTC
3 problems here:
a) Inconsistent storage. (1 != 0)
b) Neither re-scan nor autorecovery helped
-> P2

c) changing platform from default 1.5.0 b58 to 1.4.2_04 caused
problems in MDR
Comment 8 Martin Matula 2004-07-22 17:53:49 UTC
This looks like a parser problem (based on the exception in the first
log excerpt). If you see gjast or javac somewhere on a stacktrace
please attach the file in the state it was when you got the exception.
Otherwise we can hardly reproduce it.
Btw. I believe re-scan did help - the IOE problem after
re-scan/switchinig platform/autorecovery is a separate issue (in fact
several issues already filed - it should disappear after restart
except for the case when the autorecovery needs to be involved again
and again because of some parser/scanner error - no need to delete
storages).
Comment 9 Jesse Glick 2004-07-22 18:16:52 UTC
Created attachment 16396 [details]
The class in its finished state
Comment 10 Jesse Glick 2004-07-22 18:21:38 UTC
Well I have attached the class in its finished state. Of course I
cannot exactly remember what it looked like when I was editing it.

Anyway if there start to be parser errors thrown to console that I am
not aware of, and only later (after I have edited some more) is a
visible exception thrown, there is no chance of providing a snapshot
of the file at the exact time the parser failed. Suggest perhaps that
the parser keep a snapshot of the text of any edited class that it
fails badly on, and either print it to console right then, or save it
in memory and print it in case you start getting inconsistent storage
problems. Otherwise it is very difficult to supply you with accurate
data for bug reports, especially when I am trying to concentrate on
writing my own code and may not be paying attention to how well or
poorly code completion etc. is working.
Comment 11 Martin Matula 2004-07-22 18:59:50 UTC
I understand. I don't blame you. I was just trying to explain that it
is hard for us to fix this kind of bugs without the source file that
reproduced them.
Writing the files that caused problems to the parser to the log is a
great idea. But I am not sure if there are no legal problems with it
(one may then accidentally attach ide log containing some secret
sources without being aware of it). Console should probably be fine,
but the shell usually wraps lines which may in fact change the file
that caused the problem. Maybe we could dump the source into a
separate file in var/log directory and say that in log/console (e.g.
"Error in parser. Problematic source dumped to
$userdir/var/log/sourcedump001.txt"). What do you think?
Comment 12 Jesse Glick 2004-07-22 20:21:13 UTC
"Maybe we could dump the source into a separate file in var/log
directory and say that in log/console (e.g. "Error in parser.
Problematic source dumped to $userdir/var/log/sourcedump001.txt").
What do you think?" - yes, nice idea; leaves the user in control of
what to report.

Should probably limit number of such dumps (to 1 or 5 or something);
if you get a lot of errors you don't want your log dir filling up with
copies of your sources.

I assume that normal syntax errors in your source code that the parser
correctly detects and marks as errors would not trigger this debug
mode - only actual problems in the parser (with either valid or
invalid source code).
Comment 13 Pavel Flaska 2004-07-23 15:27:44 UTC
Source-dump added. Dumps goes to {userdir}/var/log/source[12345].dump
files.

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.13; previous revision: 1.12
done
Processing log script arguments...
Comment 14 Tomas Hurka 2004-07-26 12:16:48 UTC
IndexOutOfBoundsException is from gjast code. Reassigning to Tom Ball.
Comment 15 _ tball 2004-08-06 18:44:07 UTC
Appears fixed with latest build -- no log exceptions, java.net.URL
correctly found.
Comment 16 Jiri Prox 2005-07-11 14:58:27 UTC
Jesse can you, please, verify this issue? Thanks.
Comment 17 Jesse Glick 2005-07-12 23:23:48 UTC
Probably impossible for me to verify.
Comment 18 Milan Kubec 2005-07-13 08:01:52 UTC
No way to verify = closed.
Comment 19 Quality Engineering 2007-09-20 12:09:33 UTC
Reorganization of java component