Open GoogleCodeExporter opened 9 years ago
I just copied this all to a project, except for changing "MyTest" to
"ConcreteConverterTest" and adding required imports. I ran it from the command
line and Eclipse with JDK 1.7.0_51. In both cases it ran without error.
I'm running on Win7.
Perhaps you should run this in the debugger and see if you can see any other
clues?
Original comment by davidmic...@gmail.com
on 8 Aug 2014 at 3:15
This case is even more complicated than I thought. Three classes have to be
declared in three different compilation units (three different files) and
AbstractConverter need to have default visibility.
All classes can be declared in one package (even in default package).
Original comment by arkadius...@gmail.com
on 11 Aug 2014 at 6:39
[deleted comment]
This bug is really similar to next issue: #434. Please take a look into byte
code:
public class org.mockito.ConcreteConverterTest {
public org.mockito.ConcreteConverterTest();
Code:
0: aload_0
1: invokespecial #1 // Method java/lang/Object."<init>":()V
4: return
public void test();
Code:
0: aload_0
1: getfield #2 // Field cc:Lorg/mockito/ConcreteConverter;
4: aload_0
5: getfield #3 // Field intList:Ljava/util/List;
8: invokevirtual #4 // Method org/mockito/ConcreteConverter.convert:(Ljava/util/List;)Ljava/util/List;
11: invokestatic #5 // Method org/mockito/Mockito.when:(Ljava/lang/Object;)Lorg/mockito/stubbing/OngoingStubbing;
14: aload_0
15: getfield #6 // Field stringList:Ljava/util/List;
18: invokeinterface #7, 2 // InterfaceMethod org/mockito/stubbing/OngoingStubbing.thenReturn:(Ljava/lang/Object;)Lorg/mockito/stubbing/OngoingStubbing;
23: pop
24: return
}
public class org.mockito.ConcreteConverter extends
org.mockito.AbstractConverter<java.lang.Integer, java.lang.String> {
public org.mockito.ConcreteConverter();
Code:
0: aload_0
1: invokespecial #1 // Method org/mockito/AbstractConverter."<init>":()V
4: return
public java.lang.String convert(java.lang.Integer);
Code:
0: aload_1
1: invokevirtual #2 // Method java/lang/Integer.toString:()Ljava/lang/String;
4: areturn
public java.lang.Object convert(java.lang.Object);
Code:
0: aload_0
1: aload_1
2: checkcast #3 // class java/lang/Integer
5: invokevirtual #4 // Method convert:(Ljava/lang/Integer;)Ljava/lang/String;
8: areturn
public java.util.List convert(java.util.List);
Code:
0: aload_0
1: aload_1
2: invokespecial #5 // Method org/mockito/AbstractConverter.convert:(Ljava/util/List;)Ljava/util/List;
5: areturn
}
It is not easy to solve this problem. I will take a deeper look later when I
find some time and get to know changes in the project. Btw. I think that in
future it is better idea just to create issue on github:
https://github.com/mockito/mockito
Original comment by albers...@gmail.com
on 18 Aug 2014 at 10:04
Thank you for feedback. I will try to remember to create new issues on github
(here I have got great issue number ;-))
Original comment by arkadius...@gmail.com
on 19 Aug 2014 at 5:10
Original issue reported on code.google.com by
arkadius...@gmail.com
on 8 Aug 2014 at 6:54