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 161591 Details for
Bug 305281
[formatter] Turning off formatting changes comment's formatting
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
v00.txt (text/plain), 3.42 KB, created by
Frederic Fusier
on 2010-03-10 05:15:50 EST
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2010-03-10 05:15:50 EST
Size:
3.42 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.199 >diff -u -r1.199 Scribe.java >--- formatter/org/eclipse/jdt/internal/formatter/Scribe.java 4 Mar 2010 17:43:10 -0000 1.199 >+++ formatter/org/eclipse/jdt/internal/formatter/Scribe.java 10 Mar 2010 09:48:39 -0000 >@@ -2379,6 +2379,12 @@ > case TerminalTokens.TokenNameCOMMENT_JAVADOC : > if (this.editsEnabled && foundTaskCount > previousFoundTaskCount) { > setEditsEnabled(foundTaskCount, previousFoundTaskCount); >+ if (!this.editsEnabled && this.editsIndex > 1) { >+ OptimizedReplaceEdit currentEdit = this.edits[this.editsIndex-1]; >+ if (this.scanner.startPosition == currentEdit.offset+currentEdit.length) { >+ printNewLinesBeforeDisablingComment(); >+ } >+ } > previousFoundTaskCount = foundTaskCount; > } > if (trailing > NO_TRAILING_COMMENT) { >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsBugsTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsBugsTest.java,v >retrieving revision 1.58 >diff -u -r1.58 FormatterCommentsBugsTest.java >--- src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsBugsTest.java 4 Mar 2010 17:43:07 -0000 1.58 >+++ src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsBugsTest.java 10 Mar 2010 09:48:43 -0000 >@@ -14,6 +14,7 @@ > import org.eclipse.core.runtime.Path; > import org.eclipse.jdt.core.JavaModelException; > import org.eclipse.jdt.core.formatter.CodeFormatter; >+import org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants; > import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; > import org.eclipse.jdt.internal.formatter.DefaultCodeFormatterOptions; > >@@ -6239,4 +6240,45 @@ > "}\n"); > } > >+/** >+ * @bug 305281: [formatter] Turning off formatting changes comment's formatting >+ * @test Verify that turning off formatting in a javadoc does not screw up its indentation >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=305281" >+ */ >+public void testBug305281() { >+ this.formatterPrefs = null; >+ this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_DISABLING_TAG, "format: OFF"); >+ this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_ENABLING_TAG, "format: ON"); >+ String source = >+ "public class test {\n" + >+ "\n" + >+ " /**\n" + >+ " * @param args\n" + >+ " * format: OFF\n" + >+ " */\n" + >+ " public static void main(String[] args) {\n" + >+ " do {\n" + >+ " } while (false);\n" + >+ " for (;;) {\n" + >+ " }\n" + >+ " // format: ON\n" + >+ " }\n" + >+ "}\n"; >+ formatSource(source, >+ "public class test {\n" + >+ "\n" + >+ " /**\n" + >+ " * @param args\n" + >+ " * format: OFF\n" + >+ " */\n" + >+ " public static void main(String[] args) {\n" + >+ " do {\n" + >+ " } while (false);\n" + >+ " for (;;) {\n" + >+ " }\n" + >+ " // format: ON\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 305281
: 161591