Skip to content
Commits on Source (4)
......@@ -9,7 +9,7 @@
<parent>
<groupId>cglib</groupId>
<artifactId>cglib-parent</artifactId>
<version>3.2.8</version>
<version>3.2.9</version>
</parent>
<!-- ====================================================================== -->
......
......@@ -7,7 +7,7 @@
<parent>
<artifactId>cglib-parent</artifactId>
<groupId>cglib</groupId>
<version>3.2.8</version>
<version>3.2.9</version>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -9,7 +9,7 @@
<parent>
<groupId>cglib</groupId>
<artifactId>cglib-parent</artifactId>
<version>3.2.8</version>
<version>3.2.9</version>
</parent>
<!-- ====================================================================== -->
......
......@@ -9,7 +9,7 @@
<parent>
<groupId>cglib</groupId>
<artifactId>cglib-parent</artifactId>
<version>3.2.8</version>
<version>3.2.9</version>
</parent>
<!-- ====================================================================== -->
......
......@@ -9,7 +9,7 @@
<parent>
<groupId>cglib</groupId>
<artifactId>cglib-parent</artifactId>
<version>3.2.8</version>
<version>3.2.9</version>
</parent>
<!-- ====================================================================== -->
......
package net.sf.cglib.core;
import java.security.AccessController;
import java.security.PrivilegedAction;
import org.objectweb.asm.Opcodes;
final class AsmApi {
private static final String EXPERIMENTAL_ASM7_PROPERTY_NAME = "net.sf.cglib.experimental_asm7";
/**
* Returns the latest stable ASM API value in {@link Opcodes} unless overridden via the
* net.sf.cglib.experimental_asm7 property.
* Returns the latest stable ASM API value in {@link Opcodes}.
*/
static int value() {
boolean experimentalAsm7;
try {
experimentalAsm7 = Boolean.parseBoolean(AccessController.doPrivileged(
new PrivilegedAction<String>() {
public String run() {
return System.getProperty(EXPERIMENTAL_ASM7_PROPERTY_NAME);
}
}));
} catch (Exception ignored) {
experimentalAsm7 = false;
}
return experimentalAsm7 ? Opcodes.ASM7_EXPERIMENTAL : Opcodes.ASM6;
return Opcodes.ASM7;
}
private AsmApi() {
......
......@@ -9,28 +9,28 @@ public class AsmApiTest {
@Test
public void testValue() {
assertEquals(Opcodes.ASM6, AsmApi.value());
assertEquals(Opcodes.ASM7, AsmApi.value());
}
/**
* With the release of ASM 7.0 beta, Opcodes.ASM7_EXPERIMENTAL
* has been replaced by Opcodes.ASM7 so we simply ignore
* the system property and default to the newest stable
* version.
*/
@Test
public void testValueWithSystemPropertyTrue() {
int asmApi = setSystemPropertyAndGetValue("true");
assertEquals(Opcodes.ASM7_EXPERIMENTAL, asmApi);
}
public void testValueWithAsm7Experimental() {
int asmApi = setAsm7ExperimentalAndGetValue("true");
assertEquals(Opcodes.ASM7, asmApi);
@Test
public void testValueWithSystemPropertyEmptyString() {
int asmApi = setSystemPropertyAndGetValue("");
assertEquals(Opcodes.ASM6, asmApi);
}
asmApi = setAsm7ExperimentalAndGetValue("");
assertEquals(Opcodes.ASM7, asmApi);
@Test
public void testValueWithSystemPropertyFalse() {
int asmApi = setSystemPropertyAndGetValue("false");
assertEquals(Opcodes.ASM6, asmApi);
asmApi = setAsm7ExperimentalAndGetValue("false");
assertEquals(Opcodes.ASM7, asmApi);
}
private int setSystemPropertyAndGetValue(String value) {
private int setAsm7ExperimentalAndGetValue(String value) {
String propName = "net.sf.cglib.experimental_asm7";
System.setProperty(propName, value);
try {
......
cglib (3.2.9-1) unstable; urgency=medium
* Team upload.
* New upstream version 3.2.9.
- Fix FTBFS with ASM 7. (Closes: #912645)
-- Markus Koschany <apo@debian.org> Thu, 08 Nov 2018 14:31:16 +0100
cglib (3.2.8-1) unstable; urgency=medium
* Team upload.
......
......@@ -7,7 +7,7 @@ Build-Depends: ant,
debhelper (>= 11),
default-jdk,
junit4,
libasm-java (>= 6.0),
libasm-java (>= 7.0),
libjarjar-maven-plugin-java,
libmaven-javadoc-plugin-java,
maven-debian-helper (>= 2.0.4)
......
......@@ -14,7 +14,7 @@
<!-- ====================================================================== -->
<groupId>cglib</groupId>
<artifactId>cglib-parent</artifactId>
<version>3.2.8</version>
<version>3.2.9</version>
<packaging>pom</packaging>
<name>Code Generation Library</name>
......@@ -54,7 +54,7 @@
<java.version.source>1.5</java.version.source>
<java.version.target>1.5</java.version.target>
<asm.version>6.2.1</asm.version>
<asm.version>7.0</asm.version>
<ant.version>1.10.3</ant.version>
<jmh.version>1.21</jmh.version>
<maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
......