Bug 170896 - [compiler] NullPointerException during compile
Summary: [compiler] NullPointerException during compile
Status: VERIFIED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P5 normal (vote)
Target Milestone: 3.6 M7   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
: 185079 213890 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-01-18 07:41 EST by moran CLA
Modified: 2010-04-26 12:17 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description moran CLA 2007-01-18 07:41:19 EST
Build ID: I20061214-1445

Steps To Reproduce:
Compiling with:

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

>java -version
java version "1.5.0_08"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_08-b03)
BEA JRockit(R) (build R27.1.0-109-73164-1.5.0_08-20061129-1428-windows-ia32, compiled mode)

C:\Documents and Settings\moran>


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:510)
	at org.eclipse.jdt.internal.compiler.lookup.Scope.findMethod(Scope.java:1059)
	at org.eclipse.jdt.internal.compiler.lookup.Scope.getMethod(Scope.java:2002)
	at org.eclipse.jdt.internal.compiler.ast.MessageSend.resolveType(MessageSend.java:392)
	at org.eclipse.jdt.internal.compiler.ast.Assignment.resolveType(Assignment.java:179)
	at org.eclipse.jdt.internal.compiler.ast.Expression.resolve(Expression.java:883)
	at org.eclipse.jdt.internal.compiler.ast.Block.resolve(Block.java:101)
	at org.eclipse.jdt.internal.compiler.ast.IfStatement.resolve(IfStatement.java:233)
	at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:432)
	at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:195)
	at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:403)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1086)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1155)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1015)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1164)
	at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:359)
	at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:599)
	at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:415)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:301)
	at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.compile(BatchImageBuilder.java:213)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:238)
	at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:59)
	at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:254)
	at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:175)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:621)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:163)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:194)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:243)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:299)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:331)
	QA/src/com/g/test	Test.java	line 0	1169122197922	4020503

More information:
Happened once when I built my project.
Comment 1 Olivier Thomann CLA 2007-01-18 08:53:38 EST
Would it be possible to get the source code of this class?
QA/src/com/g/test       Test.java

Do you reproduce it all the time? Does it work with a full build ?
Comment 2 moran CLA 2007-01-18 09:33:53 EST
(In reply to comment #1)
> Would it be possible to get the source code of this class?
> QA/src/com/g/test       Test.java
> 
> Do you reproduce it all the time? Does it work with a full build ?
> 

No, it happened only once.
Comment 3 Olivier Thomann CLA 2007-01-19 11:46:02 EST
Did you have compiler errors when this happened?
Without further information, it will be difficult to track it down.
Comment 4 moran CLA 2007-01-20 04:57:00 EST
(In reply to comment #3)
> Did you have compiler errors when this happened?
> Without further information, it will be difficult to track it down.
> 

There weren't any compiler errors at the time.
This happened to me only once. apologies for the lack of information. 
Comment 5 moran CLA 2007-02-22 07:05:45 EST
Got it several more times, and there were no compile errors noticeable.
I will move to 3.3M5

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:510)

	at org.eclipse.jdt.internal.compiler.lookup.Scope.findMethod(Scope.java:1059)

	at org.eclipse.jdt.internal.compiler.lookup.Scope.getMethod(Scope.java:2002)

	at org.eclipse.jdt.internal.compiler.ast.MessageSend.resolveType(MessageSend.java:392)

	at org.eclipse.jdt.internal.compiler.ast.Expression.resolve(Expression.java:883)

	at org.eclipse.jdt.internal.compiler.ast.Block.resolve(Block.java:101)

	at org.eclipse.jdt.internal.compiler.ast.IfStatement.resolve(IfStatement.java:233)

	at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:432)

	at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:195)

	at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:403)

	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1086)

	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1164)

	at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:359)

	at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:599)

	at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:415)

	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:301)

	at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.compile(BatchImageBuilder.java:213)

	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:265)

	at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:59)

	at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:254)

	at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:175)

	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:621)

	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)

	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:163)

	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:194)

	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:243)

	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)

	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)

	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:299)

	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:331)

	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:156)

	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:222)

