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 25068 Details for
Bug 104492
[AST]java.lang.ClassCastException: org.eclipse.jdt.core.dom.PrimitiveType
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Regression test
patch_104492_tests.txt (text/plain), 3.57 KB, created by
Olivier Thomann
on 2005-07-20 14:03:50 EDT
(
hide
)
Description:
Regression test
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2005-07-20 14:03:50 EDT
Size:
3.57 KB
patch
obsolete
>Index: src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java,v >retrieving revision 1.167 >diff -u -r1.167 ASTConverter15Test.java >--- src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java 7 Jul 2005 10:42:53 -0000 1.167 >+++ src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java 20 Jul 2005 18:02:01 -0000 >@@ -39,7 +39,7 @@ > } > > static { >-// TESTS_NUMBERS = new int[] { 192 }; >+// TESTS_NUMBERS = new int[] { 194 }; > // TESTS_NAMES = new String[] {"test0189"}; > } > public static Test suite() { >@@ -5785,4 +5785,58 @@ > assertTrue("should yield a null, not a malformed binding", > bindings[0] == null); > } >+ >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=104492 >+ public void test0193() throws JavaModelException { >+ this.workingCopy = getWorkingCopy("/Converter15/src/X.java", true/*resolve*/); >+ String contents = >+ "public class X {\n" + >+ " public static void main(String[] args) {\n" + >+ " byte[] b1 = new byte[0];\n" + >+ " byte[] b2 = new byte[0];\n" + >+ " for (byte[] bs : new byte[][] { b1, b2 }) {}\n" + >+ " }\n" + >+ "}"; >+ ASTNode node = buildAST( >+ contents, >+ this.workingCopy); >+ assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); >+ CompilationUnit unit = (CompilationUnit) node; >+ node = getASTNode(unit, 0, 0, 2); >+ assertEquals("Not an enhanced for statement", ASTNode.ENHANCED_FOR_STATEMENT, node.getNodeType()); >+ EnhancedForStatement forStatement = (EnhancedForStatement) node; >+ SingleVariableDeclaration singleVariableDeclaration = forStatement.getParameter(); >+ assertEquals("Should be 0", 0, singleVariableDeclaration.getExtraDimensions()); >+ Type type = singleVariableDeclaration.getType(); >+ assertEquals("Not an array type", ASTNode.ARRAY_TYPE, type.getNodeType()); >+ ArrayType arrayType = (ArrayType) type; >+ assertEquals("Should be 1", 1, arrayType.getDimensions()); >+ } >+ >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=104492 >+ public void test0194() throws JavaModelException { >+ this.workingCopy = getWorkingCopy("/Converter15/src/X.java", true/*resolve*/); >+ String contents = >+ "public class X {\n" + >+ " public static void main(String[] args) {\n" + >+ " byte[] b1 = new byte[0];\n" + >+ " byte[] b2 = new byte[0];\n" + >+ " for (byte[] bs/*comment*/ [ /*comment*/ ]: new byte[][][] { new byte[][] { b1, b2 }}) {}\n" + >+ " }\n" + >+ "}"; >+ ASTNode node = buildAST( >+ contents, >+ this.workingCopy); >+ assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); >+ CompilationUnit unit = (CompilationUnit) node; >+ node = getASTNode(unit, 0, 0, 2); >+ assertEquals("Not an enhanced for statement", ASTNode.ENHANCED_FOR_STATEMENT, node.getNodeType()); >+ EnhancedForStatement forStatement = (EnhancedForStatement) node; >+ SingleVariableDeclaration singleVariableDeclaration = forStatement.getParameter(); >+ assertEquals("Should be 1", 1, singleVariableDeclaration.getExtraDimensions()); >+ Type type = singleVariableDeclaration.getType(); >+ assertEquals("Not an array type", ASTNode.ARRAY_TYPE, type.getNodeType()); >+ ArrayType arrayType = (ArrayType) type; >+ assertEquals("Should be 1", 1, arrayType.getDimensions()); >+ } > } >\ 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 104492
:
25040
|
25067
| 25068