public static int compareTypes(TypeBinding left, TypeBinding right) { if (left.isCompatibleWith(right)) return Scope.EQUAL_OR_MORE_SPECIFIC; if (right.isCompatibleWith(left)) return Scope.MORE_GENERIC; return Scope.NOT_RELATED; }
public static int compareTypes(TypeBinding left, TypeBinding right) { if (left.isCompatibleWith(right)) return Scope.EQUAL_OR_MORE_SPECIFIC; if (right.isCompatibleWith(left)) return Scope.MORE_GENERIC; return Scope.NOT_RELATED; }
public static int compareTypes(TypeBinding left, TypeBinding right) { if (left.isCompatibleWith(right)) return Scope.EQUAL_OR_MORE_SPECIFIC; if (right.isCompatibleWith(left)) return Scope.MORE_GENERIC; return Scope.NOT_RELATED; }
public static int compareTypes(TypeBinding left, TypeBinding right) { if (left.isCompatibleWith(right)) return Scope.EQUAL_OR_MORE_SPECIFIC; if (right.isCompatibleWith(left)) return Scope.MORE_GENERIC; return Scope.NOT_RELATED; }
public static int compareTypes(TypeBinding left, TypeBinding right) { if (left.isCompatibleWith(right)) return Scope.EQUAL_OR_MORE_SPECIFIC; if (right.isCompatibleWith(left)) return Scope.MORE_GENERIC; return Scope.NOT_RELATED; }
public static int compareTypes(TypeBinding left, TypeBinding right) { if (left.isCompatibleWith(right)) return Scope.EQUAL_OR_MORE_SPECIFIC; if (right.isCompatibleWith(left)) return Scope.MORE_GENERIC; return Scope.NOT_RELATED; }
private int parameterCompatibilityLevel(TypeBinding arg, TypeBinding param, LookupEnvironment env) { // only called if env.options.sourceLevel >= ClassFileConstants.JDK1_5 if (arg.isCompatibleWith(param)) return COMPATIBLE; if (arg.isBaseType() != param.isBaseType()) { TypeBinding convertedType = env.computeBoxingType(arg); if (convertedType == param || convertedType.isCompatibleWith(param)) return AUTOBOX_COMPATIBLE; } return NOT_COMPATIBLE; }
private int parameterCompatibilityLevel(TypeBinding arg, TypeBinding param, LookupEnvironment env) { // only called if env.options.sourceLevel >= ClassFileConstants.JDK1_5 if (arg.isCompatibleWith(param)) return COMPATIBLE; if (arg.isBaseType() != param.isBaseType()) { TypeBinding convertedType = env.computeBoxingType(arg); if (convertedType == param || convertedType.isCompatibleWith(param)) return AUTOBOX_COMPATIBLE; } return NOT_COMPATIBLE; }
private boolean shouldTryVarargs(MethodBinding method, TypeBinding resolvedType, TypeBinding targetType) { if (!method.isVarargs()) return false; if (targetType == null) return true; // off range if (targetType.isArrayType() && resolvedType != null && !resolvedType.isCompatibleWith(targetType, this)) return true; // not a direct match but hope to improve return false; }
private boolean superOnlyRaw(TypeBinding g, TypeBinding s, LookupEnvironment env) { if (s instanceof InferenceVariable) return false; // inference has no super types if (s.findSuperTypeOriginatingFrom(g) == null) return s.isCompatibleWith(env.convertToRawType(g, false)); return false; }
private boolean shouldTryVarargs(MethodBinding method, TypeBinding resolvedType, TypeBinding targetType) { if (!method.isVarargs()) return false; if (targetType == null) return true; // off range if (targetType.isArrayType() && resolvedType != null && !resolvedType.isCompatibleWith(targetType, this)) return true; // not a direct match but hope to improve return false; }
private boolean superOnlyRaw(TypeBinding g, TypeBinding s, LookupEnvironment env) { if (s instanceof InferenceVariable) return false; // inference has no super types if (s.findSuperTypeOriginatingFrom(g) == null) return s.isCompatibleWith(env.convertToRawType(g, false)); return false; }
private boolean superOnlyRaw(TypeBinding g, TypeBinding s, LookupEnvironment env) { if (s instanceof InferenceVariable) return false; // inference has no super types final TypeBinding superType = s.findSuperTypeOriginatingFrom(g); if (superType != null && !superType.isParameterizedType()) return s.isCompatibleWith(env.convertToRawType(g, false)); return false; }
public boolean isBoxingCompatibleWith(TypeBinding expressionType, TypeBinding targetType) { LookupEnvironment environment = environment(); if (environment.globalOptions.sourceLevel < ClassFileConstants.JDK1_5 || expressionType.isBaseType() == targetType.isBaseType()) return false; // check if autoboxed type is compatible TypeBinding convertedType = environment.computeBoxingType(expressionType); return convertedType == targetType || convertedType.isCompatibleWith(targetType); }
public boolean isBoxingCompatibleWith(TypeBinding expressionType, TypeBinding targetType) { LookupEnvironment environment = environment(); if (environment.globalOptions.sourceLevel < ClassFileConstants.JDK1_5 || expressionType.isBaseType() == targetType.isBaseType()) return false; // check if autoboxed type is compatible TypeBinding convertedType = environment.computeBoxingType(expressionType); return convertedType == targetType || convertedType.isCompatibleWith(targetType); }
public boolean isBoxingCompatibleWith(TypeBinding expressionType, TypeBinding targetType) { LookupEnvironment environment = environment(); if (environment.globalOptions.sourceLevel < ClassFileConstants.JDK1_5 || expressionType.isBaseType() == targetType.isBaseType()) return false; // check if autoboxed type is compatible TypeBinding convertedType = environment.computeBoxingType(expressionType); return TypeBinding.equalsEquals(convertedType, targetType) || convertedType.isCompatibleWith(targetType, this); }
public boolean isBoxingCompatibleWith(TypeBinding expressionType, TypeBinding targetType) { LookupEnvironment environment = environment(); if (environment.globalOptions.sourceLevel < ClassFileConstants.JDK1_5 || expressionType.isBaseType() == targetType.isBaseType()) return false; // check if autoboxed type is compatible TypeBinding convertedType = environment.computeBoxingType(expressionType); return TypeBinding.equalsEquals(convertedType, targetType) || convertedType.isCompatibleWith(targetType, this); }
public boolean isBoxingCompatibleWith(TypeBinding expressionType, TypeBinding targetType) { LookupEnvironment environment = environment(); if (environment.globalOptions.sourceLevel < ClassFileConstants.JDK1_5 || expressionType.isBaseType() == targetType.isBaseType()) return false; // check if autoboxed type is compatible TypeBinding convertedType = environment.computeBoxingType(expressionType); return TypeBinding.equalsEquals(convertedType, targetType) || convertedType.isCompatibleWith(targetType, this); }
public boolean isBoxingCompatibleWith(TypeBinding expressionType, TypeBinding targetType) { LookupEnvironment environment = environment(); if (environment.globalOptions.sourceLevel < ClassFileConstants.JDK1_5 || expressionType.isBaseType() == targetType.isBaseType()) return false; // check if autoboxed type is compatible TypeBinding convertedType = environment.computeBoxingType(expressionType); return TypeBinding.equalsEquals(convertedType, targetType) || convertedType.isCompatibleWith(targetType, this); }
public boolean isBoxingCompatibleWith(TypeBinding expressionType, TypeBinding targetType) { LookupEnvironment environment = environment(); if (environment.globalOptions.sourceLevel < ClassFileConstants.JDK1_5 || expressionType.isBaseType() == targetType.isBaseType()) return false; // check if autoboxed type is compatible TypeBinding convertedType = environment.computeBoxingType(expressionType); return TypeBinding.equalsEquals(convertedType, targetType) || convertedType.isCompatibleWith(targetType, this); }