Bug 82455 - NullPointerException in compiler with static import combined with serialVersionUID
Summary: NullPointerException in compiler with static import combined with serialVersi...
Status: RESOLVED DUPLICATE of bug 81724
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows NT
: P3 critical with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-10 04:55 EST by Pepijn Schmitz CLA
Modified: 2005-01-10 05:11 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pepijn Schmitz CLA 2005-01-10 04:55:21 EST
I'm using Eclipse 3.1M4 to create a Java 5 program, and stumbled upon the
following bug. I'm running Eclipse on Sun JDK 1.4.2, but the default JRE for the
projects is the Sun JDK 1.5.0, and the project is set to the 5.0 language level.
This code:

package test;

import static java.awt.GridBagConstraints.*;

public class Test {
    private static final long serialVersionUID = 2005011001L;
}

will cause Eclipse's compiler to fail with a NullPointerException. Because of
that, all code completion and real-time error checking stops working, and for
some strange reason it is also no longer possible to copy the code to the
clipboard (when you press Ctrl+C or Ctrl+Insert, Eclipse gives the error message
"The command for the key you pressed failed").

The stack trace of the NullPointerException is as follows:

java.lang.NullPointerException
	at
org.eclipse.jdt.internal.compiler.lookup.FieldBinding.canBeSeenBy(FieldBinding.java:122)
	at org.eclipse.jdt.internal.compiler.lookup.Scope.findField(Scope.java:645)
	at org.eclipse.jdt.internal.compiler.lookup.Scope.getBinding(Scope.java:1455)
	at
org.eclipse.jdt.internal.compiler.ast.FieldDeclaration.resolve(FieldDeclaration.java:176)
	at
org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:981)
	at
org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1063)
	at
org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:280)
	at org.eclipse.jdt.internal.compiler.Compiler.resolve(Compiler.java:566)
	at
org.eclipse.jdt.internal.core.CompilationUnitProblemFinder.process(CompilationUnitProblemFinder.java:175)
	at
org.eclipse.jdt.internal.core.CompilationUnit.buildStructure(CompilationUnit.java:142)
	at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:203)
	at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:547)
	at
org.eclipse.jdt.internal.core.CompilationUnit.makeConsistent(CompilationUnit.java:979)
	at
org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.executeOperation(ReconcileWorkingCopyOperation.java:60)
	at
org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:700)
	at
org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:739)
	at
org.eclipse.jdt.internal.core.CompilationUnit.reconcile(CompilationUnit.java:1105)
	at
org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:91)
	at
org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:133)
	at
org.eclipse.jdt.internal.ui.text.CompositeReconcilingStrategy.reconcile(CompositeReconcilingStrategy.java:86)
	at
org.eclipse.jdt.internal.ui.text.JavaCompositeReconcilingStrategy.reconcile(JavaCompositeReconcilingStrategy.java:94)
	at org.eclipse.jface.text.reconciler.MonoReconciler.process(MonoReconciler.java:75)
	at org.eclipse.jdt.internal.ui.text.JavaReconciler.process(JavaReconciler.java:318)
	at
org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:204)
Comment 1 Frederic Fusier CLA 2005-01-10 05:11:38 EST

*** This bug has been marked as a duplicate of 81724 ***