Lines 46-53
Link Here
|
46 |
} |
46 |
} |
47 |
|
47 |
|
48 |
static { |
48 |
static { |
49 |
// TESTS_NUMBERS = new int[] { 286 }; |
49 |
// TESTS_NUMBERS = new int[] { 287 }; |
50 |
// TESTS_RANGE = new int[] { 277, -1 }; |
50 |
// TESTS_RANGE = new int[] { 287, -1 }; |
51 |
// TESTS_NAMES = new String[] {"test0204"}; |
51 |
// TESTS_NAMES = new String[] {"test0204"}; |
52 |
} |
52 |
} |
53 |
public static Test suite() { |
53 |
public static Test suite() { |
Lines 6330-6359
Link Here
|
6330 |
public void test0208() throws JavaModelException { |
6330 |
public void test0208() throws JavaModelException { |
6331 |
this.workingCopy = getWorkingCopy("/Converter15/src/X.java", true/*resolve*/); |
6331 |
this.workingCopy = getWorkingCopy("/Converter15/src/X.java", true/*resolve*/); |
6332 |
String contents = |
6332 |
String contents = |
6333 |
"@Override(x= 1)\n" + |
6333 |
"/*start*/@Override(x= 1)/*end*/\n" + |
6334 |
"public class X { }"; |
6334 |
"public class X { }"; |
6335 |
ASTNode node = buildAST( |
6335 |
NormalAnnotation normalAnnotation = (NormalAnnotation) buildAST( |
6336 |
contents, |
6336 |
contents, |
6337 |
this.workingCopy, |
6337 |
this.workingCopy, |
|
|
6338 |
false, |
6339 |
true, |
6338 |
false); |
6340 |
false); |
6339 |
assertNotNull("No node", node); |
|
|
6340 |
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); |
6341 |
CompilationUnit compilationUnit = (CompilationUnit) node; |
6342 |
String problems = |
6343 |
"The annotation @Override is disallowed for this location\n" + |
6344 |
"The attribute x is undefined for the annotation type Override"; |
6345 |
assertProblemsSize(compilationUnit, 2, problems); |
6346 |
node = getASTNode(compilationUnit, 0); |
6347 |
assertEquals("Not a type declaration", ASTNode.TYPE_DECLARATION, node.getNodeType()); |
6348 |
TypeDeclaration typeDeclaration = (TypeDeclaration) node; |
6349 |
List modifiers = typeDeclaration.modifiers(); |
6350 |
assertEquals("Wrong size", 2, modifiers.size()); |
6351 |
assertTrue("Wrong type", modifiers.get(0) instanceof NormalAnnotation); |
6352 |
NormalAnnotation normalAnnotation = (NormalAnnotation) modifiers.get(0); |
6353 |
IAnnotationBinding annotationBinding = normalAnnotation.resolveAnnotationBinding(); |
6341 |
IAnnotationBinding annotationBinding = normalAnnotation.resolveAnnotationBinding(); |
6354 |
IMemberValuePairBinding[] pairs = annotationBinding.getDeclaredMemberValuePairs(); |
6342 |
IMemberValuePairBinding[] pairs = annotationBinding.getDeclaredMemberValuePairs(); |
6355 |
assertEquals("Wrong size", 1, pairs.length); |
6343 |
assertEquals("Wrong size", 0, pairs.length); |
6356 |
assertNotNull("Should not be null", pairs[0].getValue()); |
6344 |
List values = normalAnnotation.values(); |
|
|
6345 |
assertEquals("Wrong size", 1, values.size()); |
6346 |
MemberValuePair pair = (MemberValuePair) values.get(0); |
6347 |
assertNotNull("no value", pair.getValue()); |
6357 |
} |
6348 |
} |
6358 |
|
6349 |
|
6359 |
public void test0209() throws JavaModelException { |
6350 |
public void test0209() throws JavaModelException { |
Lines 9613-9616
Link Here
|
9613 |
assertTrue("Not assignmentCompatible: Integer -> int", typeBinding2.isAssignmentCompatible(typeBinding)); |
9604 |
assertTrue("Not assignmentCompatible: Integer -> int", typeBinding2.isAssignmentCompatible(typeBinding)); |
9614 |
assertTrue("Not assignmentCompatible: int -> Integer", typeBinding.isAssignmentCompatible(typeBinding2)); |
9605 |
assertTrue("Not assignmentCompatible: int -> Integer", typeBinding.isAssignmentCompatible(typeBinding2)); |
9615 |
} |
9606 |
} |
|
|
9607 |
/** |
9608 |
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=228651 |
9609 |
*/ |
9610 |
public void test0287() throws JavaModelException { |
9611 |
this.workingCopy = getWorkingCopy("/Converter15/src/test0287/A.java", true/*resolve*/); |
9612 |
MemberValuePair pair = (MemberValuePair) buildAST( |
9613 |
"package test0287;\n" + |
9614 |
"@ABC (/*start*/name1=\"\"/*end*/)\n" + |
9615 |
"public class A {}", |
9616 |
this.workingCopy, |
9617 |
false/*don't report errors*/, |
9618 |
true, |
9619 |
true); |
9620 |
IMemberValuePairBinding resolveMemberValuePairBinding = pair.resolveMemberValuePairBinding(); |
9621 |
assertNull("Got a binding", resolveMemberValuePairBinding); |
9622 |
} |
9623 |
/** |
9624 |
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=228651 |
9625 |
*/ |
9626 |
public void test0288() throws JavaModelException { |
9627 |
this.workingCopy = getWorkingCopy("/Converter15/src/test0288/A.java", true/*resolve*/); |
9628 |
MemberValuePair pair = (MemberValuePair) buildAST( |
9629 |
"package test0288;\n" + |
9630 |
"@ABC (/*start*/name1=\"\"/*end*/)\n" + |
9631 |
"public class A {}", |
9632 |
this.workingCopy, |
9633 |
false/*don't report errors*/, |
9634 |
true, |
9635 |
false); |
9636 |
IMemberValuePairBinding resolveMemberValuePairBinding = pair.resolveMemberValuePairBinding(); |
9637 |
assertNull("Got a binding", resolveMemberValuePairBinding); |
9638 |
} |
9639 |
/** |
9640 |
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=228651 |
9641 |
*/ |
9642 |
public void test0289() throws JavaModelException { |
9643 |
this.workingCopy = getWorkingCopy("/Converter15/src/test0289/A.java", true/*resolve*/); |
9644 |
NormalAnnotation annotation = (NormalAnnotation) buildAST( |
9645 |
"package test0289;\n" + |
9646 |
"/*start*/@ABC (name1=\"\")/*end*/\n" + |
9647 |
"public class A {}", |
9648 |
this.workingCopy, |
9649 |
false/*don't report errors*/, |
9650 |
true, |
9651 |
false); |
9652 |
IAnnotationBinding resolveAnnotationBinding = annotation.resolveAnnotationBinding(); |
9653 |
assertNull("No binding", resolveAnnotationBinding); |
9654 |
} |
9655 |
|
9656 |
/** |
9657 |
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=228651 |
9658 |
*/ |
9659 |
public void test0290() throws JavaModelException { |
9660 |
this.workingCopy = getWorkingCopy("/Converter15/src/test0290/A.java", true/*resolve*/); |
9661 |
NormalAnnotation annotation = (NormalAnnotation) buildAST( |
9662 |
"package test0290;\n" + |
9663 |
"/*start*/@ABC (name1=\"\")/*end*/\n" + |
9664 |
"public class A {}", |
9665 |
this.workingCopy, |
9666 |
false/*don't report errors*/, |
9667 |
true, |
9668 |
true); |
9669 |
IAnnotationBinding resolveAnnotationBinding = annotation.resolveAnnotationBinding(); |
9670 |
assertTrue("Not recovered", resolveAnnotationBinding.isRecovered()); |
9671 |
} |
9672 |
|
9673 |
/** |
9674 |
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=228651 |
9675 |
*/ |
9676 |
public void test0291() throws JavaModelException { |
9677 |
this.workingCopy = getWorkingCopy("/Converter15/src/test0291/A.java", true/*resolve*/); |
9678 |
NormalAnnotation annotation = (NormalAnnotation) buildAST( |
9679 |
"package test0291;\n" + |
9680 |
"/*start*/@ABC (name1=\"\")/*end*/\n" + |
9681 |
"public class A {}", |
9682 |
this.workingCopy, |
9683 |
false/*don't report errors*/, |
9684 |
true, |
9685 |
true); |
9686 |
IAnnotationBinding resolveAnnotationBinding = annotation.resolveAnnotationBinding(); |
9687 |
assertEquals("Wrong size", 0, resolveAnnotationBinding.getAllMemberValuePairs().length); |
9688 |
} |
9689 |
/** |
9690 |
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=228651 |
9691 |
*/ |
9692 |
public void test0292() throws JavaModelException { |
9693 |
this.workingCopy = getWorkingCopy("/Converter15/src/test0292/A.java", true/*resolve*/); |
9694 |
NormalAnnotation annotation = (NormalAnnotation) buildAST( |
9695 |
"package test0292;\n" + |
9696 |
"@interface ABC {\n" + |
9697 |
" String name1() default \"\";\n" + |
9698 |
"}\n" + |
9699 |
"/*start*/@ABC(name1=\"\", id=0)/*end*/\n" + |
9700 |
"public class A {}", |
9701 |
this.workingCopy, |
9702 |
false/*don't report errors*/, |
9703 |
true, |
9704 |
true); |
9705 |
IAnnotationBinding resolveAnnotationBinding = annotation.resolveAnnotationBinding(); |
9706 |
assertFalse("Recovered", resolveAnnotationBinding.isRecovered()); |
9707 |
} |
9708 |
/** |
9709 |
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=228651 |
9710 |
*/ |
9711 |
public void test0293() throws JavaModelException { |
9712 |
this.workingCopy = getWorkingCopy("/Converter15/src/test0293/A.java", true/*resolve*/); |
9713 |
NormalAnnotation annotation = (NormalAnnotation) buildAST( |
9714 |
"package test0293;\n" + |
9715 |
"@interface ABC {\n" + |
9716 |
" String name1() default \"\";\n" + |
9717 |
"}\n" + |
9718 |
"/*start*/@ABC(name1=\"\", id=0)/*end*/\n" + |
9719 |
"public class A {}", |
9720 |
this.workingCopy, |
9721 |
false/*don't report errors*/, |
9722 |
true, |
9723 |
true); |
9724 |
IAnnotationBinding resolveAnnotationBinding = annotation.resolveAnnotationBinding(); |
9725 |
assertEquals("Wrong size", 1, resolveAnnotationBinding.getAllMemberValuePairs().length); |
9726 |
} |
9727 |
/** |
9728 |
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=228651 |
9729 |
*/ |
9730 |
public void test0294() throws JavaModelException { |
9731 |
this.workingCopy = getWorkingCopy("/Converter15/src/test0294/A.java", true/*resolve*/); |
9732 |
NormalAnnotation annotation = (NormalAnnotation) buildAST( |
9733 |
"package test0294;\n" + |
9734 |
"@interface ABC {\n" + |
9735 |
" String name1() default \"\";\n" + |
9736 |
"}\n" + |
9737 |
"/*start*/@ABC(name1=\"\", id=0)/*end*/\n" + |
9738 |
"public class A {}", |
9739 |
this.workingCopy, |
9740 |
false/*don't report errors*/, |
9741 |
true, |
9742 |
true); |
9743 |
IAnnotationBinding resolveAnnotationBinding = annotation.resolveAnnotationBinding(); |
9744 |
assertEquals("Wrong size", 1, resolveAnnotationBinding.getDeclaredMemberValuePairs().length); |
9745 |
} |
9746 |
/** |
9747 |
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=228651 |
9748 |
*/ |
9749 |
public void test0295() throws JavaModelException { |
9750 |
this.workingCopy = getWorkingCopy("/Converter15/src/test0295/A.java", true/*resolve*/); |
9751 |
NormalAnnotation annotation = (NormalAnnotation) buildAST( |
9752 |
"package test0295;\n" + |
9753 |
"@interface ABC {\n" + |
9754 |
" String name1() default \"\";\n" + |
9755 |
"}\n" + |
9756 |
"/*start*/@ABC(id=0)/*end*/\n" + |
9757 |
"public class A {}", |
9758 |
this.workingCopy, |
9759 |
false/*don't report errors*/, |
9760 |
true, |
9761 |
true); |
9762 |
IAnnotationBinding resolveAnnotationBinding = annotation.resolveAnnotationBinding(); |
9763 |
assertEquals("Wrong size", 1, resolveAnnotationBinding.getAllMemberValuePairs().length); |
9764 |
} |
9765 |
/** |
9766 |
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=228651 |
9767 |
*/ |
9768 |
public void test0296() throws JavaModelException { |
9769 |
this.workingCopy = getWorkingCopy("/Converter15/src/test0296/A.java", true/*resolve*/); |
9770 |
NormalAnnotation annotation = (NormalAnnotation) buildAST( |
9771 |
"package test0296;\n" + |
9772 |
"@interface ABC {\n" + |
9773 |
" String name1() default \"\";\n" + |
9774 |
"}\n" + |
9775 |
"/*start*/@ABC(id=0)/*end*/\n" + |
9776 |
"public class A {}", |
9777 |
this.workingCopy, |
9778 |
false/*don't report errors*/, |
9779 |
true, |
9780 |
false); |
9781 |
IAnnotationBinding resolveAnnotationBinding = annotation.resolveAnnotationBinding(); |
9782 |
assertEquals("Wrong size", 1, resolveAnnotationBinding.getAllMemberValuePairs().length); |
9783 |
} |
9784 |
/** |
9785 |
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=228651 |
9786 |
*/ |
9787 |
public void test0297() throws JavaModelException { |
9788 |
this.workingCopy = getWorkingCopy("/Converter15/src/test0297/A.java", true/*resolve*/); |
9789 |
NormalAnnotation annotation = (NormalAnnotation) buildAST( |
9790 |
"package test0297;\n" + |
9791 |
"@interface ABC {\n" + |
9792 |
" String name1() default \"\";\n" + |
9793 |
"}\n" + |
9794 |
"/*start*/@ABC(name1=\"\", id=0)/*end*/\n" + |
9795 |
"public class A {}", |
9796 |
this.workingCopy, |
9797 |
false/*don't report errors*/, |
9798 |
true, |
9799 |
false); |
9800 |
IAnnotationBinding resolveAnnotationBinding = annotation.resolveAnnotationBinding(); |
9801 |
assertEquals("Wrong size", 1, resolveAnnotationBinding.getDeclaredMemberValuePairs().length); |
9802 |
} |
9616 |
} |
9803 |
} |