Comment 6 Olivier Thomann CLA 2007-03-02 11:11:56 EST
(In reply to comment #5)
> Got it several more times, and there were no compile errors noticeable.
> I will move to 3.3M5
Did you get it again since you moved to 3.3M5?
Comment 7 Olivier Thomann CLA 2007-03-02 11:52:59 EST
(In reply to comment #5)
> Got it several more times, and there were no compile errors noticeable.
> I will move to 3.3M5
Would it be possible to get the code of the file mentionned in comment 1, please?
I might have a clue of what is going on, but I would need a test case to reproduce.
Comment 8 Olivier Thomann CLA 2007-03-02 12:12:36 EST
Did you get compile errors beside this exception in your test case?
Comment 9 moran CLA 2007-03-15 04:18:58 EDT
(In reply to comment #8)
> Did you get compile errors beside this exception in your test case?
> 

No compile errors were apparent. There is nothing special to this file, and the file occurrence changes. If I run into it again, I will attach the file mentioned.
Since I moved to 3.3M5 I did not encounter it, but it wasn't that frequent to begin with.
Comment 10 Adam Domanski CLA 2007-04-12 05:04:49 EDT
I've also encountered the problem. It appears with my Eclipse (3.2.1 and 3.2.2):

eclipse.buildId=M20070212-1330
java.version=1.5.0_08
java.vendor=BEA Systems, Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=pl_PL
Command-line arguments:  -os win32 -ws win32 -arch x86

My stacktrace during build of project:

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:508)
at org.eclipse.jdt.internal.compiler.lookup.Scope.findMethod(Scope.java:1064)
at org.eclipse.jdt.internal.compiler.lookup.Scope.getMethod(Scope.java:1991)
at org.eclipse.jdt.internal.compiler.ast.MessageSend.resolveType(MessageSend.java:384)
at org.eclipse.jdt.internal.compiler.ast.CastExpression.resolveType(CastExpression.java:416)
at org.eclipse.jdt.internal.compiler.ast.Assignment.resolveType(Assignment.java:179)
at org.eclipse.jdt.internal.compiler.ast.Expression.resolve(Expression.java:881)
at org.eclipse.jdt.internal.compiler.ast.Block.resolve(Block.java:101)
at org.eclipse.jdt.internal.compiler.ast.IfStatement.resolve(IfStatement.java:233)
at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:432)
at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:179)
at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:403)
at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1047)
at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1094)
at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:353)
at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:594)
at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:411)
at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:300)
at org.eclipse.jdt.internal.core.builder.IncrementalImageBuilder.compile(IncrementalImageBuilder.java:292)
at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:237)
at org.eclipse.jdt.internal.core.builder.IncrementalImageBuilder.buildAfterBatchBuild(IncrementalImageBuilder.java:157)
at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:65)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:249)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:174)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:603)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:167)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:230)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:233)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:307) 

It appears on different classes each time I build the project. Project is quite big, about 8000 Java sources.

Compiler settings for projects are: source level compability with 1.5, target 1.5, JRE 1.5 (JRockit). If I change source level compability with 1.3, then there is no such problem.

I can send You a class, on which compiler crashed, if You wish.
Comment 11 Philipe Mulet CLA 2007-04-12 05:34:05 EDT
Feels like we would rather need your entire workspace. Is that feasible ?
Comment 12 Adam Domanski CLA 2007-04-12 05:52:40 EDT
I am sorry, but I cannot share my whole source code with 3rd party libraries.
I will try to create smaller project and reproduce the problem if it is possible at all.
Comment 13 Adam Domanski CLA 2007-04-13 04:15:16 EDT
I spotted that launching Eclipse with Sun JVM or with JRockit but with no bytecode optimization (using -XnoOpt switch) have not caused the problems yet.

Although I need some time to verify it in daily work with Eclipse.
Comment 14 Philipe Mulet CLA 2007-04-13 07:06:25 EDT
Could also be a timing issue in our layer (which is hidden when JIT is off), though from the trace you gave, it feels unlikely.
Comment 15 Olivier Thomann CLA 2007-04-19 13:05:52 EDT
I am still unable to reproduce this one. If you have any clue that can help, please let me know.
Comment 16 Adam Domanski CLA 2007-04-20 02:21:23 EDT
I'be been working for a week with JVM Sun 1.5.0_11 and JRockit 27.2.0. As the problem didn't occur in these JVMs anymore, I suspect problems inside JRockit 27.1 code optimization.
Comment 17 Olivier Thomann CLA 2007-04-21 16:56:37 EDT
Closing as WORKSFORME then since the initial comment also states the JRockit 27.1 VM.
Please reopen if you get it again.
Comment 18 Maxime Daniel CLA 2007-04-27 10:31:03 EDT
Verified for 3.3 M7.
(Discussed the motivation for this with Olivier, agree with him.)
Comment 19 Olivier Thomann CLA 2007-05-02 22:26:15 EDT
*** Bug 185079 has been marked as a duplicate of this bug. ***
Comment 20 Olivier Thomann CLA 2007-05-02 22:26:56 EDT
Reopen.
You need some info to be able to create a test case to reproduce this one.
Comment 21 Frederic Fusier CLA 2007-12-31 08:35:46 EST
*** Bug 213890 has been marked as a duplicate of this bug. ***
Comment 22 Olivier Thomann CLA 2010-03-16 11:54:53 EDT
Closing as WORKSFORME.
Please reopen if this can be reproduced.
Comment 23 Frederic Fusier CLA 2010-04-26 12:17:28 EDT
Verified for 3.6M7