### 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.413 diff -u -r1.413 ProblemReporter.java --- compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java 13 Jul 2010 04:01:43 -0000 1.413 +++ compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java 19 Jul 2010 23:38:24 -0000 @@ -1065,7 +1065,7 @@ if (encoding == null) { encoding = System.getProperty("file.encoding"); //$NON-NLS-1$ } - String[] arguments = new String[]{ fileName, encoding, }; + String[] arguments = new String[]{ fileName, encoding }; this.handle( IProblem.InvalidEncoding, arguments, @@ -1078,13 +1078,16 @@ PrintWriter writer = new PrintWriter(stringWriter); if (verbose) { abortException.exception.printStackTrace(writer); + System.err.println(stringWriter.toString()); + stringWriter = new StringWriter(); + writer = new PrintWriter(stringWriter); } else { writer.print(abortException.exception.getClass().getName()); writer.print(':'); writer.print(abortException.exception.getMessage()); } String exceptionTrace = stringWriter.toString(); - String[] arguments = new String[]{ fileName, exceptionTrace, }; + String[] arguments = new String[]{ fileName, exceptionTrace }; this.handle( IProblem.CannotReadSource, arguments, Index: formatter/org/eclipse/jdt/internal/formatter/Scribe.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/Scribe.java,v retrieving revision 1.212 diff -u -r1.212 Scribe.java --- formatter/org/eclipse/jdt/internal/formatter/Scribe.java 24 Jun 2010 07:45:57 -0000 1.212 +++ formatter/org/eclipse/jdt/internal/formatter/Scribe.java 19 Jul 2010 23:38:25 -0000 @@ -1174,8 +1174,10 @@ linePtr = -linePtr - 1; } int i = getLineEnd(linePtr)+1; - while (this.scanner.source[i] != '\r') { - System.out.print(this.scanner.source[i++]); + char[] source = this.scanner.source; + int sourceLength = source.length; + while (i < sourceLength && source[i] != '\r') { + System.out.print(source[i++]); } System.out.println(); System.out.println(" - indentation level = "+this.indentationLevel); //$NON-NLS-1$