View | Details | Raw Unified | Return to bug 163680 | Differences between
and this patch

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java (-4 / +8 lines)
Lines 285-291 Link Here
285
		if (wrapper.signature[wrapper.start] == '<') {
285
		if (wrapper.signature[wrapper.start] == '<') {
286
			// ParameterPart = '<' ParameterSignature(s) '>'
286
			// ParameterPart = '<' ParameterSignature(s) '>'
287
			wrapper.start++; // skip '<'
287
			wrapper.start++; // skip '<'
288
			this.typeVariables = createTypeVariables(wrapper, this);
288
			this.typeVariables = createTypeVariables(wrapper, true);
289
			wrapper.start++; // skip '>'
289
			wrapper.start++; // skip '>'
290
			this.tagBits |=  TagBits.HasUnresolvedTypeVariables;
290
			this.tagBits |=  TagBits.HasUnresolvedTypeVariables;
291
			this.modifiers |= ExtraCompilerModifiers.AccGenericSignature;
291
			this.modifiers |= ExtraCompilerModifiers.AccGenericSignature;
Lines 436-442 Link Here
436
			// <A::Ljava/lang/annotation/Annotation;>(Ljava/lang/Class<TA;>;)TA;
436
			// <A::Ljava/lang/annotation/Annotation;>(Ljava/lang/Class<TA;>;)TA;
437
			// ParameterPart = '<' ParameterSignature(s) '>'
437
			// ParameterPart = '<' ParameterSignature(s) '>'
438
			wrapper.start++; // skip '<'
438
			wrapper.start++; // skip '<'
439
			typeVars = createTypeVariables(wrapper, this);
439
			typeVars = createTypeVariables(wrapper, false);
440
			wrapper.start++; // skip '>'
440
			wrapper.start++; // skip '>'
441
		}
441
		}
442
442
Lines 561-567 Link Here
561
		}
561
		}
562
	}
562
	}
563
}
563
}
564
private TypeVariableBinding[] createTypeVariables(SignatureWrapper wrapper, Binding declaringElement) {
564
private TypeVariableBinding[] createTypeVariables(SignatureWrapper wrapper, boolean assignVariables) {
565
	// detect all type variables first
565
	// detect all type variables first
566
	char[] typeSignature = wrapper.signature;
566
	char[] typeSignature = wrapper.signature;
567
	int depth = 0, length = typeSignature.length;
567
	int depth = 0, length = typeSignature.length;
Lines 588-594 Link Here
588
						pendingVariable = false;
588
						pendingVariable = false;
589
						int colon = CharOperation.indexOf(':', typeSignature, i);
589
						int colon = CharOperation.indexOf(':', typeSignature, i);
590
						char[] variableName = CharOperation.subarray(typeSignature, i, colon);
590
						char[] variableName = CharOperation.subarray(typeSignature, i, colon);
591
						variables.add(new TypeVariableBinding(variableName, declaringElement, rank++));
591
						variables.add(new TypeVariableBinding(variableName, this, rank++));
592
					}
592
					}
593
			}
593
			}
594
		}
594
		}
Lines 596-601 Link Here
596
	// initialize type variable bounds - may refer to forward variables
596
	// initialize type variable bounds - may refer to forward variables
597
	TypeVariableBinding[] result;
597
	TypeVariableBinding[] result;
598
	variables.toArray(result = new TypeVariableBinding[rank]);
598
	variables.toArray(result = new TypeVariableBinding[rank]);
599
	// when creating the type variables for a type, the type must remember them before initializing each variable
600
	// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=163680
601
	if (assignVariables)
602
		this.typeVariables = result;
599
	for (int i = 0; i < rank; i++) {
603
	for (int i = 0; i < rank; i++) {
600
		initializeTypeVariable(result[i], result, wrapper);
604
		initializeTypeVariable(result[i], result, wrapper);
601
	}
605
	}

Return to bug 163680