Lines 53-58
Link Here
|
53 |
" }\n" + |
53 |
" }\n" + |
54 |
" void testIsVarArgs(String s, Object ... args) {\n" + |
54 |
" void testIsVarArgs(String s, Object ... args) {\n" + |
55 |
" }\n" + |
55 |
" }\n" + |
|
|
56 |
" X(String... s) {\n" + |
57 |
" }\n" + |
56 |
"}\n" + |
58 |
"}\n" + |
57 |
"/** @deprecated\n */" + |
59 |
"/** @deprecated\n */" + |
58 |
"interface I {\n" + |
60 |
"interface I {\n" + |
Lines 316-322
Link Here
|
316 |
IMethod method = type.getMethod("testIsVarArgs", new String[]{"QString;", "[QObject;"}); |
318 |
IMethod method = type.getMethod("testIsVarArgs", new String[]{"QString;", "[QObject;"}); |
317 |
assertTrue("Should have the AccVarargs flag set", Flags.isVarargs(method.getFlags())); |
319 |
assertTrue("Should have the AccVarargs flag set", Flags.isVarargs(method.getFlags())); |
318 |
} |
320 |
} |
319 |
|
321 |
/** |
|
|
322 |
* Ensures that a constructor has the correct AccVarargs flag set. |
323 |
* (regression test for bug 77422 [1.5] ArrayIndexOutOfBoundsException with vararg constructor of generic superclass) |
324 |
*/ |
325 |
public void testGetMethod3() throws JavaModelException { |
326 |
IType type = this.cu.getType("X"); |
327 |
IMethod method = type.getMethod("X", new String[]{"[QString;"}); |
328 |
assertTrue("Should have the AccVarargs flag set", Flags.isVarargs(method.getFlags())); |
329 |
} |
320 |
/** |
330 |
/** |
321 |
* Ensures that correct number of methods with the correct names and modifiers |
331 |
* Ensures that correct number of methods with the correct names and modifiers |
322 |
* exist in a type. |
332 |
* exist in a type. |
Lines 324-331
Link Here
|
324 |
public void testGetMethods() throws JavaModelException { |
334 |
public void testGetMethods() throws JavaModelException { |
325 |
IType type = this.cu.getType("X"); |
335 |
IType type = this.cu.getType("X"); |
326 |
IMethod[] methods= type.getMethods(); |
336 |
IMethod[] methods= type.getMethods(); |
327 |
String[] methodNames = new String[] {"foo", "bar", "fred", "testIsVarArgs"}; |
337 |
String[] methodNames = new String[] {"foo", "bar", "fred", "testIsVarArgs", "X"}; |
328 |
String[] flags = new String[] {"public", "protected static", "private", ""}; |
338 |
String[] flags = new String[] {"public", "protected static", "private", "", ""}; |
329 |
assertEquals("Wrong number of methods returned", methodNames.length, methods.length); |
339 |
assertEquals("Wrong number of methods returned", methodNames.length, methods.length); |
330 |
for (int i = 0; i < methods.length; i++) { |
340 |
for (int i = 0; i < methods.length; i++) { |
331 |
assertEquals("Incorrect name for the " + i + " method", methodNames[i], methods[i].getElementName()); |
341 |
assertEquals("Incorrect name for the " + i + " method", methodNames[i], methods[i].getElementName()); |