Bug 213890 - [compiler] NPE while compiling classes with errors
Summary: [compiler] NPE while compiling classes with errors
Status: VERIFIED DUPLICATE of bug 170896
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3.1   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: 3.6 M7   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-26 11:39 EST by elecharny CLA
Modified: 2010-04-26 12:17 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 elecharny CLA 2007-12-26 11:39:23 EST
Build ID: M20071023-1652

Steps To Reproduce:
1. Introduce some compilation error in some code
2. Cleanup the projects
3. You get a NPE while compiling the code, in a place which has nothing to do with the bad code.


More information:
Here is the stack trace I get :

Severity and Description	Path	Resource	Location	Creation Time	Id
Internal compiler error
java.lang.NullPointerException
	at org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding.binarySearch(ReferenceBinding.java:108)
	at org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding.getMethods(ParameterizedTypeBinding.java:528)
	at org.eclipse.jdt.internal.compiler.lookup.Scope.findMethod(Scope.java:1063)
	at org.eclipse.jdt.internal.compiler.lookup.Scope.getMethod(Scope.java:2060)
	at org.eclipse.jdt.internal.compiler.ast.MessageSend.resolveType(MessageSend.java:417)
	at org.eclipse.jdt.internal.compiler.ast.ReturnStatement.resolve(ReturnStatement.java:216)
	at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:429)
	at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:196)
	at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:400)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1085)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1164)
	at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:366)
	at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:623)
	at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:392)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:362)
	at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.compile(BatchImageBuilder.java:173)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:299)
	at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:59)
	at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:269)
	at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:172)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:624)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:166)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:197)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:246)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:249)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:302)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:334)
	at org.eclipse.core.internal.resources.Workspace.build(Workspace.java:328)
	at org.eclipse.ui.actions.GlobalBuildAction$1.run(GlobalBuildAction.java:183)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
	shared-ldap/src/main/java/org/apache/directory/shared/ldap/schema	DefaultObjectClass.java	line 0	1198685607498	283607


The code I modified to get this error is certainly wrong, but I should not get such an error...

Here is the trace I get with Maven (which seems the origin of the syntax error I introduced) :
[INFO] Compilation failure

/home/elecharny/apacheds/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java:[149,19] cannot find symbol
symbol  : constructor AddOperationContext(org.apache.directory.shared.ldap.name.LdapDN,javax.naming.directory.Attributes,boolean)
location: class org.apache.directory.server.core.interceptor.context.AddOperationContext

/home/elecharny/apacheds/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java:[198,19] cannot find symbol
symbol  : constructor AddOperationContext(org.apache.directory.shared.ldap.name.LdapDN,javax.naming.directory.Attributes,boolean)
location: class org.apache.directory.server.core.interceptor.context.AddOperationContext

... (a lot more...)
Comment 1 Walter Harley CLA 2007-12-26 15:32:33 EST
Bug was incorrectly categorized as "APT" subcomponent; changing to "Core".

Looks to me like another occurrence of Bug 170896?  
Comment 2 elecharny CLA 2007-12-26 16:00:34 EST
Indeed...

I have a snapshot of my whole sources when the bug happened, but I'm afraid I doomed the workspace.

Is it from any interest that I attach a 18,5 Mb of source + subversion infos?

Last, not least, this error didn't occured again after I quit eclipse and launched it again. (FYI, I tested eclipse-3.4-M4 with the very same framework, and got the same NPE).
Comment 3 Frederic Fusier CLA 2007-12-31 06:34:10 EST
Are you using a JRockit 27.1 VM?
Comment 4 elecharny CLA 2007-12-31 06:43:41 EST
(In reply to comment #3)
> Are you using a JRockit 27.1 VM?
> 

27.4.0, actually (I just switched from 27.4.3, and I get the very same problem).

But I switched back to Sun 1.6_03 yesturday, because JRockit debugger seems to stale on some operations... So far, I haven't seen NPE while compiling the code with SUN JVM, so it may be a problem related to the JVM.

I keep an eye on this bug to see if I can reproduce it with SUN JVM. I may test it with IBM JVM too...
Comment 5 Frederic Fusier CLA 2007-12-31 08:35:46 EST
Thans for the feedback.
So, set so far as duplicate of bug 170896

*** This bug has been marked as a duplicate of bug 170896 ***
Comment 6 Frederic Fusier CLA 2010-04-26 12:17:34 EDT
Verified for 3.6M7