Consider the following interfaces:
interface A
{
public void Test(int value);
}
interface B
{
public void Test(int value);
}
when a class inherits from both
class AB implements A,B
{
public void Test(int value)
{
}
}
the mockmaker will create a Mockobject with 2 identical
methods and therefore not compile.
Ok people could argue that this is some kind of bad
design but I have the problem when using a public API
that I have to implement.
To avoid the problem i put the following code in
ReflectionClassStructure.convertMembers(...)
after the initial for loop that creates a the list of
validMembers:
for (int i = 0 ; i < validMembers.size() ; i++)
{
int j = i+1;
while (j < validMembers.size())
{
if (!validMembers.get(i).equals(validMembers.get(j)))
{
j++;
}
else
{
validMembers.remove(j);
}
}
}
This bugfix does work, but i dont know if it is the best
place to put it in.
Would be ncie to see this in the next release
roland
ReflectionClassStructure with the fix in it