From 716dd345cd5f87ac7cfb0f0b77863227a2b7ca9f Mon Sep 17 00:00:00 2001 From: Brett Wooldridge Date: Wed, 7 Oct 2015 01:02:47 +0900 Subject: [PATCH] Fixed issue with proxy generation --- CHANGES | 6 ++++++ .../java/com/zaxxer/hikari/util/JavassistProxyFactory.java | 2 ++ 2 files changed, 8 insertions(+) diff --git a/CHANGES b/CHANGES index e77f64b2..9a29e3e9 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,11 @@ HikariCP Changes +Changes in 2.4.2 + + * Fixed issue with proxy generation whereby the generated classes contain the + major version number for Java 8, which makes them incompatible with the Java 7 + runtime. + Changes in 2.4.1 * issue 380: housekeeper was not being scheduled in the case of a user specified diff --git a/src/main/java/com/zaxxer/hikari/util/JavassistProxyFactory.java b/src/main/java/com/zaxxer/hikari/util/JavassistProxyFactory.java index ba192e7f..bb4329b2 100644 --- a/src/main/java/com/zaxxer/hikari/util/JavassistProxyFactory.java +++ b/src/main/java/com/zaxxer/hikari/util/JavassistProxyFactory.java @@ -42,6 +42,7 @@ import javassist.CtNewMethod; import javassist.LoaderClassPath; import javassist.Modifier; import javassist.NotFoundException; +import javassist.bytecode.ClassFile; /** * This class generates the proxy objects for {@link Connection}, {@link Statement}, @@ -190,6 +191,7 @@ public final class JavassistProxyFactory } } + targetCt.getClassFile().setMajorVersion(ClassFile.JAVA_7); targetCt.writeFile("target/classes"); }