Bug 93487

Summary: IType#findMethods fails on vararg methods
Product: [Eclipse Project] JDT Reporter: Alexander Pavlov <Alexander.Pavlov>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M7   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Alexander Pavlov CLA 2005-05-03 04:05:15 EDT
(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.
Comment 1 Jerome Lanneluc CLA 2005-05-03 10:09:08 EDT
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()
Comment 2 Frederic Fusier CLA 2005-05-12 10:06:50 EDT
Verified for 3.1 M7 using build I20050509-2010 + jdt.core HEAD.