Community
Participate
Working Groups
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
Looking at the errors at the end of the log file, the NPE is coming from JDT. Moving for comment.
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?
Add to CC'
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.
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.
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.
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.
I can easily add a null check, but I'd like to understand how this is possible.
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.
Regression test added.
Verified.