Index: compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java,v --- compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java 25 Jun 2006 21:33:33 -0000 1.84 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java 4 Jul 2006 13:23:58 -0000 @@ -97,7 +97,7 @@ for (int i = 0; i < length; i++) { TypeBinding argument = originalArguments[i]; if (argument.kind() == Binding.WILDCARD_TYPE && ((WildcardBinding)argument).otherBounds == null) { // no capture for intersection types - capturedArguments[i] = new CaptureBinding((WildcardBinding) argument, contextType, position); + capturedArguments[i] = new CaptureBinding((WildcardBinding) argument, contextType, position, this.environment.nextCaptureID()); } else { capturedArguments[i] = argument; } Index: compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java,v --- compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java 11 May 2006 10:14:34 -0000 1.72 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java 4 Jul 2006 13:23:56 -0000 @@ -62,6 +62,7 @@ private SimpleLookupTable uniqueRawTypeBindings; private SimpleLookupTable uniqueWildcardBindings; private SimpleLookupTable uniqueParameterizedGenericMethodBindings; + private int captureID = 1; public CompilationUnitDeclaration unitBeingCompleted = null; // only set while completing units @@ -1148,6 +1149,9 @@ : new MethodVerifier15(this); // covariance only if sourceLevel is >= 1.5 return verifier; } +public int nextCaptureID() { + return this.captureID++; +} public void reset() { this.defaultPackage = new PackageBinding(this); // assume the default package always exists this.defaultImports = null; Index: compiler/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.java,v --- compiler/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.java 29 Mar 2006 02:45:27 -0000 1.42 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.java 4 Jul 2006 13:23:58 -0000 @@ -43,7 +43,8 @@ char[] WILDCARD_MINUS = { '-' }; char[] WILDCARD_STAR = { '*' }; char[] WILDCARD_PLUS = { '+' }; - char[] WILDCARD_CAPTURE_NAME = "capture-of ".toCharArray(); //$NON-NLS-1$ + char[] WILDCARD_CAPTURE_NAME_PREFIX = "capture$".toCharArray(); //$NON-NLS-1$ + char[] WILDCARD_CAPTURE_NAME_SUFFIX = "-of ".toCharArray(); //$NON-NLS-1$ char[] WILDCARD_CAPTURE = { '!' }; char[] BYTE = "byte".toCharArray(); //$NON-NLS-1$ char[] SHORT = "short".toCharArray(); //$NON-NLS-1$ 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 --- compiler/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding.java 29 Mar 2006 02:40:11 -0000 1.18 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding.java 4 Jul 2006 13:23:54 -0000 @@ -18,18 +18,20 @@ public TypeBinding lowerBound; public WildcardBinding wildcard; + public int captureID; /* information to compute unique binding key */ public ReferenceBinding sourceType; public int position; - public CaptureBinding(WildcardBinding wildcard, ReferenceBinding sourceType, int position) { - super(TypeConstants.WILDCARD_CAPTURE_NAME, null, 0); + public CaptureBinding(WildcardBinding wildcard, ReferenceBinding sourceType, int position, int captureID) { + super(TypeConstants.WILDCARD_CAPTURE_NAME_PREFIX, null, 0); this.wildcard = wildcard; this.modifiers = ClassFileConstants.AccPublic | ExtraCompilerModifiers.AccGenericSignature; // treat capture as public this.fPackage = wildcard.fPackage; this.sourceType = sourceType; this.position = position; + this.captureID = captureID; } /* @@ -54,8 +56,15 @@ } public String debugName() { + if (this.wildcard != null) { - return String.valueOf(TypeConstants.WILDCARD_CAPTURE_NAME) + this.wildcard.debugName(); + StringBuffer buffer = new StringBuffer(10); + buffer + .append(TypeConstants.WILDCARD_CAPTURE_NAME_PREFIX) + .append(this.captureID) + .append(TypeConstants.WILDCARD_CAPTURE_NAME_SUFFIX) + .append(this.wildcard.debugName()); + return buffer.toString(); } return super.debugName(); } @@ -156,21 +165,45 @@ public char[] readableName() { if (this.wildcard != null) { - return CharOperation.concat(TypeConstants.WILDCARD_CAPTURE_NAME, this.wildcard.readableName()); + StringBuffer buffer = new StringBuffer(10); + buffer + .append(TypeConstants.WILDCARD_CAPTURE_NAME_PREFIX) + .append(this.captureID) + .append(TypeConstants.WILDCARD_CAPTURE_NAME_SUFFIX) + .append(this.wildcard.readableName()); + int length = buffer.length(); + char[] name = new char[length]; + buffer.getChars(0, length, name, 0); + return name; } return super.readableName(); } public char[] shortReadableName() { if (this.wildcard != null) { - return CharOperation.concat(TypeConstants.WILDCARD_CAPTURE_NAME, this.wildcard.shortReadableName()); + StringBuffer buffer = new StringBuffer(10); + buffer + .append(TypeConstants.WILDCARD_CAPTURE_NAME_PREFIX) + .append(this.captureID) + .append(TypeConstants.WILDCARD_CAPTURE_NAME_SUFFIX) + .append(this.wildcard.shortReadableName()); + int length = buffer.length(); + char[] name = new char[length]; + buffer.getChars(0, length, name, 0); + return name; } - return super.shortReadableName(); + return super.shortReadableName(); } public String toString() { if (this.wildcard != null) { - return String.valueOf(TypeConstants.WILDCARD_CAPTURE_NAME) + this.wildcard.toString(); + StringBuffer buffer = new StringBuffer(10); + buffer + .append(TypeConstants.WILDCARD_CAPTURE_NAME_PREFIX) + .append(this.captureID) + .append(TypeConstants.WILDCARD_CAPTURE_NAME_SUFFIX) + .append(this.wildcard); + return buffer.toString(); } return super.toString(); }