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 273-279 Link Here
273
		if (wrapper.signature[wrapper.start] == '<') {
273
		if (wrapper.signature[wrapper.start] == '<') {
274
			// ParameterPart = '<' ParameterSignature(s) '>'
274
			// ParameterPart = '<' ParameterSignature(s) '>'
275
			wrapper.start++; // skip '<'
275
			wrapper.start++; // skip '<'
276
			this.typeVariables = createTypeVariables(wrapper, this);
276
			this.typeVariables = createTypeVariables(wrapper, true);
277
			wrapper.start++; // skip '>'
277
			wrapper.start++; // skip '>'
278
			this.tagBits |=  TagBits.HasUnresolvedTypeVariables;
278
			this.tagBits |=  TagBits.HasUnresolvedTypeVariables;
279
			this.modifiers |= ExtraCompilerModifiers.AccGenericSignature;
279
			this.modifiers |= ExtraCompilerModifiers.AccGenericSignature;
Lines 424-430 Link Here
424
			// <A::Ljava/lang/annotation/Annotation;>(Ljava/lang/Class<TA;>;)TA;
424
			// <A::Ljava/lang/annotation/Annotation;>(Ljava/lang/Class<TA;>;)TA;
425
			// ParameterPart = '<' ParameterSignature(s) '>'
425
			// ParameterPart = '<' ParameterSignature(s) '>'
426
			wrapper.start++; // skip '<'
426
			wrapper.start++; // skip '<'
427
			typeVars = createTypeVariables(wrapper, this);
427
			typeVars = createTypeVariables(wrapper, false);
428
			wrapper.start++; // skip '>'
428
			wrapper.start++; // skip '>'
429
		}
429
		}
430
430
Lines 549-555 Link Here
549
		}
549
		}
550
	}
550
	}
551
}
551
}
552
private TypeVariableBinding[] createTypeVariables(SignatureWrapper wrapper, Binding declaringElement) {
552
private TypeVariableBinding[] createTypeVariables(SignatureWrapper wrapper, boolean assignVariables) {
553
	// detect all type variables first
553
	// detect all type variables first
554
	char[] typeSignature = wrapper.signature;
554
	char[] typeSignature = wrapper.signature;
555
	int depth = 0, length = typeSignature.length;
555
	int depth = 0, length = typeSignature.length;
Lines 576-582 Link Here
576
						pendingVariable = false;
576
						pendingVariable = false;
577
						int colon = CharOperation.indexOf(':', typeSignature, i);
577
						int colon = CharOperation.indexOf(':', typeSignature, i);
578
						char[] variableName = CharOperation.subarray(typeSignature, i, colon);
578
						char[] variableName = CharOperation.subarray(typeSignature, i, colon);
579
						variables.add(new TypeVariableBinding(variableName, declaringElement, rank++));
579
						variables.add(new TypeVariableBinding(variableName, this, rank++));
580
					}
580
					}
581
			}
581
			}
582
		}
582
		}
Lines 584-589 Link Here
584
	// initialize type variable bounds - may refer to forward variables
584
	// initialize type variable bounds - may refer to forward variables
585
	TypeVariableBinding[] result;
585
	TypeVariableBinding[] result;
586
	variables.toArray(result = new TypeVariableBinding[rank]);
586
	variables.toArray(result = new TypeVariableBinding[rank]);
587
	// when creating the type variables for a type, the type must remember them before initializing each variable
588
	// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=163680
589
	if (assignVariables)
590
		this.typeVariables = result;
587
	for (int i = 0; i < rank; i++) {
591
	for (int i = 0; i < rank; i++) {
588
		initializeTypeVariable(result[i], result, wrapper);
592
		initializeTypeVariable(result[i], result, wrapper);
589
	}
593
	}

Return to bug 163680