Community
Participate
Working Groups
(M6) The following code fragment IMethod varargMethod = cu1.getTypes()[0].createMethod("void operation1 (String... str) {}", null, true, NullMonitor.getSharedInstance()); cu1.reconcile(); IMethod foundMethods = cu1.getTypes()[0].findMethods(varargMethod); fails (foundMethods == null) because findMethods supplies Member#areSimilarMethods with params1 containing "QString;" and params2 containing "[QString;", and this inconsistency leads to the method not being found.
Changed CreateMethodOperation to add 1 to the array dimension of the parameter type if it is a varargs method and this is the last parameter. Added regression test CreateMemberTests#test004()
Verified for 3.1 M7 using build I20050509-2010 + jdt.core HEAD.