### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java,v retrieving revision 1.338 diff -u -r1.338 ProblemReporter.java --- compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java 31 Jan 2007 19:31:44 -0000 1.338 +++ compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java 2 Feb 2007 16:08:29 -0000 @@ -6086,12 +6086,22 @@ location.sourceEnd); } public void unreachableCode(Statement statement) { + int sourceStart = statement.sourceStart; + int sourceEnd = statement.sourceEnd; + if (statement instanceof LocalDeclaration) { + LocalDeclaration declaration = (LocalDeclaration) statement; + sourceStart = declaration.declarationSourceStart; + sourceEnd = declaration.declarationSourceEnd; + } else if (statement instanceof Expression) { + int statemendEnd = ((Expression) statement).statementEnd; + if (statemendEnd != -1) sourceEnd = statemendEnd; + } this.handle( IProblem.CodeCannotBeReached, NoArgument, NoArgument, - statement.sourceStart, - statement.sourceEnd); + sourceStart, + sourceEnd); } public void unresolvableReference(NameReference nameRef, Binding binding) { /* also need to check that the searchedType is the receiver type