Lines 310-315
Link Here
|
310 |
} |
310 |
} |
311 |
|
311 |
|
312 |
/* |
312 |
/* |
|
|
313 |
* Ensures that the IJavaElement of an IBinding representing an annotation on an annotation type is correct. |
314 |
* (regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=249844 ) |
315 |
*/ |
316 |
public void testAnnotation6() throws JavaModelException { |
317 |
ASTNode node = buildAST( |
318 |
"/*start*/@MyAnnot/*end*/\n" + |
319 |
"public @interface X {\n" + |
320 |
"}\n" + |
321 |
"@interface MyAnnot {\n" + |
322 |
"}" |
323 |
); |
324 |
IBinding binding = ((Annotation) node).resolveAnnotationBinding(); |
325 |
IJavaElement element = binding.getJavaElement(); |
326 |
assertElementEquals( |
327 |
"Unexpected Java element", |
328 |
"@MyAnnot [in X [in [Working copy] X.java [in <default> [in src [in P]]]]]", |
329 |
element |
330 |
); |
331 |
} |
332 |
|
333 |
/* |
334 |
* Ensures that the IJavaElement of an IBinding representing an annotation on an enum type is correct. |
335 |
* (regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=249844 ) |
336 |
*/ |
337 |
public void testAnnotation7() throws JavaModelException { |
338 |
ASTNode node = buildAST( |
339 |
"/*start*/@MyAnnot/*end*/\n" + |
340 |
"public enum X {\n" + |
341 |
"}\n" + |
342 |
"@interface MyAnnot {\n" + |
343 |
"}" |
344 |
); |
345 |
IBinding binding = ((Annotation) node).resolveAnnotationBinding(); |
346 |
IJavaElement element = binding.getJavaElement(); |
347 |
assertElementEquals( |
348 |
"Unexpected Java element", |
349 |
"@MyAnnot [in X [in [Working copy] X.java [in <default> [in src [in P]]]]]", |
350 |
element |
351 |
); |
352 |
} |
353 |
|
354 |
/* |
313 |
* Ensures that the IJavaElement of an IBinding representing an anonymous type is correct. |
355 |
* Ensures that the IJavaElement of an IBinding representing an anonymous type is correct. |
314 |
*/ |
356 |
*/ |
315 |
public void testAnonymousType() throws JavaModelException { |
357 |
public void testAnonymousType() throws JavaModelException { |