Bug 72583 - [1.5] NPE in Scope.minimalErasedCandidate
Summary: [1.5] NPE in Scope.minimalErasedCandidate
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: 3.1 M2   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 75540 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-08-25 08:59 EDT by Johan Walles CLA
Modified: 2004-10-04 03:53 EDT (History)
1 user (show)

See Also:


Attachments
File in which this error is triggered (3.24 KB, text/plain)
2004-08-25 09:06 EDT, Johan Walles CLA
no flags Details
Manually constructed testcase with missing types (2.42 KB, application/octet-stream)
2004-09-20 10:30 EDT, Philipe Mulet CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Johan Walles CLA 2004-08-25 08:59:41 EDT
Using 3.1M1 I get the following Internal Compiler Error when trying to build
using the 1.5 "Compiler compliance level":

java.lang.NullPointerException
	at
org.eclipse.jdt.internal.compiler.lookup.Scope.minimalErasedCandidate([Lorg.eclipse.jdt.internal.compiler.lookup.TypeBinding;Ljava.util.List;)Lorg.eclipse.jdt.internal.compiler.lookup.TypeBinding;(Scope.java:2409)
	at
org.eclipse.jdt.internal.compiler.lookup.Scope.lowerUpperBound([Lorg.eclipse.jdt.internal.compiler.lookup.TypeBinding;)Lorg.eclipse.jdt.internal.compiler.lookup.TypeBinding;(Scope.java:2283)
	at
org.eclipse.jdt.internal.compiler.lookup.ParameterizedGenericMethodBinding.computeCompatibleMethod(Lorg.eclipse.jdt.internal.compiler.lookup.MethodBinding;[Lorg.eclipse.jdt.internal.compiler.lookup.TypeBinding;Lorg.eclipse.jdt.internal.compiler.lookup.Scope;Lorg.eclipse.jdt.internal.compiler.lookup.InvocationSite;)Lorg.eclipse.jdt.internal.compiler.lookup.MethodBinding;(ParameterizedGenericMethodBinding.java:100)
	at
org.eclipse.jdt.internal.compiler.lookup.Scope.computeCompatibleMethod(Lorg.eclipse.jdt.internal.compiler.lookup.MethodBinding;[Lorg.eclipse.jdt.internal.compiler.lookup.TypeBinding;Lorg.eclipse.jdt.internal.compiler.lookup.InvocationSite;)Lorg.eclipse.jdt.internal.compiler.lookup.MethodBinding;(Scope.java:152)
	at
org.eclipse.jdt.internal.compiler.lookup.Scope.findMethod(Lorg.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;[C[Lorg.eclipse.jdt.internal.compiler.lookup.TypeBinding;Lorg.eclipse.jdt.internal.compiler.lookup.InvocationSite;)Lorg.eclipse.jdt.internal.compiler.lookup.MethodBinding;(Scope.java:837)
	at
org.eclipse.jdt.internal.compiler.lookup.Scope.getMethod(Lorg.eclipse.jdt.internal.compiler.lookup.TypeBinding;[C[Lorg.eclipse.jdt.internal.compiler.lookup.TypeBinding;Lorg.eclipse.jdt.internal.compiler.lookup.InvocationSite;)Lorg.eclipse.jdt.internal.compiler.lookup.MethodBinding;(Scope.java:1719)
	at
org.eclipse.jdt.internal.compiler.ast.MessageSend.resolveType(Lorg.eclipse.jdt.internal.compiler.lookup.BlockScope;)Lorg.eclipse.jdt.internal.compiler.lookup.TypeBinding;(MessageSend.java:294)
	at
org.eclipse.jdt.internal.compiler.ast.Expression.resolve(Lorg.eclipse.jdt.internal.compiler.lookup.BlockScope;)V(Expression.java:668)
	at
org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements()V(AbstractMethodDeclaration.java:400)
	at
org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements()V(MethodDeclaration.java:139)
	at
org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(Lorg.eclipse.jdt.internal.compiler.lookup.ClassScope;)V(AbstractMethodDeclaration.java:378)
	at
org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve()V(TypeDeclaration.java:938)
	at
org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(Lorg.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope;)V(TypeDeclaration.java:987)
	at
org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve()V(CompilationUnitDeclaration.java:280)
	at
org.eclipse.jdt.internal.compiler.Compiler.process(Lorg.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration;I)V(Compiler.java:508)
	at
org.eclipse.jdt.internal.compiler.Compiler.compile([Lorg.eclipse.jdt.internal.compiler.env.ICompilationUnit;)V(Compiler.java:335)
	at
org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile([Lorg.eclipse.jdt.internal.core.builder.SourceFile;[Lorg.eclipse.jdt.internal.core.builder.SourceFile;)V(AbstractImageBuilder.java:209)
	at
org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile([Lorg.eclipse.jdt.internal.core.builder.SourceFile;)V(AbstractImageBuilder.java:159)
	at
org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build()V(BatchImageBuilder.java:49)
	at
org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll()V(JavaBuilder.java:212)
	at
org.eclipse.jdt.internal.core.builder.JavaBuilder.build(ILjava.util.Map;Lorg.eclipse.core.runtime.IProgressMonitor;)[Lorg.eclipse.core.resources.IProject;(JavaBuilder.java:135)
	at org.eclipse.core.internal.events.BuildManager$2.run()V(BuildManager.java:564)
	at
org.eclipse.core.internal.runtime.InternalPlatform.run(Lorg.eclipse.core.runtime.ISafeRunnable;)V(InternalPlatform.java:615)
	at
org.eclipse.core.runtime.Platform.run(Lorg.eclipse.core.runtime.ISafeRunnable;)V(Platform.java:747)
	at
org.eclipse.core.internal.events.BuildManager.basicBuild(ILorg.eclipse.core.resources.IncrementalProjectBuilder;Ljava.util.Map;Lorg.eclipse.core.runtime.MultiStatus;Lorg.eclipse.core.runtime.IProgressMonitor;)V(BuildManager.java:157)
	at
org.eclipse.core.internal.events.BuildManager.basicBuild(Lorg.eclipse.core.resources.IProject;ILjava.lang.String;Ljava.util.Map;Lorg.eclipse.core.runtime.MultiStatus;Lorg.eclipse.core.runtime.IProgressMonitor;)V(BuildManager.java:249)
	at
org.eclipse.core.internal.events.BuildManager.basicBuild(Lorg.eclipse.core.resources.IProject;I[Lorg.eclipse.core.resources.ICommand;Lorg.eclipse.core.runtime.MultiStatus;Lorg.eclipse.core.runtime.IProgressMonitor;)V(BuildManager.java:202)
	at org.eclipse.core.internal.events.BuildManager$1.run()V(BuildManager.java:229)
	at
org.eclipse.core.internal.runtime.InternalPlatform.run(Lorg.eclipse.core.runtime.ISafeRunnable;)V(InternalPlatform.java:615)
	at
org.eclipse.core.runtime.Platform.run(Lorg.eclipse.core.runtime.ISafeRunnable;)V(Platform.java:747)
	at
org.eclipse.core.internal.events.BuildManager.basicBuild(Lorg.eclipse.core.resources.IProject;ILorg.eclipse.core.runtime.MultiStatus;Lorg.eclipse.core.runtime.IProgressMonitor;)V(BuildManager.java:232)
	at
org.eclipse.core.internal.events.BuildManager.basicBuildLoop([Lorg.eclipse.core.resources.IProject;[Lorg.eclipse.core.resources.IProject;ILorg.eclipse.core.runtime.MultiStatus;Lorg.eclipse.core.runtime.IProgressMonitor;)V(BuildManager.java:268)

Unforturnately the project in which this is triggered is proprietary, so I can't
let you look at it, but if you think it helps I can upload the source file in
which the error is triggered.
Comment 1 Johan Walles CLA 2004-08-25 09:06:34 EDT
Created attachment 14171 [details]
File in which this error is triggered
Comment 2 Philipe Mulet CLA 2004-09-20 09:57:06 EDT
Can you please provide a complete testcase ? Yours is missing some referenced 
types. Please reopen once info is available.
Comment 3 Philipe Mulet CLA 2004-09-20 10:29:45 EDT
Intended to be closed as REMIND
Comment 4 Philipe Mulet CLA 2004-09-20 10:30:19 EDT
Created attachment 14645 [details]
Manually constructed testcase with missing types
Comment 5 Philipe Mulet CLA 2004-09-20 10:30:37 EDT
Please reopen once info is available.
Comment 6 Johan Walles CLA 2004-09-21 04:43:08 EDT
Unforturnately I didn't take any snapshot of my code at the time of this error,
so I don't have that information anymore.

In case you can't resolve this with the information currently in this bug
report, you'll have to close this an WONTFIX.
Comment 7 Philipe Mulet CLA 2004-09-21 06:25:26 EDT
Can't you reproduce it anymore ?
Comment 8 Johan Walles CLA 2004-09-21 07:35:53 EDT
Nope.

I haven't upgraded to anything newer than M1, so the bug is still there though.
 It's just that whatever it was in my code that triggered it isn't there anymore.
Comment 9 Kent Johnson CLA 2004-09-22 15:54:30 EDT
I'm getting this in the source workspace from b64 on the type 
EventListenerList.
Comment 10 Philipe Mulet CLA 2004-09-22 19:05:10 EDT
Reproduced with EventListenerList.
Fixed by adding a null check. Situation can occur when interface is matched 
against Object.

Comment 11 Philipe Mulet CLA 2004-09-23 09:25:31 EDT
Simpler testcase:
public class X {
	
	static <T> T foo(T t1, T t2){ return t1; }
	
	public static void main(String[] args) {
		IX s = null;
		IX t = foo(new Object(), s);
	}
}
interface IX {}
Comment 12 Philipe Mulet CLA 2004-09-23 09:25:56 EDT
Added regression test: GenericTypeTest#test307
Comment 13 David Audel CLA 2004-09-24 06:46:09 EDT
Verified in I200409231635.
Comment 14 Markus Keller CLA 2004-10-04 03:53:09 EDT
*** Bug 75540 has been marked as a duplicate of this bug. ***