Version of JMockit that was used:
JMockit 1.38 (also tested against 1.39 and 1.41)
Gradle 4.8
JVM: 1.8.0_152 (Oracle Corporation 25.152-b16)
OS: Windows 7 6.1 amd64
TestNG: 6.8
Description of the problem:
Producing a Fake of a class with an inner class causes an IncompatibleClassChangeError, this is the actual error message: java.lang.IncompatibleClassChangeError: reproducer.InnerClassesTests$Base and reproducer.InnerClassesTests$Base$InnerClass disagree on InnerClasses attribute
This failure cam into being at version 1.38, and still appears to exist in 1.41.
This appears to be a regression, as it previously worked on JMockit version 1.21.
Here's a quick reproducer:
packagereproducer;
importmockit.Mock;
importmockit.MockUp;
importorg.testng.annotations.Test;
/** * Test to show that producing a Fake of a class with an inner class causes an IncompatibleClassChangeError. * This failure came into being at version 1.38, and still appears to exist in 1.41. */publicclassInnerClassesTests
{
publicstaticclassBase
{
voiddoSomething()
{
}
classInnerClass
{
}
}
@TestpublicvoidtestInnerClassFailure()
{
newMockUp<Base>()
{
@MockvoiddoSomething()
{
// Just need to get the class processed
}
};
Base.InnerClass.class.getDeclaringClass(); // causes IncompatibleClassChangeError
}
}
The text was updated successfully, but these errors were encountered:
Please provide the following information:
Version of JMockit that was used:
JMockit 1.38 (also tested against 1.39 and 1.41)
Gradle 4.8
JVM: 1.8.0_152 (Oracle Corporation 25.152-b16)
OS: Windows 7 6.1 amd64
TestNG: 6.8
Description of the problem:
Producing a Fake of a class with an inner class causes an IncompatibleClassChangeError, this is the actual error message:
java.lang.IncompatibleClassChangeError: reproducer.InnerClassesTests$Base and reproducer.InnerClassesTests$Base$InnerClass disagree on InnerClasses attribute
This failure cam into being at version 1.38, and still appears to exist in 1.41.
This appears to be a regression, as it previously worked on JMockit version 1.21.
Here's a quick reproducer:
The text was updated successfully, but these errors were encountered: