### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/internal/compiler/ast/IfStatement.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/IfStatement.java,v retrieving revision 1.70 diff -u -r1.70 IfStatement.java --- compiler/org/eclipse/jdt/internal/compiler/ast/IfStatement.java 4 Mar 2011 12:41:21 -0000 1.70 +++ compiler/org/eclipse/jdt/internal/compiler/ast/IfStatement.java 4 Mar 2011 13:51:36 -0000 @@ -164,10 +164,7 @@ if (hasThenPart) { BranchLabel falseLabel = null; // generate boolean condition only if needed - if (((this.bits & ASTNode.IsElseStatementUnreachable) != 0) || - (cst != Constant.NotAConstant && cst.booleanValue() == true)) { - // No need to generate if condition statement when we know that only the then action - // will be executed + if (cst != Constant.NotAConstant && cst.booleanValue() == true) { this.condition.generateCode(currentScope, codeStream, false); } else { this.condition.generateOptimizedBoolean( @@ -206,8 +203,7 @@ } } else if (hasElsePart) { // generate boolean condition only if needed - if (((this.bits & ASTNode.IsThenStatementUnreachable) != 0) || - (cst != Constant.NotAConstant && cst.booleanValue() == false)) { + if (cst != Constant.NotAConstant && cst.booleanValue() == false) { // No need to generate if condition statement when we know that only the else action // will be executed this.condition.generateCode(currentScope, codeStream, false); Index: compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java,v retrieving revision 1.51 diff -u -r1.51 Statement.java --- compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java 22 Jan 2011 23:39:25 -0000 1.51 +++ compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java 4 Mar 2011 13:51:36 -0000 @@ -72,7 +72,8 @@ // complaintLevel = 0 if was reachable up until now, 1 if fake reachable (deadcode), 2 if fatal unreachable (error) public int complainIfUnreachable(FlowInfo flowInfo, BlockScope scope, int previousComplaintLevel) { if ((flowInfo.reachMode() & FlowInfo.UNREACHABLE) != 0) { - this.bits &= ~ASTNode.IsReachable; + if ((flowInfo.reachMode() & FlowInfo.UNREACHABLE_OR_DEAD) != 0) + this.bits &= ~ASTNode.IsReachable; if (flowInfo == FlowInfo.DEAD_END) { if (previousComplaintLevel < COMPLAINED_UNREACHABLE) { scope.problemReporter().unreachableCode(this);