Lines 1225-1230
Link Here
|
1225 |
} |
1225 |
} |
1226 |
|
1226 |
|
1227 |
/* |
1227 |
/* |
|
|
1228 |
* Ensures that no ClassCastException is thrown if the method is in an anonymous |
1229 |
* which is inside the initializer of another anonymous. |
1230 |
* (regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=208013) |
1231 |
*/ |
1232 |
public void testMethod11() throws JavaModelException { |
1233 |
ASTNode node = buildAST( |
1234 |
"public class X {\n" + |
1235 |
" public void foo() {\n" + |
1236 |
" new Object() {\n" + |
1237 |
" Object o;\n" + |
1238 |
" {\n"+ |
1239 |
" new Object() {\n" + |
1240 |
" /*start*/void bar() {\n" + |
1241 |
" }/*end*/\n" + |
1242 |
" };\n" + |
1243 |
" }\n" + |
1244 |
" };\n"+ |
1245 |
" }\n" + |
1246 |
"}" |
1247 |
); |
1248 |
IBinding binding = ((MethodDeclaration) node).resolveBinding(); |
1249 |
IJavaElement element = binding.getJavaElement(); |
1250 |
assertElementEquals( |
1251 |
"Unexpected Java element", |
1252 |
"bar() [in <anonymous #1> [in foo() [in X [in [Working copy] X.java [in <default> [in src [in P]]]]]]]", |
1253 |
element |
1254 |
); |
1255 |
} |
1256 |
/* |
1228 |
* Ensures that the IJavaElement of an IBinding representing a package is correct. |
1257 |
* Ensures that the IJavaElement of an IBinding representing a package is correct. |
1229 |
*/ |
1258 |
*/ |
1230 |
public void testPackage1() throws CoreException { |
1259 |
public void testPackage1() throws CoreException { |