Community
Participate
Working Groups
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)
*** This bug has been marked as a duplicate of 81724 ***