I get an error "link to make is twoiguous", which I do not understand.
I have two methods
public static <T> T make(String name, Class<T> parentClass, boolean rethrowRuntimeExceptions, Object... params) throws DLException public static <T> T make(String name, Class<T> parentClass, Object... params) throws DLException
This line of code is marked mixed
String className = "clsNme"; String one = "1"; String two = "2"; SimpleFactory.make(className, Object.class, false, one, two);
Here is the error
both method <T#1>make(String,Class<T#1>,boolean,Object...) in SimpleFactory and method <T#2>make(String,Class<T#2>,Object...) in SimpleFactory match [javac] where T#1,T#2 are type-variables: [javac] T#1 extends Object declared in method <T#1>make(String,Class<T#1>,boolean,Object...) [javac] T#2 extends Object declared in method <T#2>make(String,Class<T#2>,Object...)
Does the presence of a logical parameter mean the first method of a closer match than the second?
If that matters, this is part of the PowerMock test. Here is the complete method
public void makeCallsMakeWithFalse() throws Throwable { Object expected = mock(Object.class); String className = "clsNme"; String one = "1"; String two = "2"; spy(SimpleFactory.class); doReturn(expected).when(SimpleFactory.class); SimpleFactory.make(className, Object.class, false, one, two);
}
If this helps: I use javac 1.8.0_77, Mokito 1.10.19 and Powermock 1.6.3.