Community
Participate
Working Groups
In a certain type of class it's not possible to get proposals and navigate to type (Ctrl + Space & F3 [Standard Shortcuts]), or do refactorings or other interesting stuff. Appended the log and a demo implementation which shows the bug. eclipse build is 3.1RC3. [ Log ] eclipse.buildId=I20050617-1618 java.version=1.5.0_03 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_CH Command-line arguments: -os win32 -ws win32 -arch x86 [...snip...] !ENTRY org.eclipse.ui.workbench 4 2 2005-06-23 15:18:30.443 !MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.ui.workbench". !STACK 0 java.lang.NullPointerException at org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding.implementsInterface(ReferenceBinding.java:681) at org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding.isCompatibleWith(ReferenceBinding.java:766) at org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding.boundCheck(TypeVariableBinding.java:135) at org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding.boundCheck(ParameterizedTypeBinding.java:58) at org.eclipse.jdt.internal.compiler.ast.ParameterizedSingleTypeReference.checkBounds(ParameterizedSingleTypeReference.java:40) at org.eclipse.jdt.internal.compiler.lookup.ClassScope.checkParameterizedTypeBounds(ClassScope.java:702) at org.eclipse.jdt.internal.compiler.lookup.ClassScope.connectTypeHierarchy(ClassScope.java:935) at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.connectTypeHierarchy(CompilationUnitScope.java:254) at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.completeTypeBindings(LookupEnvironment.java:249) at org.eclipse.jdt.internal.core.hierarchy.HierarchyResolver.accept(HierarchyResolver.java:153) at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:131) at org.eclipse.jdt.internal.compiler.lookup.PackageBinding.getTypeOrPackage(PackageBinding.java:178) at org.eclipse.jdt.internal.compiler.lookup.Scope.getTypeOrPackage(Scope.java:2392) at org.eclipse.jdt.internal.compiler.lookup.Scope.getType(Scope.java:2137) at org.eclipse.jdt.internal.compiler.ast.SingleTypeReference.getTypeBinding(SingleTypeReference.java:39) at org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveType(TypeReference.java:141) at org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveTypeArgument(TypeReference.java:158) at org.eclipse.jdt.internal.compiler.ast.ParameterizedSingleTypeReference.internalResolveType(ParameterizedSingleTypeReference.java:132) at org.eclipse.jdt.internal.compiler.ast.ParameterizedSingleTypeReference.resolveType(ParameterizedSingleTypeReference.java:217) at org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveSuperType(TypeReference.java:104) at org.eclipse.jdt.internal.compiler.lookup.ClassScope.findSupertype(ClassScope.java:1088) at org.eclipse.jdt.internal.compiler.lookup.ClassScope.connectSuperclass(ClassScope.java:755) at org.eclipse.jdt.internal.compiler.lookup.ClassScope.connectTypeHierarchy(ClassScope.java:927) at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.connectTypeHierarchy(CompilationUnitScope.java:254) at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.completeTypeBindings(LookupEnvironment.java:249) at org.eclipse.jdt.internal.core.hierarchy.HierarchyResolver.resolve(HierarchyResolver.java:653) at org.eclipse.jdt.internal.core.hierarchy.HierarchyResolver.resolve(HierarchyResolver.java:486) at org.eclipse.jdt.internal.core.hierarchy.HierarchyBuilder.buildSupertypes(HierarchyBuilder.java:119) at org.eclipse.jdt.internal.core.hierarchy.IndexBasedHierarchyBuilder.build(IndexBasedHierarchyBuilder.java:136) at org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy.compute(TypeHierarchy.java:320) at org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy.refresh(TypeHierarchy.java:1255) at org.eclipse.jdt.internal.core.CreateTypeHierarchyOperation.executeOperation(CreateTypeHierarchyOperation.java:90) at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:718) at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:777) at org.eclipse.jdt.internal.core.SourceType.newSupertypeHierarchy(SourceType.java:671) at org.eclipse.jdt.internal.core.SourceType.newSupertypeHierarchy(SourceType.java:623) at org.eclipse.jdt.internal.corext.util.SuperTypeHierarchyCache.getTypeHierarchy(SuperTypeHierarchyCache.java:88) at org.eclipse.jdt.internal.corext.util.SuperTypeHierarchyCache.getTypeHierarchy(SuperTypeHierarchyCache.java:78) at org.eclipse.jdt.ui.OverrideIndicatorLabelDecorator.getOverrideIndicators(OverrideIndicatorLabelDecorator.java:160) at org.eclipse.jdt.ui.OverrideIndicatorLabelDecorator.computeAdornmentFlags(OverrideIndicatorLabelDecorator.java:128) at org.eclipse.jdt.ui.OverrideIndicatorLabelDecorator.decorate(OverrideIndicatorLabelDecorator.java:251) at org.eclipse.ui.internal.decorators.LightweightDecoratorDefinition.decorate(LightweightDecoratorDefinition.java:220) at org.eclipse.ui.internal.decorators.LightweightDecoratorManager$LightweightRunnable.run(LightweightDecoratorManager.java:67) at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044) at org.eclipse.core.runtime.Platform.run(Platform.java:783) at org.eclipse.ui.internal.decorators.LightweightDecoratorManager.decorate(LightweightDecoratorManager.java:289) at org.eclipse.ui.internal.decorators.LightweightDecoratorManager.getDecorations(LightweightDecoratorManager.java:275) at org.eclipse.ui.internal.decorators.DecorationScheduler$1.run(DecorationScheduler.java:318) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76) !ENTRY org.eclipse.ui 4 4 2005-06-23 15:18:30.584 !MESSAGE Exception in Decorator [...snip...] Demo Implementaion: package bug; import java.util.Date; public abstract class AbstractSnapshot<S extends Snapshot, P extends SnapshotPro vider<S>> implements Snapshot<S> { private final Date date; private final P provider; public AbstractSnapshot(P provider, Date date) { this.provider = provider; this.date = date; } public S at(Date d) { return provider.getSnapshot(d); } public S shift(int days) { return at(getWhen() /* .shift(days) */); } public Date getWhen() { return date; } public P getProvider() { return provider; } } package bug; import java.util.Date; class ProviderImpl implements SnapshotProvider<SnapshotImpl> { public SnapshotImpl getSnapshot(Date arg0) { return null; } } package bug; import java.util.Date; public interface Snapshot<S extends Snapshot> { Date getWhen(); public S at(Date when); /** * Snapshot, der um <i>days </i> Tage geschoben ist. * * @param days * @return nie <code>null</code> */ public S shift(int days); } package bug; import java.util.Date; // FIXME autocompletion and other navigation methods fail. // refactoring (e.g. SnapshotProvider fails also) class SnapshotImpl extends AbstractSnapshot<SnapshotImpl, ProviderImpl> { public SnapshotImpl(ProviderImpl provider, Date date) { super(provider, date); } public void execute() { // } }package bug; import java.util.Date; interface SnapshotProvider<S extends Snapshot> { S getSnapshot(Date date); }
Looks like another case where we have null superinterfaces.
*** Bug 102545 has been marked as a duplicate of this bug. ***
*** Bug 102594 has been marked as a duplicate of this bug. ***
Reverted back to the previous code which initialized the interfaces at the beginning of connectSuperInterfaces(). Was changed to detect cycles, but we have another change to handle them now. Released into the 3.1.1 branch
Verified in 3.2M1 (I20050808-2000)
All tests passed.
*** Bug 108308 has been marked as a duplicate of this bug. ***
*** Bug 108335 has been marked as a duplicate of this bug. ***
*** Bug 108378 has been marked as a duplicate of this bug. ***
Created attachment 27326 [details] A demonstration of the bug as simple eclipse project
none of the current versions has the bug fixed. We verified with: Latest Release 3.1 Mon, 27 Jun 2005 -- 14:35 (-0400) 3.2 Stream Stable Build 3.2M1 Thu, 11 Aug 2005 -- 15:30 (-0400) 3.2 Stream Integration Build I20050921-0010 Wed, 21 Sep 2005 -- 00:10 (-0400) 3.2 Stream Nightly Build N20050918-0010 Sun, 18 Sep 2005 -- 00:10 (-0400) 3.1.1 Stream Maintenance Build M20050914-1235 Wed, 14 Sep 2005 -- 12:35 (-0400) I have attached a zip which can be used for testing (the sources are the same as from my first post and the ones used to verify the builds).
*** Bug 110136 has been marked as a duplicate of this bug. ***
Added CompletionTests_1_5 test0245 Released in 3.1.1 stream. But did not make it into 3.2M2 build in time - will show up in subsequent builds.
Verified for 3.1.1 using M20050923-1430.
(In reply to comment #14) > Verified for 3.1.1 using M20050923-1430. My code snippet at https://bugs.eclipse.org/bugs/show_bug.cgi?id=110136 still causes a NullPointerException in version M20050923-1430.
Released into HEAD