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 39661 Details for
Bug 130752
[comments] first BlockComment parsed as LineComment
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
v00.txt (text/plain), 4.57 KB, created by
Frederic Fusier
on 2006-04-27 09:50:16 EDT
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2006-04-27 09:50:16 EDT
Size:
4.57 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: dom/org/eclipse/jdt/core/dom/ASTConverter.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTConverter.java,v >retrieving revision 1.238 >diff -u -r1.238 ASTConverter.java >--- dom/org/eclipse/jdt/core/dom/ASTConverter.java 29 Mar 2006 02:54:50 -0000 1.238 >+++ dom/org/eclipse/jdt/core/dom/ASTConverter.java 27 Apr 2006 13:31:40 -0000 >@@ -3302,7 +3302,14 @@ > comment = docComment; > } else { > end = -end; >- if (positions[0]>0) { // Block comment have positive start position >+ if (positions[0] == 0) { // we cannot know without testing chars again >+ if (this.docParser.scanner.source[1] == '/') { >+ comment = new LineComment(this.ast); >+ } else { >+ comment = new BlockComment(this.ast); >+ } >+ } >+ else if (positions[0]>0) { // Block comment have positive start position > comment = new BlockComment(this.ast); > } else { // Line comment have negative start and end position > start = -start; >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest.java,v >retrieving revision 1.70 >diff -u -r1.70 ASTConverterJavadocTest.java >--- src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest.java 29 Mar 2006 04:03:06 -0000 1.70 >+++ src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest.java 27 Apr 2006 13:31:49 -0000 >@@ -114,7 +114,7 @@ > // Run test cases subset > COPY_DIR = false; > System.err.println("WARNING: only subset of tests will be executed!!!"); >- suite.addTest(new ASTConverterJavadocTest("testBug125903")); >+ suite.addTest(new ASTConverterJavadocTest("testBug130752")); > return suite; > } > >@@ -3285,4 +3285,64 @@ > assertEquals("Tag name should be empty", tag.getTagName(), "@"); > } > } >+ >+ /** >+ * @bug 130752: [comments] first BlockComment parsed as LineComment >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=130752" >+ */ >+ public void testBug130752() throws JavaModelException { >+ workingCopies = new ICompilationUnit[1]; >+ workingCopies[0] = getWorkingCopy("/Converter15/src/javadoc/b130752/Test.java", >+ "/* Ceci n'est pas\n" + >+ " * une ligne. */\n" + >+ "package javadoc.b130752;\n" + >+ "public class Test {\n" + >+ "}\n" >+ ); >+ CompilationUnit compilUnit = (CompilationUnit) runConversion(workingCopies[0], true); >+ verifyWorkingCopiesComments(); >+ if (docCommentSupport.equals(JavaCore.ENABLED)) { >+ // Verify comment type >+ List unitComments = compilUnit.getCommentList(); >+ assertEquals("Wrong number of comments", 1, unitComments.size()); >+ Comment comment = (Comment) unitComments.get(0); >+ assertEquals("Comment should be javadoc", comment.getNodeType(), ASTNode.BLOCK_COMMENT); >+ } >+ } >+ public void testBug130752b() throws JavaModelException { >+ workingCopies = new ICompilationUnit[1]; >+ workingCopies[0] = getWorkingCopy("/Converter15/src/javadoc/b130752/Test.java", >+ "// Line comment\n" + >+ "package javadoc.b130752;\n" + >+ "public class Test {\n" + >+ "}\n" >+ ); >+ CompilationUnit compilUnit = (CompilationUnit) runConversion(workingCopies[0], true); >+ verifyWorkingCopiesComments(); >+ if (docCommentSupport.equals(JavaCore.ENABLED)) { >+ // Verify comment type >+ List unitComments = compilUnit.getCommentList(); >+ assertEquals("Wrong number of comments", 1, unitComments.size()); >+ Comment comment = (Comment) unitComments.get(0); >+ assertEquals("Comment should be javadoc", comment.getNodeType(), ASTNode.LINE_COMMENT); >+ } >+ } >+ public void testBug130752c() throws JavaModelException { >+ workingCopies = new ICompilationUnit[1]; >+ workingCopies[0] = getWorkingCopy("/Converter15/src/javadoc/b130752/Test.java", >+ "/** Javadoc comment */\n" + >+ "package javadoc.b130752;\n" + >+ "public class Test {\n" + >+ "}\n" >+ ); >+ CompilationUnit compilUnit = (CompilationUnit) runConversion(workingCopies[0], true); >+ verifyWorkingCopiesComments(); >+ if (docCommentSupport.equals(JavaCore.ENABLED)) { >+ // Verify comment type >+ List unitComments = compilUnit.getCommentList(); >+ assertEquals("Wrong number of comments", 1, unitComments.size()); >+ Comment comment = (Comment) unitComments.get(0); >+ assertEquals("Comment should be javadoc", comment.getNodeType(), ASTNode.JAVADOC); >+ } >+ } > }
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 130752
: 39661