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 34948 Details for
Bug 128077
AST - instanceof - getLength returns wrong length
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Regression test
patch_128077_test.txt (text/plain), 2.30 KB, created by
Olivier Thomann
on 2006-02-17 16:23:26 EST
(
hide
)
Description:
Regression test
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2006-02-17 16:23:26 EST
Size:
2.30 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java,v >retrieving revision 1.188 >diff -u -r1.188 ASTConverter15Test.java >--- src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java 9 Feb 2006 18:38:53 -0000 1.188 >+++ src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java 17 Feb 2006 21:24:26 -0000 >@@ -46,7 +46,7 @@ > } > > static { >-// TESTS_NUMBERS = new int[] { 209 }; >+// TESTS_NUMBERS = new int[] { 210 }; > // TESTS_NAMES = new String[] {"test0204"}; > } > public static Test suite() { >@@ -6358,5 +6358,35 @@ > IBinding binding = simpleName.resolveBinding(); > assertNotNull("No binding", binding); > assertEquals("Wrong type", IBinding.PACKAGE, binding.getKind()); >- } >+ } >+ public void test0210() throws JavaModelException { >+ this.workingCopy = getWorkingCopy("/Converter15/src/X.java", false); >+ String contents = >+ "public class X {\n" + >+ " void foo(Object r) {\n" + >+ " if (r instanceof Future<?>) {\n" + >+ " System.out.println(\"TRUE\");\n" + >+ " } else {\n" + >+ " System.out.println(\"FALSE\");\n" + >+ " }\n" + >+ " }\n" + >+ "}"; >+ ASTNode node = buildAST( >+ contents, >+ this.workingCopy, >+ false); >+ assertNotNull("No node", node); >+ assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); >+ CompilationUnit compilationUnit = (CompilationUnit) node; >+ assertProblemsSize(compilationUnit, 0); >+ node = getASTNode(compilationUnit, 0, 0, 0); >+ assertEquals("Not an if statement", ASTNode.IF_STATEMENT, node.getNodeType()); >+ IfStatement ifStatement = (IfStatement) node; >+ Expression expression = ifStatement.getExpression(); >+ checkSourceRange(expression, "r instanceof Future<?>", contents); >+ assertEquals("Not an instanceof expression", ASTNode.INSTANCEOF_EXPRESSION, expression.getNodeType()); >+ InstanceofExpression instanceofExpression = (InstanceofExpression) expression; >+ Type type = instanceofExpression.getRightOperand(); >+ checkSourceRange(type, "Future<?>", contents); >+ } > } >\ No newline at end of file
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 128077
:
34947
| 34948