Community
Participate
Working Groups
HEAD (today's plug-in export of JDT Core). 1. import attached formatter profile 2. paste this into Package Explorer: package pack; public class Test { /** * @see Test.Inner */ public class Inner { } } 3. select the line " public class Inner { }" 4. Format (Ctrl+Shift+F) ==> AIOOB java.lang.ArrayIndexOutOfBoundsException: 8 at org.eclipse.jdt.internal.compiler.util.Util.getLineNumber(Util.java:438) at org.eclipse.jdt.internal.formatter.Scribe.isAdaptableRegion(Scribe.java:765) at org.eclipse.jdt.internal.formatter.Scribe.adaptRegions(Scribe.java:127) at org.eclipse.jdt.internal.formatter.Scribe.getRootEdit(Scribe.java:634) at org.eclipse.jdt.internal.formatter.CodeFormatterVisitor.format(CodeFormatterVisitor.java:806) at org.eclipse.jdt.internal.formatter.DefaultCodeFormatter.formatCompilationUnit(DefaultCodeFormatter.java:297) at org.eclipse.jdt.internal.formatter.DefaultCodeFormatter.format(DefaultCodeFormatter.java:176) at org.eclipse.jdt.internal.formatter.DefaultCodeFormatter.format(DefaultCodeFormatter.java:160) at org.eclipse.jdt.internal.corext.util.CodeFormatterUtil.reformat(CodeFormatterUtil.java:288) at org.eclipse.jdt.internal.ui.text.java.JavaFormattingStrategy.format(JavaFormattingStrategy.java:64) at org.eclipse.jface.text.formatter.MultiPassContentFormatter.formatMaster(MultiPassContentFormatter.java:193) at org.eclipse.jface.text.formatter.MultiPassContentFormatter.format(MultiPassContentFormatter.java:135) at org.eclipse.jface.text.source.SourceViewer.doOperation(SourceViewer.java:836) at org.eclipse.jface.text.source.projection.ProjectionViewer.doOperation(ProjectionViewer.java:1507) at org.eclipse.jdt.internal.ui.javaeditor.JavaSourceViewer.doOperation(JavaSourceViewer.java:178) at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSourceViewer.doOperation(CompilationUnitEditor.java:195) at org.eclipse.ui.texteditor.TextOperationAction$1.run(TextOperationAction.java:131) ...
Marking as major because I format the changed lines on save and now it booms when I want to save this file.
Created attachment 92135 [details] Formatter prefs
See also bug 213283 which claims to have fixed an AIOOBE.
Created attachment 92164 [details] [patch] - proposed fix + test case side effect of fix for bug 208541 released in 3.4 M4. This fix passes all jdt.core, UI and text tests
Patch released for 3.4M6 in HEAD.
Verified for 3.4M6 using build I20080324-1300