Bug 93487 - IType#findMethods fails on vararg methods
Summary: IType#findMethods fails on vararg methods
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M7   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-03 04:05 EDT by Alexander Pavlov CLA
Modified: 2005-05-12 10:06 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.