Fixed issue with new proxy class generation whereby Java 6 classes were generated as extending java.lang.AutoClosable, which was not introduced until Java 7.

2.3.x
Brett Wooldridge 9 years ago
parent fe6eb4123e
commit f0ba4b7188

@ -1,5 +1,10 @@
HikariCP Changes
Changes in 2.3.12
* Fixed issue with new proxy class generation whereby Java 6 classes were generated
as extending java.lang.AutoClosable, which was not introduced until Java 7.
Changes in 2.3.11
* Fixed issue with new proxy class generation whereby Java 6 classes were generated

@ -55,12 +55,14 @@ import javassist.bytecode.ClassFile;
*/
public final class JavassistProxyFactory
{
private static boolean JAVA6_TARGET;
private static ClassPool classPool;
private static String outputPrefix;
public static void main(String... args)
{
outputPrefix = args[0] + File.separator + "target" + File.separator + "classes";
JAVA6_TARGET = args[0].contains("java6");
classPool = new ClassPool();
classPool.importPackage("java.sql");
@ -138,6 +140,10 @@ public final class JavassistProxyFactory
Set<String> methods = new HashSet<String>();
Set<Class<?>> interfaces = getAllInterfaces(primaryInterface);
if (JAVA6_TARGET) {
interfaces.remove(AutoCloseable.class);
}
for (Class<?> intf : interfaces) {
CtClass intfCt = classPool.getCtClass(intf.getName());
targetCt.addInterface(intfCt);

Loading…
Cancel
Save