Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 181606 Details for
Bug 328240
org.eclipse.text.edits.MalformedTreeException: Overlapping text edits
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix + regression test
patch_328240.txt (text/plain), 3.26 KB, created by
Olivier Thomann
on 2010-10-24 20:03:08 EDT
(
hide
)
Description:
Proposed fix + regression test
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2010-10-24 20:03:08 EDT
Size:
3.26 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >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.219 >diff -u -r1.219 Scribe.java >--- formatter/org/eclipse/jdt/internal/formatter/Scribe.java 3 Sep 2010 15:44:26 -0000 1.219 >+++ formatter/org/eclipse/jdt/internal/formatter/Scribe.java 24 Oct 2010 13:38:42 -0000 >@@ -3784,7 +3784,7 @@ > newLineString = this.tempBuffer.toString(); > } > addReplaceEdit(end+1, this.scanner.getCurrentTokenEndPosition(), newLineString); >- textLineStart++; >+ textLineStart = Util.getLineNumber(this.scanner.currentPosition-1, this.lineEnds, textLineStart, this.maxLines); > } > } > } >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java,v >retrieving revision 1.37 >diff -u -r1.37 FormatterBugsTests.java >--- src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java 3 Sep 2010 14:49:22 -0000 1.37 >+++ src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java 24 Oct 2010 13:38:45 -0000 >@@ -7552,4 +7552,56 @@ > ); > } > >+/** >+ * @bug 328240: org.eclipse.text.edits.MalformedTreeException: Overlapping text edits >+ * @test Ensure that no exception occurs while formatting the given sample >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=328240" >+ */ >+public void testBug328240() { >+ String source = >+ "package com.example;\n" + >+ "\n" + >+ "public class FormatterError {\n" + >+ "\n" + >+ " /**\n" + >+ " * Create a paragraph element suited to be a header of the report. Headers\n" + >+ " * are the elements such as \"created by\" on \"created on\" that appear\n" + >+ " * underneath the title.\n" + >+ " * \n" + >+ " * @param reportHeader\n" + >+ " * a <code>String</coe> value that will be the text of\n" + >+ "\n" + >+ "* the paragraph.\n" + >+ " * @return a <code>Paragraph</code> containing the the text passed as the\n" + >+ " * reportHeader parameter.\n" + >+ " */\n" + >+ "\n" + >+ " public static String createReportHeader(String reportHeader) {\n" + >+ " return reportHeader;\n" + >+ " }\n" + >+ "}\n"; >+ formatSource(source, >+ "package com.example;\n" + >+ "\n" + >+ "public class FormatterError {\n" + >+ "\n" + >+ " /**\n" + >+ " * Create a paragraph element suited to be a header of the report. Headers\n" + >+ " * are the elements such as \"created by\" on \"created on\" that appear\n" + >+ " * underneath the title.\n" + >+ " * \n" + >+ " * @param reportHeader\n" + >+ " * a <code>String</coe> value that will be the text of\n" + >+ " * the paragraph.\n" + >+ " * @return a <code>Paragraph</code> containing the the text passed as the\n" + >+ " * reportHeader parameter.\n" + >+ " */\n" + >+ "\n" + >+ " public static String createReportHeader(String reportHeader) {\n" + >+ " return reportHeader;\n" + >+ " }\n" + >+ "}\n" >+ ); >+} >+ > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 328240
:
181281
| 181606