| Summary: | NPE in JDT compiler | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Vincent Privat <vincent.privat> | ||||||
| Component: | Core | Assignee: | Srikanth Sankaran <srikanth_sankaran> | ||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | amj87.iitr, Olivier_Thomann | ||||||
| Version: | 3.7.1 | ||||||||
| Target Milestone: | 3.8 M3 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows 7 | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Vincent Privat
Created attachment 203929 [details]
Errors log file
I can see how this is possible. Now, I could not find a test case to reproduce this issue. The targetConstructor can be set to null on line 417. And we never check for null. I propose to insert: if (targetConstructor == null) return false; This must be a case where there is already an error in the code. I'll attach a patch shortly. Created attachment 203931 [details]
Proposed fix
A regression test must be found for this problem.
Vincent, if you have a chance to describe in what circumstances this is failing, it would be helpful to write a regression test. (In reply to comment #0) > Build Identifier: M20110909-1335 > > I've just got an NPE with the attached stack trace, while editing a simple Java Vincent, if its a simple Java class, can you please attach it (or a class that mimics it?) Thanks! In the log file, you can see the source of the class generating this issue
(OsmImporter).
The compiler errors are the following:
- this statement declares a static final object with an unhlandled exception
from its constructor:
public static final MimeType OSM_XML_MIME_TYPE = new
MimeType("application/x-osm+xml");
- this statement is an incomplete constructor (the one I was writing when the
exception happened):
public OsmImporter(ExtensionFileFilter filter) {
this(filter, );
}
And, that's all. Once this error occurs, it looks like there's a whole bunch of
recursal exceptions on each operator action inside this file (mouse over a
underlined error, click on the error marker, etc.)
I could not still reproduce the problem with the scenario described in comment 6, however the patch from comment# 3 looks good and has been released into master for 3.8 M3. Commit id: fcd23c7f31f72a5138ea1cad062c9d8a4a84f1dc. Verified for 3.8M3 via code inspection. |