### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding.java,v retrieving revision 1.19 diff -u -r1.19 CaptureBinding.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding.java 6 Jul 2006 11:20:36 -0000 1.19 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding.java 13 Sep 2007 17:07:19 -0000 @@ -101,7 +101,8 @@ switch (wildcard.boundKind) { case Wildcard.EXTENDS : // still need to capture bound supertype as well so as not to expose wildcards to the outside (111208) - TypeBinding substitutedWildcardBound = originalWildcardBound.capture(scope, this.position); + TypeBinding capturedWildcardBound = originalWildcardBound.capture(scope, this.position); + TypeBinding substitutedWildcardBound = Scope.substitute(capturedParameterizedType, capturedWildcardBound); if (wildcard.bound.isInterface()) { this.superclass = substitutedVariableSuperclass; // merge wildcard bound into variable superinterfaces using glb @@ -114,8 +115,16 @@ this.superInterfaces = Scope.greaterLowerBound(substitutedVariableInterfaces); } } else { - // per construction the wildcard bound is a subtype of variable superclass - this.superclass = wildcard.bound.isArrayType() ? substitutedVariableSuperclass : (ReferenceBinding) substitutedWildcardBound; + // the wildcard bound should be a subtype of variable superclass + // it may occur that the bound is less specific, then consider glb (202404) + if (substitutedWildcardBound.isArrayType() || substitutedWildcardBound == this) { + this.superclass = substitutedVariableSuperclass; + } else { + this.superclass = (ReferenceBinding) substitutedWildcardBound; + if (this.superclass.isSuperclassOf(substitutedVariableSuperclass)) { + this.superclass = substitutedVariableSuperclass; + } + } this.superInterfaces = substitutedVariableInterfaces; } this.firstBound = substitutedWildcardBound;