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 66862 Details for
Bug 143026
[ast rewrite] Clean up parantheses are not recognizing comment //
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
patch
143026.patch (text/plain), 2.81 KB, created by
Martin Aeschlimann
on 2007-05-11 10:47:17 EDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Martin Aeschlimann
Created:
2007-05-11 10:47:17 EDT
Size:
2.81 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/rewrite/describing/LineCommentOffsetsTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/LineCommentOffsetsTest.java,v >retrieving revision 1.2 >diff -u -r1.2 LineCommentOffsetsTest.java >--- src/org/eclipse/jdt/core/tests/rewrite/describing/LineCommentOffsetsTest.java 10 May 2006 18:54:10 -0000 1.2 >+++ src/org/eclipse/jdt/core/tests/rewrite/describing/LineCommentOffsetsTest.java 11 May 2007 14:46:20 -0000 >@@ -453,7 +453,6 @@ > assertEqualString(preview, buf.toString()); > } > >- /* not yet working > public void testBug128422() throws Exception { > > IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null); >@@ -495,7 +494,7 @@ > buf.append(" }\n"); > buf.append("}\n"); > assertEqualString(preview, buf.toString()); >- }*/ >+ } > > public void testCommentAtEnd() throws Exception { > >#P org.eclipse.jdt.core >Index: dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java,v >retrieving revision 1.52 >diff -u -r1.52 ASTRewriteAnalyzer.java >--- dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java 27 Apr 2007 16:23:05 -0000 1.52 >+++ dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java 11 May 2007 14:46:22 -0000 >@@ -1061,6 +1061,9 @@ > TextEdit sourceEdit= getCopySourceEdit(copySource); > doTextCopy(sourceEdit, insertOffset, srcIndentLevel, destIndentString, editGroup); > currPos= offset + curr.length; // continue to insert after the replaced string >+ if (needsNewLineForLineComment(copySource.getNode(), formatted, currPos)) { >+ doTextInsert(insertOffset, getLineDelimiter(), editGroup); >+ } > } else if (data instanceof StringPlaceholderData) { // replace with a placeholder > String code= ((StringPlaceholderData) data).code; > String str= this.formatter.changeIndent(code, 0, destIndentString); >@@ -1076,6 +1079,14 @@ > } > } > >+ private boolean needsNewLineForLineComment(ASTNode node, String formatted, int offset) { >+ if (!this.lineCommentEndOffsets.isEndOfLineComment(getExtendedEnd(node), this.content)) { >+ return false; >+ } >+ // copied code ends with a line comment, but doesn't contain the new line >+ return offset < formatted.length() && !IndentManipulation.isLineDelimiterChar(formatted.charAt(offset)); >+ } >+ > private String getCurrentLine(String str, int pos) { > for (int i= pos - 1; i>= 0; i--) { > char ch= str.charAt(i);
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 143026
: 66862 |
66877