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 25612 Details for
Bug 100041
[javadoc][dom] Wrong positions when javadoc comment inside method declaration
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
New test cases added to ASTConverterJavadocTest
v01-model.txt (text/plain), 6.23 KB, created by
Frederic Fusier
on 2005-08-03 08:51:39 EDT
(
hide
)
Description:
New test cases added to ASTConverterJavadocTest
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2005-08-03 08:51:39 EDT
Size:
6.23 KB
patch
obsolete
>Index: src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest.java,v >retrieving revision 1.62 >diff -u -r1.62 ASTConverterJavadocTest.java >--- src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest.java 14 Jun 2005 08:11:20 -0000 1.62 >+++ src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest.java 3 Aug 2005 11:36:05 -0000 >@@ -113,16 +113,7 @@ > // Run test cases subset > COPY_DIR = false; > System.err.println("WARNING: only subset of tests will be executed!!!"); >- suite.addTest(new ASTConverterJavadocTest("testBug93880_15a")); >- suite.addTest(new ASTConverterJavadocTest("testBug93880_15b")); >- suite.addTest(new ASTConverterJavadocTest("testBug93880_15c")); >- suite.addTest(new ASTConverterJavadocTest("testBug93880_15d")); >- suite.addTest(new ASTConverterJavadocTest("testBug93880_15e")); >- suite.addTest(new ASTConverterJavadocTest("testBug93880_14a")); >- suite.addTest(new ASTConverterJavadocTest("testBug93880_14b")); >- suite.addTest(new ASTConverterJavadocTest("testBug93880_14c")); >- suite.addTest(new ASTConverterJavadocTest("testBug93880_14d")); >- suite.addTest(new ASTConverterJavadocTest("testBug93880_14e")); >+ suite.addTest(new ASTConverterJavadocTest("testBug100041")); > return suite; > } > >@@ -2822,5 +2813,121 @@ > parser.setSource(source.toCharArray()); > parser.createAST(null); > } >- >+ >+ /** >+ * Bug 100041: [javadoc] Infinit loop in DocCommentParser >+ * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=100041" >+ */ >+ public void testBug100041() throws JavaModelException { >+ workingCopies = new ICompilationUnit[1]; >+ workingCopies[0] = getWorkingCopy("/Converter15/src/javadoc/b100041/X.java", >+ "package javadoc.b100041;\n" + >+ "class X {\n" + >+ " static Object object;\n" + >+ " static void foo() {\n" + >+ " /**\n" + >+ " * javadoc comment.\n" + >+ " */\n" + >+ " if (object instanceof String) {\n" + >+ " final String clr = null;\n" + >+ " }\n" + >+ " }\n" + >+ "}" >+ ); >+ CompilationUnit compilUnit = verifyComments(workingCopies[0]); >+ if (docCommentSupport.equals(JavaCore.ENABLED)) { >+ // Get comment >+ List unitComments = compilUnit.getCommentList(); >+ assertEquals("Wrong number of comments", 1, unitComments.size()); >+ Comment comment = (Comment) unitComments.get(0); >+ int commentStart = comment.getStartPosition(); >+ int commentEnd = commentStart+comment.getLength(); >+ >+ // Get local variable declaration >+ ASTNode node = getASTNode(compilUnit, 0, 1, 0); >+ assertEquals("Expected if statement for node: "+node, ASTNode.IF_STATEMENT, node.getNodeType()); >+ IfStatement ifStatement = (IfStatement) node; >+ assertTrue("Invalid start position for IfStatement: "+ifStatement, ifStatement.getStartPosition() > commentEnd); >+ Statement statement = ifStatement.getThenStatement(); >+ assertEquals("Expected block for node: "+statement, ASTNode.BLOCK, statement.getNodeType()); >+ Block block = (Block) statement; >+ assertTrue("Invalid start position for Block: "+block, block.getStartPosition() > commentEnd); >+ List statements = block.statements(); >+ assertEquals("Invalid number of statements for block: "+block, 1, statements.size()); >+ statement = (Statement) statements.get(0); >+ assertEquals("Expected variable declaration statement for node: "+statement, ASTNode.VARIABLE_DECLARATION_STATEMENT, statement.getNodeType()); >+ VariableDeclarationStatement varDecl = (VariableDeclarationStatement) statement; >+ assertTrue("Invalid start position for : VariableDeclarationStatement"+varDecl, varDecl.getStartPosition() > commentEnd); >+ } >+ } >+ public void testBug100041b() throws JavaModelException { >+ workingCopies = new ICompilationUnit[1]; >+ workingCopies[0] = getWorkingCopy("/Converter15/src/javadoc/b100041/X.java", >+ "package javadoc.b100041;\n" + >+ "class X {\n" + >+ " static Object object;\n" + >+ " static void foo() {\n" + >+ " /**\n" + >+ " * javadoc comment.\n" + >+ " */\n" + >+ " if (object instanceof String)\n" + >+ " return;\n" + >+ " }\n" + >+ "}" >+ ); >+ CompilationUnit compilUnit = verifyComments(workingCopies[0]); >+ if (docCommentSupport.equals(JavaCore.ENABLED)) { >+ // Get comment >+ List unitComments = compilUnit.getCommentList(); >+ assertEquals("Wrong number of comments", 1, unitComments.size()); >+ Comment comment = (Comment) unitComments.get(0); >+ int commentStart = comment.getStartPosition(); >+ int commentEnd = commentStart+comment.getLength(); >+ >+ // Get local variable declaration >+ ASTNode node = getASTNode(compilUnit, 0, 1, 0); >+ assertEquals("Expected if statement for node: "+node, ASTNode.IF_STATEMENT, node.getNodeType()); >+ IfStatement ifStatement = (IfStatement) node; >+ assertTrue("Invalid start position for IfStatement: "+ifStatement, ifStatement.getStartPosition() > commentEnd); >+ Statement statement = ifStatement.getThenStatement(); >+ assertEquals("Expected block for node: "+statement, ASTNode.RETURN_STATEMENT, statement.getNodeType()); >+ ReturnStatement returnStatement = (ReturnStatement) statement; >+ assertTrue("Invalid start position for Block: "+returnStatement, returnStatement.getStartPosition() > commentEnd); >+ } >+ } >+ public void testBug100041c() throws JavaModelException { >+ workingCopies = new ICompilationUnit[1]; >+ workingCopies[0] = getWorkingCopy("/Converter15/src/javadoc/b100041/Z.java", >+ "package javadoc.b100041;\n" + >+ "public class Z {\n" + >+ " /**\n" + >+ " * Z1\n" + >+ " */\n" + >+ " class Z1 {}\n" + >+ " /**\n" + >+ " * z1\n" + >+ " */\n" + >+ " Z1 z1;\n" + >+ " /**\n" + >+ " * @param object\n" + >+ " */\n" + >+ " public static void foo(Object object) {\n" + >+ " /**\n" + >+ " * Comment 1\n" + >+ " */\n" + >+ " class ZZ {\n" + >+ " /**\n" + >+ " * Comment 3\n" + >+ " */\n" + >+ " ZZ zz;\n" + >+ " /**\n" + >+ " * Comment 2\n" + >+ " */\n" + >+ " public void bar() {}\n" + >+ " }\n" + >+ " }\n" + >+ "}\n" >+ ); >+ verifyComments(workingCopies[0]); >+ } > }
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 100041
:
23090
|
23091
|
25611
|
25612
|
25613