diff --git a/main/pom.xml b/main/pom.xml index 70994d7cb..aadb6f777 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -1,12 +1,19 @@  - + 4.0.0 - org.jmockitjmockit1.49 + org.jmockit + jmockit.ts + 1.49.1 jar + + orchestra + maven-distribution-management + 0.7 + + JMockit JMockit is a Java toolkit for automated developer testing. @@ -22,7 +29,9 @@ - Rogério Liesenfeld + + Rogério Liesenfeld + 2006 @@ -66,16 +75,21 @@ - maven-compiler-plugin3.8.0 + maven-compiler-plugin + 3.8.0 UTF-8 - 1.71.7 - -Xlint:none + 1.7 + 1.7 + + -Xlint:none + false - maven-jar-plugin3.1.0 + maven-jar-plugin + 3.1.0 false @@ -91,7 +105,8 @@ - maven-source-plugin3.0.1 + maven-source-plugin + 3.0.1 false @@ -107,12 +122,15 @@ attach-sources - jar-no-fork + + jar-no-fork + - maven-javadoc-plugin3.0.1 + maven-javadoc-plugin + 3.0.1 UTF-8 true @@ -139,38 +157,65 @@ attach-javadocs - jar + + jar + - maven-surefire-plugin2.22.2 + maven-surefire-plugin + 2.22.2 true alphabetical @{argLine} -javaagent:../agent.jar - junitfalse - **/TestNGViolatedExpectationsTest.class + + + junit + false + + + + **/TestNGViolatedExpectationsTest.class + 1 1C - org.apache.maven.surefiresurefire-junit472.22.2 + org.apache.maven.surefire + surefire-junit47 + 2.22.2 - org.apache.maven.surefiresurefire-testng2.22.2 + org.apache.maven.surefire + surefire-testng + 2.22.2 - org.jacocojacoco-maven-plugin0.8.4 + org.jacoco + jacoco-maven-plugin + 0.8.4 - default-prepare-agentprepare-agent - default-reportreporttest + + default-prepare-agent + + prepare-agent + + + + default-report + + report + + test + - + + - com.github.spotbugsspotbugs-annotations4.0.0 + com.github.spotbugs + spotbugs-annotations + 4.0.0 - junitjunit4.13 + junit + junit + 4.13 true - org.junit.jupiterjunit-jupiter-engine5.6.0 + org.junit.jupiter + junit-jupiter-engine + 5.6.0 true - org.apiguardianapiguardian-api - org.opentest4jopentest4j - org.junit.platformjunit-platform-engine - org.junit.platformjunit-platform-commons + + org.apiguardian + apiguardian-api + + + org.opentest4j + opentest4j + + + org.junit.platform + junit-platform-engine + + + org.junit.platform + junit-platform-commons + - org.testngtestng7.1.0 + org.testng + testng + 7.1.0 true - javaxjavaee-api7.0 + javax + javaee-api + 7.0 true - com.sun.mailjavax.mail + + com.sun.mail + javax.mail + - org.springframeworkspring-web5.2.4.RELEASE + org.springframework + spring-web + 5.2.4.RELEASE true - org.springframeworkspring-context5.2.4.RELEASE + org.springframework + spring-context + 5.2.4.RELEASE true - org.springframeworkspring-aop - org.springframeworkspring-expression + + org.springframework + spring-aop + + + org.springframework + spring-expression + diff --git a/main/src/mockit/asm/constantPool/ConstantPoolGeneration.java b/main/src/mockit/asm/constantPool/ConstantPoolGeneration.java index f252f2503..6e947b376 100644 --- a/main/src/mockit/asm/constantPool/ConstantPoolGeneration.java +++ b/main/src/mockit/asm/constantPool/ConstantPoolGeneration.java @@ -390,7 +390,10 @@ public Item newConstItem(@Nonnull Object cst) { if (cst instanceof MethodHandle) { return newMethodHandleItem((MethodHandle) cst); } - + if(cst instanceof DynamicItem) { + DynamicItem dI = (DynamicItem)cst; + return createDynamicItem(dI.type, dI.name, dI.desc, dI.bsmIndex); + } throw new IllegalArgumentException("value " + cst); } diff --git a/main/src/mockit/asm/constantPool/DynamicItem.java b/main/src/mockit/asm/constantPool/DynamicItem.java index 2832de91b..f29e415fd 100644 --- a/main/src/mockit/asm/constantPool/DynamicItem.java +++ b/main/src/mockit/asm/constantPool/DynamicItem.java @@ -6,7 +6,7 @@ public final class DynamicItem extends TypeOrMemberItem { - @Nonnegative private int bsmIndex; + @Nonnegative int bsmIndex; public DynamicItem(@Nonnegative int index) { super(index); } diff --git a/main/src/mockit/asm/util/BytecodeReader.java b/main/src/mockit/asm/util/BytecodeReader.java index 40524b3c4..f38ab8e05 100644 --- a/main/src/mockit/asm/util/BytecodeReader.java +++ b/main/src/mockit/asm/util/BytecodeReader.java @@ -2,6 +2,8 @@ import javax.annotation.*; +import mockit.asm.constantPool.DynamicItem; +import mockit.asm.jvmConstants.ConstantPoolTypes; import mockit.asm.types.*; import static mockit.asm.jvmConstants.ConstantPoolTypes.*; @@ -394,6 +396,15 @@ protected final Object readConst(@Nonnegative int itemIndex) { case MTYPE: String methodDesc = readNonnullUTF8(constCodeIndex); return MethodType.create(methodDesc); + case CONDY: { + int bsmStartIndex = readUnsignedShort(constCodeIndex); + int nameIndex = readItem(constCodeIndex + 2); + String name = readNonnullUTF8(nameIndex); + String desc = readNonnullUTF8(nameIndex + 2); + DynamicItem dynamicItem = new DynamicItem(itemIndex); + dynamicItem.set(ConstantPoolTypes.CONDY, name, desc, bsmStartIndex); + return dynamicItem; + } // case HANDLE_BASE + [1..9]: default: return readMethodHandle(constCodeIndex);