Community
Participate
Working Groups
What steps will reproduce the problem? 1. Try to format a java class with the following method javadoc: bc.. /** * Create a paragraph element suited to be a header of the report. Headers * are the elements such as "created by" on "created on" that appear * underneath the title. * * @param reportHeader * a <code>String</coe> value that will be the text of * the paragraph. * @return a <code>Paragraph</code> containing the the text passed as the * reportHeader parameter. */ p. There is no feedback to the user, aside from the Error log entries. -- Error Details -- Date: Wed Oct 20 15:07:10 EEST 2010 Message: Exception occured while formatting comments Severity: Error Product: Eclipse 1.3.1.20100913-1228 (org.eclipse.epp.package.jee.product) Plugin: org.eclipse.jdt.core Exception Stack Trace: org.eclipse.text.edits.MalformedTreeException: Overlapping text edits at org.eclipse.text.edits.TextEdit$InsertionComparator.compare(TextEdit.java:121) at java.util.Collections.indexedBinarySearch(Collections.java:319) at java.util.Collections.binarySearch(Collections.java:307) at org.eclipse.text.edits.TextEdit.computeInsertionIndex(TextEdit.java:796) at org.eclipse.text.edits.TextEdit.internalAdd(TextEdit.java:781) at org.eclipse.text.edits.TextEdit.addChild(TextEdit.java:335) at org.eclipse.jdt.internal.formatter.Scribe.getRootEdit(Scribe.java:1248) at org.eclipse.jdt.internal.formatter.CodeFormatterVisitor.format(CodeFormatterVisitor.java:818) at org.eclipse.jdt.internal.formatter.DefaultCodeFormatter.formatCompilationUnit(DefaultCodeFormatter.java:241) at org.eclipse.jdt.internal.formatter.DefaultCodeFormatter.format(DefaultCodeFormatter.java:163) at org.eclipse.jdt.internal.formatter.DefaultCodeFormatter.format(DefaultCodeFormatter.java:146) at org.eclipse.jdt.internal.corext.util.CodeFormatterUtil.reformat(CodeFormatterUtil.java:288) at org.eclipse.jdt.internal.ui.text.java.JavaFormattingStrategy.format(JavaFormattingStrategy.java:65) at org.eclipse.jface.text.formatter.MultiPassContentFormatter.formatMaster(MultiPassContentFormatter.java:193) at org.eclipse.jface.text.formatter.MultiPassContentFormatter.format(MultiPassContentFormatter.java:142) at org.eclipse.jface.text.source.SourceViewer.doOperation(SourceViewer.java:966) at org.eclipse.jface.text.source.projection.ProjectionViewer.doOperation(ProjectionViewer.java:1534) at org.eclipse.jdt.internal.ui.javaeditor.JavaSourceViewer.doOperation(JavaSourceViewer.java:186) at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSourceViewer.doOperation(CompilationUnitEditor.java:199) at org.eclipse.ui.texteditor.TextOperationAction$1.run(TextOperationAction.java:131) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) at org.eclipse.ui.texteditor.TextOperationAction.run(TextOperationAction.java:129) at org.eclipse.jface.action.Action.runWithEvent(Action.java:498) at org.eclipse.ui.actions.RetargetAction.runWithEvent(RetargetAction.java:230) at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:234) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3540) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3161) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574) at org.eclipse.equinox.launcher.Main.run(Main.java:1407) at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
Created attachment 181281 [details] Java class which triggers the reported exception.
I'll take a look.
Created attachment 181606 [details] Proposed fix + regression test
Released for 3.7M3. Regression test added: org.eclipse.jdt.core.tests.formatter.FormatterBugsTests#testBug328240
Verified for 3.7M3 using build I20101025-0901