Uploaded image for project: 'Javassist'
  1. Javassist
  2. JASSIST-220

Java 8 & Streams/Consumers - javassist.bytecode.InterfaceMethodrefInfo cannot be cast to javassist.bytecode.MethodrefInfo

    Details

    • Steps to Reproduce:
      Hide

      What steps will reproduce the problem?
      Create class that implements Consumer interface (ie IntConsumer):
      import java.io.PrintStream;
      import java.util.function.IntConsumer;
      import java.util.stream.IntStream;

      public class FizzBuzz implements IntConsumer {

      public static boolean isFizz(int i)

      { return i % 5 == 0; }

      public static void run(PrintStream outputStream, int max)

      { IntStream.range(0, max).forEach(new FizzBuzz()); }

      @Override
      public void accept(int value) {

      }
      }

      Create test case that does:
      @RunWith(PowerMockRunner.class)
      @PrepareForTest(FizzBuzz.class)
      public class FizzBuzzTest extends TestCase {

      public static final int ANY_NUMBER = 5;

      public void testFizzOnThreeShouldReturnFalse()

      { Assert.assertThat(FizzBuzz.isFizz(3), is(false)); }

      public void testFizzOnFiveShouldReturnTrue()

      { Assert.assertThat(FizzBuzz.isFizz(5), is(true)); }

      @Test
      public void acceptOutputsFizzForFizz()

      { PrintStream stream = mock(PrintStream.class); PowerMockito.mockStatic(FizzBuzz.class); Mockito.when(FizzBuzz.isFizz(ANY_NUMBER)).thenReturn(true); new FizzBuzz().accept(ANY_NUMBER); Mockito.verify(stream, times(10)).println("fizz"); }

      }

      What is the expected output?
      Unsatisfied invocation, as there is no implementation in that method that is being tested yet...

      This works when you remove the 'implements IntConsumer' from the implementation. It also seems to fail on the @PrepareForTest(FizzBuzz.class) part.

      What do you see instead?
      /Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/bin/java -ea -Didea.launcher.port=7543 "-Didea.launcher.bin.path=/Applications/IntelliJ IDEA 13.app/bin" -Dfile.encoding=UTF-8 -classpath "/Applications/IntelliJ IDEA 13.app/lib/idea_rt.jar:/Applications/IntelliJ IDEA 13.app/plugins/junit/lib/junit-rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/lib/tools.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/htmlconverter.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/javaws.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/jfxswt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/management-agent.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/plugin.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/nashorn.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/Users/shendriks/projects/katas/fizzbuzz/java/target/test-classes:/Users/shendriks/projects/katas/fizzbuzz/java/target/classes:/Users/shendriks/.m2/repository/junit/junit/4.8.2/junit-4.8.2.jar:/Users/shendriks/.m2/repository/org/hamcrest/hamcrest-all/1.3/hamcrest-all-1.3.jar:/Users/shendriks/.m2/repository/org/mockito/mockito-all/1.9.5/mockito-all-1.9.5.jar:/Users/shendriks/.m2/repository/org/powermock/powermock-module-junit4/1.5.4/powermock-module-junit4-1.5.4.jar:/Users/shendriks/.m2/repository/org/powermock/powermock-module-junit4-common/1.5.4/powermock-module-junit4-common-1.5.4.jar:/Users/shendriks/.m2/repository/org/powermock/powermock-core/1.5.4/powermock-core-1.5.4.jar:/Users/shendriks/.m2/repository/org/powermock/powermock-reflect/1.5.4/powermock-reflect-1.5.4.jar:/Users/shendriks/.m2/repository/org/objenesis/objenesis/2.1/objenesis-2.1.jar:/Users/shendriks/.m2/repository/org/javassist/javassist/3.18.1-GA/javassist-3.18.1-GA.jar:/Users/shendriks/.m2/repository/org/powermock/powermock-api-mockito/1.5.4/powermock-api-mockito-1.5.4.jar:/Users/shendriks/.m2/repository/org/powermock/powermock-api-support/1.5.4/powermock-api-support-1.5.4.jar" com.intellij.rt.execution.application.AppMain com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 com.fundynamic.katas.FizzBuzzTest
      Internal Error occured.
      java.lang.IllegalStateException: Failed to transform class with name com.fundynamic.katas.FizzBuzz. Reason: javassist.bytecode.InterfaceMethodrefInfo cannot be cast to javassist.bytecode.MethodrefInfo
      at org.powermock.core.classloader.MockClassLoader.loadMockClass(MockClassLoader.java:214)
      at org.powermock.core.classloader.MockClassLoader.loadModifiedClass(MockClassLoader.java:144)
      at org.powermock.core.classloader.DeferSupportingClassLoader.loadClass(DeferSupportingClassLoader.java:67)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:340)
      at sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:114)
      at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:125)
      at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49)
      at sun.reflect.annotation.AnnotationParser.parseSig(AnnotationParser.java:439)
      at sun.reflect.annotation.AnnotationParser.parseClassValue(AnnotationParser.java:420)
      at sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:724)
      at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:531)
      at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:355)
      at sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:286)
      at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:120)
      at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:72)
      at java.lang.Class.createAnnotationData(Class.java:3410)
      at java.lang.Class.annotationData(Class.java:3399)
      at java.lang.Class.getAnnotations(Class.java:3335)

      What version of the product are you using? On what operating system?
      Mockito 1.9.5, Powermock 1.5.4

      Mac OS X 10.9 (Mavericks) with Java 8.

      Please provide any additional information below.
      POM.xml dependencies:
      <properties>
      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
      <powermock.version>1.5.4</powermock.version>
      </properties>

      <dependencies>
      <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.8.2</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-all</artifactId>
      <version>1.3</version>
      </dependency>
      <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-all</artifactId>
      <version>1.9.5</version>
      </dependency>
      <dependency>
      <groupId>org.powermock</groupId>
      <artifactId>powermock-module-junit4</artifactId>
      <version>${powermock.version}</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.powermock</groupId>
      <artifactId>powermock-api-mockito</artifactId>
      <version>${powermock.version}</version>
      <scope>test</scope>
      </dependency>
      </dependencies>

      Show
      What steps will reproduce the problem? Create class that implements Consumer interface (ie IntConsumer): import java.io.PrintStream; import java.util.function.IntConsumer; import java.util.stream.IntStream; public class FizzBuzz implements IntConsumer { public static boolean isFizz(int i) { return i % 5 == 0; } public static void run(PrintStream outputStream, int max) { IntStream.range(0, max).forEach(new FizzBuzz()); } @Override public void accept(int value) { } } Create test case that does: @RunWith(PowerMockRunner.class) @PrepareForTest(FizzBuzz.class) public class FizzBuzzTest extends TestCase { public static final int ANY_NUMBER = 5; public void testFizzOnThreeShouldReturnFalse() { Assert.assertThat(FizzBuzz.isFizz(3), is(false)); } public void testFizzOnFiveShouldReturnTrue() { Assert.assertThat(FizzBuzz.isFizz(5), is(true)); } @Test public void acceptOutputsFizzForFizz() { PrintStream stream = mock(PrintStream.class); PowerMockito.mockStatic(FizzBuzz.class); Mockito.when(FizzBuzz.isFizz(ANY_NUMBER)).thenReturn(true); new FizzBuzz().accept(ANY_NUMBER); Mockito.verify(stream, times(10)).println("fizz"); } } What is the expected output? Unsatisfied invocation, as there is no implementation in that method that is being tested yet... This works when you remove the 'implements IntConsumer' from the implementation. It also seems to fail on the @PrepareForTest(FizzBuzz.class) part. What do you see instead? /Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/bin/java -ea -Didea.launcher.port=7543 "-Didea.launcher.bin.path=/Applications/IntelliJ IDEA 13.app/bin" -Dfile.encoding=UTF-8 -classpath "/Applications/IntelliJ IDEA 13.app/lib/idea_rt.jar:/Applications/IntelliJ IDEA 13.app/plugins/junit/lib/junit-rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/lib/tools.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/htmlconverter.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/javaws.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/jfxswt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/management-agent.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/plugin.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/nashorn.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/Users/shendriks/projects/katas/fizzbuzz/java/target/test-classes:/Users/shendriks/projects/katas/fizzbuzz/java/target/classes:/Users/shendriks/.m2/repository/junit/junit/4.8.2/junit-4.8.2.jar:/Users/shendriks/.m2/repository/org/hamcrest/hamcrest-all/1.3/hamcrest-all-1.3.jar:/Users/shendriks/.m2/repository/org/mockito/mockito-all/1.9.5/mockito-all-1.9.5.jar:/Users/shendriks/.m2/repository/org/powermock/powermock-module-junit4/1.5.4/powermock-module-junit4-1.5.4.jar:/Users/shendriks/.m2/repository/org/powermock/powermock-module-junit4-common/1.5.4/powermock-module-junit4-common-1.5.4.jar:/Users/shendriks/.m2/repository/org/powermock/powermock-core/1.5.4/powermock-core-1.5.4.jar:/Users/shendriks/.m2/repository/org/powermock/powermock-reflect/1.5.4/powermock-reflect-1.5.4.jar:/Users/shendriks/.m2/repository/org/objenesis/objenesis/2.1/objenesis-2.1.jar:/Users/shendriks/.m2/repository/org/javassist/javassist/3.18.1-GA/javassist-3.18.1-GA.jar:/Users/shendriks/.m2/repository/org/powermock/powermock-api-mockito/1.5.4/powermock-api-mockito-1.5.4.jar:/Users/shendriks/.m2/repository/org/powermock/powermock-api-support/1.5.4/powermock-api-support-1.5.4.jar" com.intellij.rt.execution.application.AppMain com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 com.fundynamic.katas.FizzBuzzTest Internal Error occured. java.lang.IllegalStateException: Failed to transform class with name com.fundynamic.katas.FizzBuzz. Reason: javassist.bytecode.InterfaceMethodrefInfo cannot be cast to javassist.bytecode.MethodrefInfo at org.powermock.core.classloader.MockClassLoader.loadMockClass(MockClassLoader.java:214) at org.powermock.core.classloader.MockClassLoader.loadModifiedClass(MockClassLoader.java:144) at org.powermock.core.classloader.DeferSupportingClassLoader.loadClass(DeferSupportingClassLoader.java:67) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:340) at sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:114) at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:125) at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49) at sun.reflect.annotation.AnnotationParser.parseSig(AnnotationParser.java:439) at sun.reflect.annotation.AnnotationParser.parseClassValue(AnnotationParser.java:420) at sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:724) at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:531) at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:355) at sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:286) at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:120) at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:72) at java.lang.Class.createAnnotationData(Class.java:3410) at java.lang.Class.annotationData(Class.java:3399) at java.lang.Class.getAnnotations(Class.java:3335) What version of the product are you using? On what operating system? Mockito 1.9.5, Powermock 1.5.4 Mac OS X 10.9 (Mavericks) with Java 8. Please provide any additional information below. POM.xml dependencies: <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <powermock.version>1.5.4</powermock.version> </properties> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.8.2</version> <scope>test</scope> </dependency> <dependency> <groupId>org.hamcrest</groupId> <artifactId>hamcrest-all</artifactId> <version>1.3</version> </dependency> <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-all</artifactId> <version>1.9.5</version> </dependency> <dependency> <groupId>org.powermock</groupId> <artifactId>powermock-module-junit4</artifactId> <version>${powermock.version}</version> <scope>test</scope> </dependency> <dependency> <groupId>org.powermock</groupId> <artifactId>powermock-api-mockito</artifactId> <version>${powermock.version}</version> <scope>test</scope> </dependency> </dependencies>

      Description

      This is a bug report - which also exists on the powermock issue tracker at https://code.google.com/p/powermock/issues/detail?id=490


      The problem is that an exception is thrown (see below how to reproduce)

      Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/bin/java -ea -Didea.launcher.port=7543 "-Didea.launcher.bin.path=/Applications/IntelliJ IDEA 13.app/bin" -Dfile.encoding=UTF-8 -classpath "/Applications/IntelliJ IDEA 13.app/lib/idea_rt.jar:/Applications/IntelliJ IDEA 13.app/plugins/junit/lib/junit-rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/lib/tools.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/htmlconverter.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/javaws.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/jfxswt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/management-agent.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/plugin.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/nashorn.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/Users/shendriks/projects/katas/fizzbuzz/java/target/test-classes:/Users/shendriks/projects/katas/fizzbuzz/java/target/classes:/Users/shendriks/.m2/repository/junit/junit/4.8.2/junit-4.8.2.jar:/Users/shendriks/.m2/repository/org/hamcrest/hamcrest-all/1.3/hamcrest-all-1.3.jar:/Users/shendriks/.m2/repository/org/mockito/mockito-all/1.9.5/mockito-all-1.9.5.jar:/Users/shendriks/.m2/repository/org/powermock/powermock-module-junit4/1.5.4/powermock-module-junit4-1.5.4.jar:/Users/shendriks/.m2/repository/org/powermock/powermock-module-junit4-common/1.5.4/powermock-module-junit4-common-1.5.4.jar:/Users/shendriks/.m2/repository/org/powermock/powermock-core/1.5.4/powermock-core-1.5.4.jar:/Users/shendriks/.m2/repository/org/powermock/powermock-reflect/1.5.4/powermock-reflect-1.5.4.jar:/Users/shendriks/.m2/repository/org/objenesis/objenesis/2.1/objenesis-2.1.jar:/Users/shendriks/.m2/repository/org/javassist/javassist/3.18.1-GA/javassist-3.18.1-GA.jar:/Users/shendriks/.m2/repository/org/powermock/powermock-api-mockito/1.5.4/powermock-api-mockito-1.5.4.jar:/Users/shendriks/.m2/repository/org/powermock/powermock-api-support/1.5.4/powermock-api-support-1.5.4.jar" com.intellij.rt.execution.application.AppMain com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 com.fundynamic.katas.FizzBuzzTest
      Internal Error occured.
      java.lang.IllegalStateException: Failed to transform class with name com.fundynamic.katas.FizzBuzz. Reason: javassist.bytecode.InterfaceMethodrefInfo cannot be cast to javassist.bytecode.MethodrefInfo
      at org.powermock.core.classloader.MockClassLoader.loadMockClass(MockClassLoader.java:214)
      at org.powermock.core.classloader.MockClassLoader.loadModifiedClass(MockClassLoader.java:144)
      at org.powermock.core.classloader.DeferSupportingClassLoader.loadClass(DeferSupportingClassLoader.java:67)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:340)
      at sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:114)
      at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:125)
      at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49)
      at sun.reflect.annotation.AnnotationParser.parseSig(AnnotationParser.java:439)
      at sun.reflect.annotation.AnnotationParser.parseClassValue(AnnotationParser.java:420)
      at sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:724)
      at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:531)
      at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:355)
      at sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:286)
      at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:120)
      at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:72)
      at java.lang.Class.createAnnotationData(Class.java:3410)
      at java.lang.Class.annotationData(Class.java:3399)
      at java.lang.Class.getAnnotations(Class.java:3335)

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                chiba Shigeru Chiba
                Reporter:
                stefanhendriks Stefan Hendriks
              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: