@Override public TypeBinding erasure() { if (this.firstBound != null) { return this.firstBound.erasure(); } return this.superclass; // java/lang/Object } /**
public TypeBinding erasure() { if (this.firstBound != null) { return this.firstBound.erasure(); } return this.superclass; // java/lang/Object } /**
public TypeBinding erasure() { if (this.firstBound != null) { return this.firstBound.erasure(); } return this.superclass; // java/lang/Object } /**
public TypeBinding erasure() { if (this.firstBound != null) { return this.firstBound.erasure(); } return this.superclass; // java/lang/Object } /**
public TypeBinding erasure() { if (this.firstBound != null) { return this.firstBound.erasure(); } return this.superclass; // java/lang/Object } /**
/** * Returns the type to use for generic cast, or null if none required */ public TypeBinding genericCast(TypeBinding targetType) { if (this == targetType) return null; TypeBinding targetErasure = targetType.erasure(); // type var get replaced by upper bound if (erasure().findSuperTypeOriginatingFrom(targetErasure) != null) return null; return targetErasure; }
/** * Returns the type to use for generic cast, or null if none required */ public TypeBinding genericCast(TypeBinding targetType) { if (TypeBinding.equalsEquals(this, targetType)) return null; TypeBinding targetErasure = targetType.erasure(); // type var get replaced by upper bound if (erasure().findSuperTypeOriginatingFrom(targetErasure) != null) return null; return targetErasure; }
/** * @see org.eclipse.jdt.internal.compiler.lookup.TypeBinding#erasure() */ public TypeBinding erasure() { TypeBinding erasedType = this.leafComponentType.erasure(); if (this.leafComponentType != erasedType) return this.environment.createArrayType(erasedType, this.dimensions); return this; } public LookupEnvironment environment() {
/** * Returns the type to use for generic cast, or null if none required */ public TypeBinding genericCast(TypeBinding targetType) { if (TypeBinding.equalsEquals(this, targetType)) return null; TypeBinding targetErasure = targetType.erasure(); // type var get replaced by upper bound if (erasure().findSuperTypeOriginatingFrom(targetErasure) != null) return null; return targetErasure; }
boolean areReturnTypesCompatible(MethodBinding one, MethodBinding two) { if (one.returnType == two.returnType) return true; if (this.type.scope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5) { return areReturnTypesCompatible0(one, two); } else { return areTypesEqual(one.returnType.erasure(), two.returnType.erasure()); } } boolean areTypesEqual(TypeBinding one, TypeBinding two) {
@Override public boolean isSubtypeOf(TypeBinding right, boolean simulatingBugJDK8026527) { if (simulatingBugJDK8026527) { right = this.environment.convertToRawType(right.erasure(), false); } return super.isSubtypeOf(right, simulatingBugJDK8026527); }
/** * @see org.eclipse.jdt.internal.compiler.lookup.TypeBinding#erasure() */ @Override public TypeBinding erasure() { TypeBinding erasedType = this.leafComponentType.erasure(); if (TypeBinding.notEquals(this.leafComponentType, erasedType)) return this.environment.createArrayType(erasedType, this.dimensions); return this; }
/** * @see org.eclipse.jdt.internal.compiler.lookup.TypeBinding#erasure() */ public TypeBinding erasure() { TypeBinding erasedType = this.leafComponentType.erasure(); if (TypeBinding.notEquals(this.leafComponentType, erasedType)) return this.environment.createArrayType(erasedType, this.dimensions); return this; } public LookupEnvironment environment() {
public void rawTypeReference(ASTNode location, TypeBinding type) { if (this.options.sourceLevel < ClassFileConstants.JDK1_5) return; // https://bugs.eclipse.org/bugs/show_bug.cgi?id=305259 type = type.leafComponentType(); this.handle( IProblem.RawTypeReference, new String[] {new String(type.readableName()), new String(type.erasure().readableName()), }, new String[] {new String(type.shortReadableName()),new String(type.erasure().shortReadableName()),}, location.sourceStart, nodeSourceEnd(null, location, Integer.MAX_VALUE)); } public void recursiveConstructorInvocation(ExplicitConstructorCall constructorCall) {
public void rawTypeReference(ASTNode location, TypeBinding type) { if (this.options.sourceLevel < ClassFileConstants.JDK1_5) return; // https://bugs.eclipse.org/bugs/show_bug.cgi?id=305259 type = type.leafComponentType(); this.handle( IProblem.RawTypeReference, new String[] {new String(type.readableName()), new String(type.erasure().readableName()), }, new String[] {new String(type.shortReadableName()),new String(type.erasure().shortReadableName()),}, location.sourceStart, nodeSourceEnd(null, location, Integer.MAX_VALUE)); } public void recursiveConstructorInvocation(ExplicitConstructorCall constructorCall) {
public void invokeAutoCloseableClose(TypeBinding resourceType) { // invokevirtual/interface: <resourceType>.close() invoke( resourceType.erasure().isInterface() ? Opcodes.OPC_invokeinterface : Opcodes.OPC_invokevirtual, 1, // receiverAndArgsSize 0, // returnTypeSize resourceType.constantPoolName(), ConstantPool.Close, ConstantPool.CloseSignature); }
public void invokeAutoCloseableClose(TypeBinding resourceType) { // invokevirtual/interface: <resourceType>.close() invoke( resourceType.erasure().isInterface() ? Opcodes.OPC_invokeinterface : Opcodes.OPC_invokevirtual, 1, // receiverAndArgsSize 0, // returnTypeSize resourceType.constantPoolName(), ConstantPool.Close, ConstantPool.CloseSignature); }
public void invokeAutoCloseableClose(TypeBinding resourceType) { // invokevirtual/interface: <resourceType>.close() invoke( resourceType.erasure().isInterface() ? Opcodes.OPC_invokeinterface : Opcodes.OPC_invokevirtual, 1, // receiverAndArgsSize 0, // returnTypeSize resourceType.constantPoolName(), ConstantPool.Close, ConstantPool.CloseSignature); }
private void observeType(TypeBinding binding) { binding = binding.leafComponentType().erasure(); if (binding instanceof ReferenceBinding) { ReferenceBinding referenceBinding = (ReferenceBinding) binding; observeType(referenceBinding.compoundName); // TODO only track referenced member types (requires jdt.apt changes) for (ReferenceBinding memberType : referenceBinding.memberTypes()) { observeType(memberType.compoundName); } } }
private static TypeBinding getRealErasure(TypeBinding type, LookupEnvironment environment) { TypeBinding erasure = type.erasure(); // could still be / contain a generic type that needs to be converted to raw: TypeBinding erasedLeaf = erasure.leafComponentType(); if (erasedLeaf.isGenericType()) erasedLeaf = environment.convertToRawType(erasedLeaf, false); if (erasure.isArrayType()) return environment.createArrayType(erasedLeaf, erasure.dimensions()); return erasedLeaf; }