Lines 47-53
Link Here
|
47 |
} |
47 |
} |
48 |
|
48 |
|
49 |
static { |
49 |
static { |
50 |
// TESTS_NUMBERS = new int[] { 341 }; |
50 |
// TESTS_NUMBERS = new int[] { 342, 343 }; |
51 |
// TESTS_RANGE = new int[] { 325, -1 }; |
51 |
// TESTS_RANGE = new int[] { 325, -1 }; |
52 |
// TESTS_NAMES = new String[] {"test0204"}; |
52 |
// TESTS_NAMES = new String[] {"test0204"}; |
53 |
} |
53 |
} |
Lines 10936-10939
Link Here
|
10936 |
IMethodBinding methodBinding2 = ((MethodInvocation) ((ExpressionStatement) methodDeclaration.getBody().statements().get(1)).getExpression()).resolveMethodBinding(); |
10936 |
IMethodBinding methodBinding2 = ((MethodInvocation) ((ExpressionStatement) methodDeclaration.getBody().statements().get(1)).getExpression()).resolveMethodBinding(); |
10937 |
assertTrue("Bindings differ", methodBinding1 == methodBinding2); |
10937 |
assertTrue("Bindings differ", methodBinding1 == methodBinding2); |
10938 |
} |
10938 |
} |
|
|
10939 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=304122 |
10940 |
public void test342() throws JavaModelException { |
10941 |
String contents = |
10942 |
"@Deprecated\n" + |
10943 |
"public class X<T> {\n" + |
10944 |
" X<String> field;\n" + |
10945 |
"}"; |
10946 |
this.workingCopy = getWorkingCopy("/Converter15/src/X.java", true/*resolve*/); |
10947 |
CompilationUnit unit= (CompilationUnit) buildAST( |
10948 |
contents, |
10949 |
this.workingCopy, |
10950 |
true, |
10951 |
true, |
10952 |
true); |
10953 |
TypeDeclaration typeDeclaration = (TypeDeclaration) getASTNode(unit, 0); |
10954 |
ITypeBinding binding = typeDeclaration.resolveBinding(); |
10955 |
IAnnotationBinding[] annotations = binding.getAnnotations(); |
10956 |
assertEquals("Wrong size", 1, annotations.length); |
10957 |
FieldDeclaration fieldDeclaration = (FieldDeclaration) getASTNode(unit, 0, 0); |
10958 |
binding = fieldDeclaration.getType().resolveBinding(); |
10959 |
annotations = binding.getAnnotations(); |
10960 |
assertEquals("Wrong size", 0, annotations.length); |
10961 |
} |
10962 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=304122 |
10963 |
public void test343() throws JavaModelException { |
10964 |
String contents = |
10965 |
"public class X {\n" + |
10966 |
" @Deprecated\n" + |
10967 |
" <T> Object foo(T t) {\n" + |
10968 |
" return t;\n" + |
10969 |
" }\n" + |
10970 |
" public static Object bar() {\n" + |
10971 |
" return new X().<String>foo(\"Hello\");\n" + |
10972 |
" }\n" + |
10973 |
"}"; |
10974 |
this.workingCopy = getWorkingCopy("/Converter15/src/X.java", true/*resolve*/); |
10975 |
CompilationUnit unit= (CompilationUnit) buildAST( |
10976 |
contents, |
10977 |
this.workingCopy, |
10978 |
true, |
10979 |
true, |
10980 |
true); |
10981 |
MethodDeclaration methodDeclaration = (MethodDeclaration) getASTNode(unit, 0, 0); |
10982 |
IMethodBinding binding = methodDeclaration.resolveBinding(); |
10983 |
IAnnotationBinding[] annotations = binding.getAnnotations(); |
10984 |
assertEquals("Wrong size", 1, annotations.length); |
10985 |
methodDeclaration = (MethodDeclaration) getASTNode(unit, 0, 1); |
10986 |
ReturnStatement statement = (ReturnStatement) methodDeclaration.getBody().statements().get(0); |
10987 |
MethodInvocation expression = (MethodInvocation) statement.getExpression(); |
10988 |
binding = expression.resolveMethodBinding(); |
10989 |
annotations = binding.getAnnotations(); |
10990 |
assertEquals("Wrong size", 0, annotations.length); |
10991 |
binding = binding.getMethodDeclaration(); |
10992 |
annotations = binding.getAnnotations(); |
10993 |
assertEquals("Wrong size", 1, annotations.length); |
10994 |
} |
10939 |
} |
10995 |
} |