public char[] shortReadableName(boolean showGenerics) { StringBuffer nameBuffer = new StringBuffer(10); if (isMemberType()) { nameBuffer.append(CharOperation.concat(enclosingType().shortReadableName(showGenerics && !isStatic()), this.sourceName, '.')); } else { nameBuffer.append(this.type.sourceName); } if (showGenerics) { if (this.arguments != null && this.arguments.length > 0) { // empty arguments array happens when PTB has been created just to capture type annotations nameBuffer.append('<'); for (int i = 0, length = this.arguments.length; i < length; i++) { if (i > 0) nameBuffer.append(','); nameBuffer.append(this.arguments[i].shortReadableName()); } nameBuffer.append('>'); } } int nameLength = nameBuffer.length(); char[] shortReadableName = new char[nameLength]; nameBuffer.getChars(0, nameLength, shortReadableName, 0); return shortReadableName; }
@Override public char[] shortReadableName(boolean showGenerics) { StringBuffer nameBuffer = new StringBuffer(10); if (isMemberType()) { nameBuffer.append(CharOperation.concat(enclosingType().shortReadableName(showGenerics && !isStatic()), this.sourceName, '.')); } else { nameBuffer.append(this.type.sourceName); } if (showGenerics) { if (this.arguments != null && this.arguments.length > 0) { // empty arguments array happens when PTB has been created just to capture type annotations nameBuffer.append('<'); for (int i = 0, length = this.arguments.length; i < length; i++) { if (i > 0) nameBuffer.append(','); nameBuffer.append(this.arguments[i].shortReadableName()); } nameBuffer.append('>'); } } int nameLength = nameBuffer.length(); char[] shortReadableName = new char[nameLength]; nameBuffer.getChars(0, nameLength, shortReadableName, 0); return shortReadableName; }
public char[] readableName(boolean showGenerics) { StringBuffer nameBuffer = new StringBuffer(10); if (isMemberType()) { nameBuffer.append(CharOperation.concat(enclosingType().readableName(showGenerics && !isStatic()), this.sourceName, '.')); } else { nameBuffer.append(CharOperation.concatWith(this.type.compoundName, '.')); } if (showGenerics) { if (this.arguments != null && this.arguments.length > 0) { // empty arguments array happens when PTB has been created just to capture type annotations nameBuffer.append('<'); for (int i = 0, length = this.arguments.length; i < length; i++) { if (i > 0) nameBuffer.append(','); nameBuffer.append(this.arguments[i].readableName()); } nameBuffer.append('>'); } } int nameLength = nameBuffer.length(); char[] readableName = new char[nameLength]; nameBuffer.getChars(0, nameLength, readableName, 0); return readableName; }
@Override public char[] readableName(boolean showGenerics) { StringBuffer nameBuffer = new StringBuffer(10); if (isMemberType()) { nameBuffer.append(CharOperation.concat(enclosingType().readableName(showGenerics && !isStatic()), this.sourceName, '.')); } else { nameBuffer.append(CharOperation.concatWith(this.type.compoundName, '.')); } if (showGenerics) { if (this.arguments != null && this.arguments.length > 0) { // empty arguments array happens when PTB has been created just to capture type annotations nameBuffer.append('<'); for (int i = 0, length = this.arguments.length; i < length; i++) { if (i > 0) nameBuffer.append(','); nameBuffer.append(this.arguments[i].readableName()); } nameBuffer.append('>'); } } int nameLength = nameBuffer.length(); char[] readableName = new char[nameLength]; nameBuffer.getChars(0, nameLength, readableName, 0); return readableName; }
} else { StringBuffer sig = new StringBuffer(10); if (isMemberType() && !isStatic()) { ReferenceBinding enclosing = enclosingType(); char[] typeSig = enclosing.genericTypeSignature();
} else { StringBuffer sig = new StringBuffer(10); if (isMemberType() && !isStatic()) { ReferenceBinding enclosing = enclosingType(); char[] typeSig = enclosing.genericTypeSignature();
/** * @see org.eclipse.jdt.internal.compiler.lookup.Substitution#substitute(org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding) */ public TypeBinding substitute(TypeVariableBinding originalVariable) { ParameterizedTypeBinding currentType = this; while (true) { TypeVariableBinding[] typeVariables = currentType.type.typeVariables(); int length = typeVariables.length; // check this variable can be substituted given parameterized type if (originalVariable.rank < length && typeVariables[originalVariable.rank] == originalVariable) { // lazy init, since cannot do so during binding creation if during supertype connection if (currentType.arguments == null) currentType.initializeArguments(); // only for raw types if (currentType.arguments != null) return currentType.arguments[originalVariable.rank]; } // recurse on enclosing type, as it may hold more substitutions to perform if (currentType.isStatic()) break; ReferenceBinding enclosing = currentType.enclosingType(); if (!(enclosing instanceof ParameterizedTypeBinding)) break; currentType = (ParameterizedTypeBinding) enclosing; } return originalVariable; }
/** * @see org.eclipse.jdt.internal.compiler.lookup.Substitution#substitute(org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding) */ public TypeBinding substitute(TypeVariableBinding originalVariable) { ParameterizedTypeBinding currentType = this; while (true) { TypeVariableBinding[] typeVariables = currentType.type.typeVariables(); int length = typeVariables.length; // check this variable can be substituted given parameterized type if (originalVariable.rank < length && typeVariables[originalVariable.rank] == originalVariable) { // lazy init, since cannot do so during binding creation if during supertype connection if (currentType.arguments == null) currentType.initializeArguments(); // only for raw types if (currentType.arguments != null) return currentType.arguments[originalVariable.rank]; } // recurse on enclosing type, as it may hold more substitutions to perform if (currentType.isStatic()) break; ReferenceBinding enclosing = currentType.enclosingType(); if (!(enclosing instanceof ParameterizedTypeBinding)) break; currentType = (ParameterizedTypeBinding) enclosing; } return originalVariable; }
/** * @see org.eclipse.jdt.internal.compiler.lookup.Substitution#substitute(org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding) */ public TypeBinding substitute(TypeVariableBinding originalVariable) { ParameterizedTypeBinding currentType = this; while (true) { TypeVariableBinding[] typeVariables = currentType.type.typeVariables(); int length = typeVariables.length; // check this variable can be substituted given parameterized type if (originalVariable.rank < length && typeVariables[originalVariable.rank] == originalVariable) { // lazy init, since cannot do so during binding creation if during supertype connection if (currentType.arguments == null) currentType.initializeArguments(); // only for raw types if (currentType.arguments != null) { if (currentType.arguments.length == 0) { // diamond type return originalVariable; } return currentType.arguments[originalVariable.rank]; } } // recurse on enclosing type, as it may hold more substitutions to perform if (currentType.isStatic()) break; ReferenceBinding enclosing = currentType.enclosingType(); if (!(enclosing instanceof ParameterizedTypeBinding)) break; currentType = (ParameterizedTypeBinding) enclosing; } return originalVariable; }
/** * @see org.eclipse.jdt.internal.compiler.lookup.Substitution#substitute(org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding) */ public TypeBinding substitute(TypeVariableBinding originalVariable) { ParameterizedTypeBinding currentType = this; while (true) { TypeVariableBinding[] typeVariables = currentType.type.typeVariables(); int length = typeVariables.length; // check this variable can be substituted given parameterized type if (originalVariable.rank < length && TypeBinding.equalsEquals(typeVariables[originalVariable.rank], originalVariable)) { // lazy init, since cannot do so during binding creation if during supertype connection if (currentType.arguments == null) currentType.initializeArguments(); // only for raw types if (currentType.arguments != null) { if (currentType.arguments.length == 0) { // diamond type return originalVariable; } TypeBinding substitute = currentType.arguments[originalVariable.rank]; return originalVariable.combineTypeAnnotations(substitute); } } // recurse on enclosing type, as it may hold more substitutions to perform if (currentType.isStatic()) break; ReferenceBinding enclosing = currentType.enclosingType(); if (!(enclosing instanceof ParameterizedTypeBinding)) break; currentType = (ParameterizedTypeBinding) enclosing; } return originalVariable; }
if (currentType.isStatic()) break; ReferenceBinding enclosing = currentType.enclosingType(); if (!(enclosing instanceof ParameterizedTypeBinding))
/** * @see org.eclipse.jdt.internal.compiler.lookup.Substitution#substitute(org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding) */ public TypeBinding substitute(TypeVariableBinding originalVariable) { ParameterizedTypeBinding currentType = this; while (true) { TypeVariableBinding[] typeVariables = currentType.type.typeVariables(); int length = typeVariables.length; // check this variable can be substituted given parameterized type if (originalVariable.rank < length && TypeBinding.equalsEquals(typeVariables[originalVariable.rank], originalVariable)) { // lazy init, since cannot do so during binding creation if during supertype connection if (currentType.arguments == null) currentType.initializeArguments(); // only for raw types if (currentType.arguments != null) { if (currentType.arguments.length == 0) { // diamond type return originalVariable; } TypeBinding substitute = currentType.arguments[originalVariable.rank]; return originalVariable.combineTypeAnnotations(substitute); } } // recurse on enclosing type, as it may hold more substitutions to perform if (currentType.isStatic()) break; ReferenceBinding enclosing = currentType.enclosingType(); if (!(enclosing instanceof ParameterizedTypeBinding)) break; currentType = (ParameterizedTypeBinding) enclosing; } return originalVariable; }
/** * @see org.eclipse.jdt.internal.compiler.lookup.Substitution#substitute(org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding) */ public TypeBinding substitute(TypeVariableBinding originalVariable) { ParameterizedTypeBinding currentType = this; while (true) { TypeVariableBinding[] typeVariables = currentType.type.typeVariables(); int length = typeVariables.length; // check this variable can be substituted given parameterized type if (originalVariable.rank < length && TypeBinding.equalsEquals(typeVariables[originalVariable.rank], originalVariable)) { // lazy init, since cannot do so during binding creation if during supertype connection if (currentType.arguments == null) currentType.initializeArguments(); // only for raw types if (currentType.arguments != null) { if (currentType.arguments.length == 0) { // diamond type return originalVariable; } TypeBinding substitute = currentType.arguments[originalVariable.rank]; return originalVariable.combineTypeAnnotations(substitute); } } // recurse on enclosing type, as it may hold more substitutions to perform if (currentType.isStatic()) break; ReferenceBinding enclosing = currentType.enclosingType(); if (!(enclosing instanceof ParameterizedTypeBinding)) break; currentType = (ParameterizedTypeBinding) enclosing; } return originalVariable; }
/** * @see org.eclipse.jdt.internal.compiler.lookup.Substitution#substitute(org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding) */ public TypeBinding substitute(TypeVariableBinding originalVariable) { ParameterizedTypeBinding currentType = this; while (true) { TypeVariableBinding[] typeVariables = currentType.type.typeVariables(); int length = typeVariables.length; // check this variable can be substituted given parameterized type if (originalVariable.rank < length && TypeBinding.equalsEquals(typeVariables[originalVariable.rank], originalVariable)) { // lazy init, since cannot do so during binding creation if during supertype connection if (currentType.arguments == null) currentType.initializeArguments(); // only for raw types if (currentType.arguments != null) { if (currentType.arguments.length == 0) { // diamond type return originalVariable; } TypeBinding substitute = currentType.arguments[originalVariable.rank]; return originalVariable.combineTypeAnnotations(substitute); } } // recurse on enclosing type, as it may hold more substitutions to perform if (currentType.isStatic()) break; ReferenceBinding enclosing = currentType.enclosingType(); if (!(enclosing instanceof ParameterizedTypeBinding)) break; currentType = (ParameterizedTypeBinding) enclosing; } return originalVariable; }
/** * @see org.eclipse.jdt.internal.compiler.lookup.Substitution#substitute(org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding) */ public TypeBinding substitute(TypeVariableBinding originalVariable) { ParameterizedTypeBinding currentType = this; while (true) { TypeVariableBinding[] typeVariables = currentType.type.typeVariables(); int length = typeVariables.length; // check this variable can be substituted given parameterized type if (originalVariable.rank < length && TypeBinding.equalsEquals(typeVariables[originalVariable.rank], originalVariable)) { // lazy init, since cannot do so during binding creation if during supertype connection if (currentType.arguments == null) currentType.initializeArguments(); // only for raw types if (currentType.arguments != null) { if (currentType.arguments.length == 0) { // diamond type return originalVariable; } TypeBinding substitute = currentType.arguments[originalVariable.rank]; return originalVariable.hasTypeAnnotations() ? this.environment.createAnnotatedType(substitute, originalVariable.getTypeAnnotations()) : substitute; } } // recurse on enclosing type, as it may hold more substitutions to perform if (currentType.isStatic()) break; ReferenceBinding enclosing = currentType.enclosingType(); if (!(enclosing instanceof ParameterizedTypeBinding)) break; currentType = (ParameterizedTypeBinding) enclosing; } return originalVariable; }
/** * @see org.eclipse.jdt.internal.compiler.lookup.Substitution#substitute(org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding) */ public TypeBinding substitute(TypeVariableBinding originalVariable) { ParameterizedTypeBinding currentType = this; while (true) { TypeVariableBinding[] typeVariables = currentType.type.typeVariables(); int length = typeVariables.length; // check this variable can be substituted given parameterized type if (originalVariable.rank < length && TypeBinding.equalsEquals(typeVariables[originalVariable.rank], originalVariable)) { // lazy init, since cannot do so during binding creation if during supertype connection if (currentType.arguments == null) currentType.initializeArguments(); // only for raw types if (currentType.arguments != null) { if (currentType.arguments.length == 0) { // diamond type return originalVariable; } TypeBinding substitute = currentType.arguments[originalVariable.rank]; return originalVariable.hasTypeAnnotations() ? this.environment.createAnnotatedType(substitute, originalVariable.getTypeAnnotations()) : substitute; } } // recurse on enclosing type, as it may hold more substitutions to perform if (currentType.isStatic()) break; ReferenceBinding enclosing = currentType.enclosingType(); if (!(enclosing instanceof ParameterizedTypeBinding)) break; currentType = (ParameterizedTypeBinding) enclosing; } return originalVariable; }
/** * @see org.eclipse.jdt.internal.compiler.lookup.Substitution#substitute(org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding) */ public TypeBinding substitute(TypeVariableBinding originalVariable) { ParameterizedTypeBinding currentType = this; while (true) { TypeVariableBinding[] typeVariables = currentType.type.typeVariables(); int length = typeVariables.length; // check this variable can be substituted given parameterized type if (originalVariable.rank < length && TypeBinding.equalsEquals(typeVariables[originalVariable.rank], originalVariable)) { // lazy init, since cannot do so during binding creation if during supertype connection if (currentType.arguments == null) currentType.initializeArguments(); // only for raw types if (currentType.arguments != null) { if (currentType.arguments.length == 0) { // diamond type return originalVariable; } TypeBinding substitute = currentType.arguments[originalVariable.rank]; return originalVariable.hasTypeAnnotations() ? this.environment.createAnnotatedType(substitute, originalVariable.getTypeAnnotations()) : substitute; } } // recurse on enclosing type, as it may hold more substitutions to perform if (currentType.isStatic()) break; ReferenceBinding enclosing = currentType.enclosingType(); if (!(enclosing instanceof ParameterizedTypeBinding)) break; currentType = (ParameterizedTypeBinding) enclosing; } return originalVariable; }
if (this.type != otherParamType.type) return false; if (!isStatic()) { // static member types do not compare their enclosing ReferenceBinding enclosing = enclosingType(); if (enclosing != null) {
if (TypeBinding.notEquals(this.type, otherParamType.type)) return false; if (!isStatic()) { // static member types do not compare their enclosing ReferenceBinding enclosing = enclosingType(); if (enclosing != null) {
if (TypeBinding.notEquals(this.type, otherParamType.type)) return false; if (!isStatic()) { // static member types do not compare their enclosing ReferenceBinding enclosing = enclosingType(); if (enclosing != null) {