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 31748 Details for
Bug 120263
[compiler] missing binding on array initializer
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Regression test
patch_120263.txt (text/plain), 2.71 KB, created by
Olivier Thomann
on 2005-12-14 11:52:28 EST
(
hide
)
Description:
Regression test
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2005-12-14 11:52:28 EST
Size:
2.71 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.178 >diff -u -r1.178 ASTConverter15Test.java >--- src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java 8 Dec 2005 11:45:19 -0000 1.178 >+++ src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java 14 Dec 2005 16:52:54 -0000 >@@ -6199,5 +6199,44 @@ > IBinding[] bindings = resolveBindings(contents, this.workingCopy); > assertFalse("Declaration and reference keys should not be the same", bindings[0].getKey().equals(bindings[1].getKey())); > } >+ >+ /* >+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=120263 >+ */ >+ public void test0206() throws JavaModelException { >+ this.workingCopy = getWorkingCopy("/Converter15/src/X.java", true/*resolve*/); >+ String contents = >+ "public class X {\n" + >+ " public @interface Annot {\n" + >+ " }\n" + >+ " @Annot(newAttrib= {1, 2})\n" + >+ " public void foo() {\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, 1, "The attribute newAttrib is undefined for the annotation type X.Annot"); >+ node = getASTNode(compilationUnit, 0, 1); >+ assertEquals("Not a method declaration", ASTNode.METHOD_DECLARATION, node.getNodeType()); >+ MethodDeclaration methodDeclaration = (MethodDeclaration) node; >+ List modifiers = methodDeclaration.modifiers(); >+ assertEquals("Wrong size", 2, modifiers.size()); >+ IExtendedModifier extendedModifier = (IExtendedModifier) modifiers.get(0); >+ assertTrue("Not a normal annotation", extendedModifier instanceof NormalAnnotation); >+ NormalAnnotation annotation = (NormalAnnotation) extendedModifier; >+ List values = annotation.values(); >+ assertEquals("Wrong size", 1, values.size()); >+ MemberValuePair memberValuePair = (MemberValuePair) values.get(0); >+ Expression value = memberValuePair.getValue(); >+ assertEquals("Not an array initializer", ASTNode.ARRAY_INITIALIZER, value.getNodeType()); >+ ArrayInitializer arrayInitializer = (ArrayInitializer) value; >+ ITypeBinding typeBinding = arrayInitializer.resolveTypeBinding(); >+ assertNotNull("No binding", typeBinding); >+ } > > } >\ 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 120263
: 31748