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 23091 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]
Corresponding regression test
patch_100041_tests.txt (text/plain), 3.30 KB, created by
Olivier Thomann
on 2005-06-14 14:52:30 EDT
(
hide
)
Description:
Corresponding regression test
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2005-06-14 14:52:30 EDT
Size:
3.30 KB
patch
obsolete
>Index: src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java,v >retrieving revision 1.56 >diff -u -r1.56 ASTConverterTestAST3_2.java >--- src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java 3 Jun 2005 00:59:55 -0000 1.56 >+++ src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java 14 Jun 2005 18:46:13 -0000 >@@ -70,6 +70,7 @@ > import org.eclipse.jdt.core.dom.NullLiteral; > import org.eclipse.jdt.core.dom.PackageDeclaration; > import org.eclipse.jdt.core.dom.ParenthesizedExpression; >+import org.eclipse.jdt.core.dom.PrimitiveType; > import org.eclipse.jdt.core.dom.QualifiedName; > import org.eclipse.jdt.core.dom.ReturnStatement; > import org.eclipse.jdt.core.dom.SimpleName; >@@ -105,7 +106,7 @@ > > static { > // TESTS_NAMES = new String[] {"test0602"}; >-// TESTS_NUMBERS = new int[] { 611 }; >+// TESTS_NUMBERS = new int[] { 613 }; > } > public static Test suite() { > return buildTestSuite(ASTConverterTestAST3_2.class); >@@ -6493,4 +6494,57 @@ > workingCopy.discardWorkingCopy(); > } > } >+ >+ /* >+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=99982 >+ */ >+ public void test0613() throws JavaModelException { >+ ICompilationUnit workingCopy = null; >+ try { >+ String contents = >+ "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" + >+ "}"; >+ workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/); >+ ASTNode node = buildAST( >+ contents, >+ workingCopy); >+ assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); >+ CompilationUnit unit = (CompilationUnit) node; >+ assertProblemsSize(unit, 0); >+ node = getASTNode(unit, 0, 1, 0); >+ assertNotNull("No node", node); >+ assertEquals("Not an if statement", ASTNode.IF_STATEMENT, node.getNodeType()); >+ IfStatement ifStatement = (IfStatement) node; >+ String expectedSource = "if (object instanceof String) {\n" + >+ " final String clr = null;\n" + >+ " }"; >+ checkSourceRange(ifStatement, expectedSource, contents); >+ Statement statement = ifStatement.getThenStatement(); >+ assertNotNull("No then statement", statement); >+ assertEquals("not a block", ASTNode.BLOCK, statement.getNodeType()); >+ Block block = (Block) statement; >+ expectedSource = "{\n" + >+ " final String clr = null;\n" + >+ " }"; >+ checkSourceRange(block, expectedSource, contents); >+ List statements = block.statements(); >+ assertEquals("Wrong size", 1, statements.size()); >+ Statement statement2 = (Statement) statements.get(0); >+ assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, statement2.getNodeType()); >+ VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) statement2; >+ checkSourceRange(variableDeclarationStatement, "final String clr = null;", contents); >+ } finally { >+ if (workingCopy != null) >+ workingCopy.discardWorkingCopy(); >+ } >+ } > }
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