Bug 49935 - NullPointerException thrown when editing a java file
Summary: NullPointerException thrown when editing a java file
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.0 M7   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: vm
Depends on:
Blocks:
 
Reported: 2004-01-13 14:20 EST by Tomas Znamenacek CLA
Modified: 2004-01-28 10:57 EST (History)
0 users

See Also:


Attachments
Log file for the NullPointerException (96.96 KB, text/plain)
2004-01-13 14:21 EST, Tomas Znamenacek CLA
no flags Details
Another log for the NullPointerException problem (138.16 KB, text/plain)
2004-01-13 17:15 EST, Tomas Znamenacek CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Znamenacek CLA 2004-01-13 14:20:06 EST
My Java project contains a folder with java files and their class files. This 
folder is not a source folder of the project but it is included as class 
folder on the Libraries tab on Java Build Path page on the project properties 
dialog.
After a while of editing a java file from this folder, when I try to save the 
file, I get an error message saying that the file could not be saved because 
there was a NullPointerException thrown.
Comment 1 Tomas Znamenacek CLA 2004-01-13 14:21:07 EST
Created attachment 7424 [details]
Log file for the NullPointerException
Comment 2 Olivier Thomann CLA 2004-01-13 15:48:13 EST
Could you please try to start your Eclipse workspace disabling the JIT?
-vmargs -Djava.compiler=NONE
If this doesn't fix it, please provide a reproducable test case.
Comment 3 Tomas Znamenacek CLA 2004-01-13 17:14:35 EST
I have removed the folder containing the java files I edit from project's 
libraries and I was able to edit the files fine. Then I had to edit a file 
that is in the source folder for the project and after few changes, I got the 
NullPointerException. I will attach another log file I got after that.
Comment 4 Tomas Znamenacek CLA 2004-01-13 17:15:51 EST
Created attachment 7426 [details]
Another log for the NullPointerException problem
Comment 5 Tomas Znamenacek CLA 2004-01-13 17:24:28 EST
I'm now running the Eclipse with JIT disabled, I will provide log as soon as 
the NullPointerException shows up again.
As to the testcase, it is contained in the bug description. It didn't take 
more than 10 minutes to get the exception.
Comment 6 Tomas Znamenacek CLA 2004-01-13 19:26:03 EST
I've been running the Eclipse for about an hour with JIT disabled and the 
exception hasn't been thrown. However, in my opinion, disabling JIT can not be 
considered a fix for the problem because it makes Eclipse very slow.
If after your tests with the scenario I've described, you conclude that there 
is nothing to fix in Eclipse code and the problem is being caused by JVM, I 
hope you can provide IBM Java team with a test scenario to have the JVM fixed.
The JVM I'm using is (fullversion) :
J2RE 1.4.1 IBM Windows 32 build cn1411-20031011
Comment 7 Philipe Mulet CLA 2004-01-14 06:15:29 EST
Can you provide sources or even your workspace so we can reproduce it ?
Comment 8 Philipe Mulet CLA 2004-01-14 06:23:07 EST
Actually, you should report this to the VM vendor directly with steps to 
reproduce. Eclipse is VM agnostic.
Comment 9 Philipe Mulet CLA 2004-01-14 06:30:51 EST
To clarify. Olivier asked you to turn the JIT off, so as to disable the VM 
optimizer which has some bugs (and we saw a couple of these hurting us).

By doing so, it proved that the Java compiler is innocent and that the VM is 
guilty. You don't want to run with JIT off in production mode of course.

Either you should report this to the VM vendor, or switch to another VM. I 
would strongly recommend the first one, as this is the only way you'll get the 
VM improved in the future.

Closing as VM bug.
Comment 10 Tomas Znamenacek CLA 2004-01-14 08:23:51 EST
This is not the first time I have experienced problems with Eclipse that were 
caused by JVM. However, EVERY TIME, the only thing the Eclipse team has done 
was blame JVM, close the bug and asked the end user to report to JVM vendor... 
Eclipse team, closing this bug might help you lower the number of bugs, but 
did you help me, YOUR CUSTOMER ??? NOT AT ALL !!!
I'm reopening the bug in order to see something being done with regards to 
this issue, be it either a report to JVM vendor or at least a few lines put 
into documentation to warn the users that this problem might occur.
Comment 11 Philipe Mulet CLA 2004-01-14 09:02:04 EST
This bug database is reserved to Eclipse bugs. This issue is a VM JIT bug and 
has nothing to do with Eclipse codebase. Also note that the VM you are using 
isn't a final version. In order for anything to occur, input has to come from 
*you* to VM vendor with reproducing steps.

Closing as invalid.
Comment 12 Tomas Znamenacek CLA 2004-01-14 11:57:04 EST
I agree that this bug was not an Eclipse bug, however, it is a problem that 
the Eclipse user's might run into. Something has to be done...

At the moment, the problem is still there, so the bug can not have status 
of "resolved".
Also, the problem is real and occurs in a valid scenario, so this bug can not 
have a resolution of "invalid".
I'm reopening the bug again for above reasons.
Comment 13 Philipe Mulet CLA 2004-01-14 12:13:37 EST
Bug isn't receivable from Eclipse standpoint. 
See comment #11.

Please rather report this to VM vendor directly rather than harassing us to get 
it done for you.
Comment 14 Tomas Znamenacek CLA 2004-01-14 12:25:23 EST
Sorry, I was under the impression that the Eclipse has been created FOR US, 
the USERS, and you will do as much as possible to make it a usable tool, even 
if all you can do is put something into the documentation...
As to the informing the JVM Vendor, I would have done it if the problem was 
causing problems in my product, however, it is Eclipse that is crashing...
Comment 15 Philipe Mulet CLA 2004-01-14 12:46:03 EST
So we would have to document that using an intermediate drop of some VM did 
make Eclipse crash ? Big deal. What is important for the company you work for 
is that this bug is resolved. Given you seem to have reproduceable steps, you 
should be realizing that you are in a good position to help the VM team to 
solve this issue. We simply cannot solve this problem for them, neither for you.

Comment 16 Tomas Znamenacek CLA 2004-01-14 13:39:42 EST
I have first found the issue with following JVM :
J2RE 1.4.1 IBM Windows 32 build cn1411-20030930
What is the JVM that you have tested this scenario with and got no exception ?
Comment 17 Philipe Mulet CLA 2004-01-21 11:37:18 EST
Other vendor VMs do not expose this issue. Also note that the code you have in 
your workspace is directly creating the error scenario.
Comment 18 Tomas Znamenacek CLA 2004-01-21 12:03:58 EST
I've been running Eclipse on another machine with latest JVM from Sun for a 
while now and I have to admit that I had no NullPointerException as I reported 
earlier.
As to my code creating the error scenario, I'm not sure what exactly you meant 
by that statement. If you have time to explain, I would appreciate it.
Comment 19 Philipe Mulet CLA 2004-01-21 12:10:40 EST
Compiling your source code causes the VM running underneath to crash.
Comment 20 Tomas Znamenacek CLA 2004-01-21 12:24:52 EST
In the original scenario I was editing a file that was not in the source 
folder so I'm not sure why it would be compiled.
Comment 21 Philipe Mulet CLA 2004-01-28 10:07:37 EST
FYI - when using IBM JREs, you should also specify the command line option "-
Xj9" which will likely make these JIT bug go away.
Comment 22 Tomas Znamenacek CLA 2004-01-28 10:57:02 EST
Interesting info, thanks.