public boolean checkUnsafeCast(Scope scope, TypeBinding castType, TypeBinding expressionType, TypeBinding match, boolean isNarrowing) { if (match == castType) { if (!isNarrowing) tagAsUnnecessaryCast(scope, castType); return true; } if (match != null && (castType.isBoundParameterizedType() || expressionType.isBoundParameterizedType())) { if(isNarrowing ? match.isProvablyDistinct(expressionType) : castType.isProvablyDistinct(match)) { return false; } } if (!isNarrowing) tagAsUnnecessaryCast(scope, castType); return true; }
/** * Meant to be invoked on compatible types, to figure if unchecked conversion is necessary */ public boolean needsUncheckedConversion(TypeBinding targetType) { if (this == targetType) return false; targetType = targetType.leafComponentType(); if (!(targetType instanceof ReferenceBinding)) return false; TypeBinding currentType = leafComponentType(); TypeBinding match = currentType.findSuperTypeOriginatingFrom(targetType); if (!(match instanceof ReferenceBinding)) return false; ReferenceBinding compatible = (ReferenceBinding) match; while (compatible.isRawType()) { if (targetType.isBoundParameterizedType()) return true; if (compatible.isStatic()) break; if ((compatible = compatible.enclosingType()) == null) break; if ((targetType = targetType.enclosingType()) == null) break; } return false; }
/** * Meant to be invoked on compatible types, to figure if unchecked conversion is necessary */ public boolean needsUncheckedConversion(TypeBinding targetType) { if (this == targetType) return false; targetType = targetType.leafComponentType(); if (!(targetType instanceof ReferenceBinding)) return false; TypeBinding currentType = leafComponentType(); TypeBinding match = currentType.findSuperTypeOriginatingFrom(targetType); if (!(match instanceof ReferenceBinding)) return false; ReferenceBinding compatible = (ReferenceBinding) match; while (compatible.isRawType()) { if (targetType.isBoundParameterizedType()) return true; if (compatible.isStatic()) break; if ((compatible = compatible.enclosingType()) == null) break; if ((targetType = targetType.enclosingType()) == null) break; } return false; }
/** * Meant to be invoked on compatible types, to figure if unchecked conversion is necessary */ public boolean needsUncheckedConversion(TypeBinding targetType) { if (this == targetType) return false; targetType = targetType.leafComponentType(); if (!(targetType instanceof ReferenceBinding)) return false; TypeBinding currentType = leafComponentType(); TypeBinding match = currentType.findSuperTypeOriginatingFrom(targetType); if (!(match instanceof ReferenceBinding)) return false; ReferenceBinding compatible = (ReferenceBinding) match; while (compatible.isRawType()) { if (targetType.isBoundParameterizedType()) return true; if (compatible.isStatic()) break; if ((compatible = compatible.enclosingType()) == null) break; if ((targetType = targetType.enclosingType()) == null) break; } return false; }
/** * Meant to be invoked on compatible types, to figure if unchecked conversion is necessary */ public boolean needsUncheckedConversion(TypeBinding targetType) { if (TypeBinding.equalsEquals(this, targetType)) return false; targetType = targetType.leafComponentType(); if (!(targetType instanceof ReferenceBinding)) return false; TypeBinding currentType = leafComponentType(); TypeBinding match = currentType.findSuperTypeOriginatingFrom(targetType); if (!(match instanceof ReferenceBinding)) return false; ReferenceBinding compatible = (ReferenceBinding) match; while (compatible.isRawType()) { if (targetType.isBoundParameterizedType()) return true; if (compatible.isStatic()) break; if ((compatible = compatible.enclosingType()) == null) break; if ((targetType = targetType.enclosingType()) == null) break; } return false; }
/** * Meant to be invoked on compatible types, to figure if unchecked conversion is necessary */ public boolean needsUncheckedConversion(TypeBinding targetType) { if (TypeBinding.equalsEquals(this, targetType)) return false; targetType = targetType.leafComponentType(); if (!(targetType instanceof ReferenceBinding)) return false; TypeBinding currentType = leafComponentType(); TypeBinding match = currentType.findSuperTypeOriginatingFrom(targetType); if (!(match instanceof ReferenceBinding)) return false; ReferenceBinding compatible = (ReferenceBinding) match; while (compatible.isRawType()) { if (targetType.isBoundParameterizedType()) return true; if (compatible.isStatic()) break; if ((compatible = compatible.enclosingType()) == null) break; if ((targetType = targetType.enclosingType()) == null) break; } return false; }
/** * Meant to be invoked on compatible types, to figure if unchecked conversion is necessary */ public boolean needsUncheckedConversion(TypeBinding targetType) { if (TypeBinding.equalsEquals(this, targetType)) return false; targetType = targetType.leafComponentType(); if (!(targetType instanceof ReferenceBinding)) return false; TypeBinding currentType = leafComponentType(); TypeBinding match = currentType.findSuperTypeOriginatingFrom(targetType); if (!(match instanceof ReferenceBinding)) return false; ReferenceBinding compatible = (ReferenceBinding) match; while (compatible.isRawType()) { if (targetType.isBoundParameterizedType()) return true; if (compatible.isStatic()) break; if ((compatible = compatible.enclosingType()) == null) break; if ((targetType = targetType.enclosingType()) == null) break; } return false; }
/** * Meant to be invoked on compatible types, to figure if unchecked conversion is necessary */ public boolean needsUncheckedConversion(TypeBinding targetType) { if (TypeBinding.equalsEquals(this, targetType)) return false; targetType = targetType.leafComponentType(); if (!(targetType instanceof ReferenceBinding)) return false; TypeBinding currentType = leafComponentType(); TypeBinding match = currentType.findSuperTypeOriginatingFrom(targetType); if (!(match instanceof ReferenceBinding)) return false; ReferenceBinding compatible = (ReferenceBinding) match; while (compatible.isRawType()) { if (targetType.isBoundParameterizedType()) return true; if (compatible.isStatic()) break; if ((compatible = compatible.enclosingType()) == null) break; if ((targetType = targetType.enclosingType()) == null) break; } return false; }
/** * Meant to be invoked on compatible types, to figure if unchecked conversion is necessary */ public boolean needsUncheckedConversion(TypeBinding targetType) { if (TypeBinding.equalsEquals(this, targetType)) return false; targetType = targetType.leafComponentType(); if (!(targetType instanceof ReferenceBinding)) return false; TypeBinding currentType = leafComponentType(); TypeBinding match = currentType.findSuperTypeOriginatingFrom(targetType); if (!(match instanceof ReferenceBinding)) return false; ReferenceBinding compatible = (ReferenceBinding) match; while (compatible.isRawType()) { if (targetType.isBoundParameterizedType()) return true; if (compatible.isStatic()) break; if ((compatible = compatible.enclosingType()) == null) break; if ((targetType = targetType.enclosingType()) == null) break; } return false; }
/** * Meant to be invoked on compatible types, to figure if unchecked conversion is necessary */ public boolean needsUncheckedConversion(TypeBinding targetType) { if (TypeBinding.equalsEquals(this, targetType)) return false; targetType = targetType.leafComponentType(); if (!(targetType instanceof ReferenceBinding)) return false; TypeBinding currentType = leafComponentType(); TypeBinding match = currentType.findSuperTypeOriginatingFrom(targetType); if (!(match instanceof ReferenceBinding)) return false; ReferenceBinding compatible = (ReferenceBinding) match; while (compatible.isRawType()) { if (targetType.isBoundParameterizedType()) return true; if (compatible.isStatic()) break; if ((compatible = compatible.enclosingType()) == null) break; if ((targetType = targetType.enclosingType()) == null) break; } return false; }
/** * Meant to be invoked on compatible types, to figure if unchecked conversion is necessary */ public boolean needsUncheckedConversion(TypeBinding targetType) { if (TypeBinding.equalsEquals(this, targetType)) return false; targetType = targetType.leafComponentType(); if (!(targetType instanceof ReferenceBinding)) return false; TypeBinding currentType = leafComponentType(); TypeBinding match = currentType.findSuperTypeOriginatingFrom(targetType); if (!(match instanceof ReferenceBinding)) return false; ReferenceBinding compatible = (ReferenceBinding) match; while (compatible.isRawType()) { if (targetType.isBoundParameterizedType()) return true; if (compatible.isStatic()) break; if ((compatible = compatible.enclosingType()) == null) break; if ((targetType = targetType.enclosingType()) == null) break; } return false; }
/** * Meant to be invoked on compatible types, to figure if unchecked conversion is necessary */ public boolean needsUncheckedConversion(TypeBinding targetType) { if (TypeBinding.equalsEquals(this, targetType)) return false; targetType = targetType.leafComponentType(); if (!(targetType instanceof ReferenceBinding)) return false; TypeBinding currentType = leafComponentType(); TypeBinding match = currentType.findSuperTypeOriginatingFrom(targetType); if (!(match instanceof ReferenceBinding)) return false; ReferenceBinding compatible = (ReferenceBinding) match; while (compatible.isRawType()) { if (targetType.isBoundParameterizedType()) return true; if (compatible.isStatic()) break; if ((compatible = compatible.enclosingType()) == null) break; if ((targetType = targetType.enclosingType()) == null) break; } return false; }
if (exceptionType.isBoundParameterizedType()) { hasError = true; scope.problemReporter().invalidParameterizedExceptionType(exceptionType, this.typeReferences[i]);
if (exceptionType.isBoundParameterizedType()) { hasError = true; scope.problemReporter().invalidParameterizedExceptionType(exceptionType, this.typeReferences[i]);
if (exceptionType.isBoundParameterizedType()) { hasError = true; scope.problemReporter().invalidParameterizedExceptionType(exceptionType, this.typeReferences[i]);
if (exceptionType.isBoundParameterizedType()) { hasError = true; scope.problemReporter().invalidParameterizedExceptionType(exceptionType, this.typeReferences[i]);
if (exceptionType.isBoundParameterizedType()) { hasError = true; scope.problemReporter().invalidParameterizedExceptionType(exceptionType, this.typeReferences[i]);
if (exceptionType.isBoundParameterizedType()) { hasError = true; scope.problemReporter().invalidParameterizedExceptionType(exceptionType, this.typeReferences[i]);
switch(exceptionType.kind()) { case Binding.PARAMETERIZED_TYPE : if (exceptionType.isBoundParameterizedType()) { hasError = true; scope.problemReporter().invalidParameterizedExceptionType(exceptionType, this);
switch(exceptionType.kind()) { case Binding.PARAMETERIZED_TYPE : if (exceptionType.isBoundParameterizedType()) { hasError = true; scope.problemReporter().invalidParameterizedExceptionType(exceptionType, this);