Bug 36058 - Unknown NPE in log
Summary: Unknown NPE in log
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: 3.0 M1   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-04-04 04:05 EST by Alex Blewitt CLA
Modified: 2003-06-05 09:57 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Blewitt CLA 2003-04-04 04:05:47 EST
I have a log with some NPEs in it, attached to another bug (attachment 4444 [details])

http://bugs.eclipse.org/bugs/attachment.cgi?id=4444&action=view

It was suggested that I open a new bug for this attachment.

I think that these NPEs are related to the fact that I had a resource under CVS 
control which I deleted from the local filing system whilst unconnceted to the 
network. I think that I tried to perform a 'Commit deletion to CVS' in the 
quick-fix suggestion from the tasks window (it came up with informational 
message that 'resource had been deleted from local filing system') which of 
course failed; it may have been this that generated some of the NPEs.

Eclipse seemed to continue working fine after this (though a crash happened 
later, probably to do with an unrelated issue).

I can't remember much more about it; I'll clean the log, and if I get it again 
then I'll let you know.

Mac OS X.2.4 on Eclipse 2.1 with Java 1.3 and 1.4 installed
Comment 1 DJ Houghton CLA 2003-04-04 09:52:45 EST
Looking at the errors at the end of the log file, the NPE is coming from JDT.
Moving for comment.
Comment 2 Olivier Thomann CLA 2003-04-04 15:35:24 EST
You use "Sort members" on a compilation unit. I'd like to get the source of 
this compilation unit. It appears that you have a method without a return type 
and this is not handled.
Could you please provide the test case and we will investigate?
Comment 3 Olivier Thomann CLA 2003-04-04 17:08:39 EST
Add to CC'
Comment 4 Alex Blewitt CLA 2003-04-06 16:42:07 EDT
I'm not sure which compilation unit it was unfortunately.I did recall a problem (not sure it was related) in the sort members order; it sorted the static initialiser above the static field definitions:public class Thing {  static {    a = 4;  }  private static int a;}That resulted in a compile-time error, and was the default sort order out of the box. Moving the static block underneath the field definition resolved the compilation error, but it's possible that I ran the sort members after it put it there in the first place, and subsequently caused the error.If I can find out what file I used to generate this, then I'll let you know -- however, I don't know exactly what caused it. I'd also had another issue to do with a local flie being deleted and the CVS not realising or being happy with that change, but again, I don't think that's related either.
Comment 5 Olivier Thomann CLA 2003-04-08 10:33:33 EDT
I put it again in a more legible way :-).

I'm not sure which compilation unit it was unfortunately.I did recall a problem 
not sure it was related) in the sort members order; it sorted the static 
nitialiser above the static field definitions:
public class Thing {  static {    a = 4;  }  private static int a;}
That resulted in a compile-time error, and was the default sort order out of the 
box. Moving the static block underneath the field definition resolved the 
compilation error, but it's possible that I ran the sort members after it put it 
there in the first place, and subsequently caused the error.If I can find out 
what file I used to generate this, then I'll let you know -- however, I don't 
know exactly what caused it. I'd also had another issue to do with a local file 
being deleted and the CVS not realising or being happy with that change, but 
again, I don't think that's related either.
Comment 6 Alex Blewitt CLA 2003-04-08 10:43:58 EDT
Sorry, the browser I'm using doesn't split the paragraphs into separate lines.
Bugzilla doesn't like long lines, or at least doesn't split them.

I've tried to do the things I was doing before (with the static member) but have
yet to re-create the log error that I saw earlier.
Comment 7 Olivier Thomann CLA 2003-04-08 14:30:14 EDT
Do you remember if you had any error prior to sort members?
I am trying to isolate a test case, but I need to find out first what you have done.
Comment 8 Olivier Thomann CLA 2003-04-08 16:02:26 EDT
I can easily add a null check, but I'd like to understand how this is possible.
Comment 9 Olivier Thomann CLA 2003-04-08 16:06:45 EDT
Ok, I reproduced the same problem.
You must have a compilation which contains a method without return type that is
not a constructor. Then sorting members on such a compilation unit would lead to
the NPE you saw.
Fixed and released in 2.2 stream.
Comment 10 Olivier Thomann CLA 2003-04-08 16:12:47 EDT
Regression test added.
Comment 11 David Audel CLA 2003-06-05 09:57:34 EDT
Verified.