### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java,v retrieving revision 1.108 diff -u -r1.108 Expression.java --- compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java 22 Nov 2006 14:21:14 -0000 1.108 +++ compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java 22 Nov 2006 16:34:58 -0000 @@ -352,18 +352,12 @@ ReferenceBinding interfaceType = (ReferenceBinding) expressionType; match = interfaceType.findSuperTypeWithSameErasure(castType); if (match != null) { - if (use15specifics) { - return checkUnsafeCast(scope, castType, interfaceType, match, false); - } - return true; + return checkUnsafeCast(scope, castType, interfaceType, match, false); } tagAsNeedCheckCast(); match = castType.findSuperTypeWithSameErasure(interfaceType); if (match != null) { - if (use15specifics) { - return checkUnsafeCast(scope, castType, interfaceType, match, true); - } - return true; + return checkUnsafeCast(scope, castType, interfaceType, match, true); } if (use15specifics) { checkUnsafeCast(scope, castType, expressionType, null /*no match*/, true); @@ -397,10 +391,7 @@ tagAsNeedCheckCast(); match = castType.findSuperTypeWithSameErasure(expressionType); if (match != null) { - if (use15specifics) { - return checkUnsafeCast(scope, castType, expressionType, match, true); - } - return true; + return checkUnsafeCast(scope, castType, expressionType, match, true); } if (((ReferenceBinding) castType).isFinal()) { // no subclass for castType, thus compile-time check is invalid @@ -442,10 +433,7 @@ ReferenceBinding refExprType = (ReferenceBinding) expressionType; match = refExprType.findSuperTypeWithSameErasure(castType); if (match != null) { - if (use15specifics) { - return checkUnsafeCast(scope, castType, expressionType, match, false); - } - return true; + return checkUnsafeCast(scope, castType, expressionType, match, false); } // unless final a subclass may implement the interface ==> no check at compile time if (refExprType.isFinal()) { @@ -454,10 +442,7 @@ tagAsNeedCheckCast(); match = castType.findSuperTypeWithSameErasure(expressionType); if (match != null) { - if (use15specifics) { - return checkUnsafeCast(scope, castType, expressionType, match, true); - } - return true; + return checkUnsafeCast(scope, castType, expressionType, match, true); } if (use15specifics) { checkUnsafeCast(scope, castType, expressionType, null /*no match*/, true); @@ -471,18 +456,12 @@ match = expressionType.findSuperTypeWithSameErasure(castType); if (match != null) { if (expression != null && castType.id == T_JavaLangString) this.constant = expression.constant; // (String) cst is still a constant - if (use15specifics) { - return checkUnsafeCast(scope, castType, expressionType, match, false); - } - return true; + return checkUnsafeCast(scope, castType, expressionType, match, false); } match = castType.findSuperTypeWithSameErasure(expressionType); if (match != null) { tagAsNeedCheckCast(); - if (use15specifics) { - return checkUnsafeCast(scope, castType, expressionType, match, true); - } - return true; + return checkUnsafeCast(scope, castType, expressionType, match, true); } return false; }