aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eji...@apache.org
Subject svn commit: r1291675 - in /aries/trunk/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl: ProxyUtils.java common/AbstractWovenProxyAdapter.java
Date Tue, 21 Feb 2012 09:32:01 GMT
Author: ejiang
Date: Tue Feb 21 09:32:01 2012
New Revision: 1291675

URL: http://svn.apache.org/viewvc?rev=1291675&view=rev
Log:
ARIES-817: JDK7 support - fix the bug of unable to proxy in java5 

Modified:
    aries/trunk/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/ProxyUtils.java
    aries/trunk/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/common/AbstractWovenProxyAdapter.java

Modified: aries/trunk/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/ProxyUtils.java
URL: http://svn.apache.org/viewvc/aries/trunk/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/ProxyUtils.java?rev=1291675&r1=1291674&r2=1291675&view=diff
==============================================================================
--- aries/trunk/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/ProxyUtils.java
(original)
+++ aries/trunk/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/ProxyUtils.java
Tue Feb 21 09:32:01 2012
@@ -27,7 +27,7 @@ import org.slf4j.LoggerFactory;
 public class ProxyUtils
 {
   private static Logger LOGGER = LoggerFactory.getLogger(ProxyUtils.class);
-  public static int javaClassVersion = new BigDecimal(System.getProperty("java.class.version")).intValue();
+  public static final int JAVA_CLASS_VERSION = new BigDecimal(System.getProperty("java.class.version")).intValue();
   private static int weavingJavaVersion = -1; // initialise an invalid number
   /**
    * Get the java version to be woven at.
@@ -35,13 +35,13 @@ public class ProxyUtils
    */
   public static int getWeavingJavaVersion() {
     if (weavingJavaVersion == -1 ) {
-      if (javaClassVersion >= Opcodes.V1_7) {
+      if (JAVA_CLASS_VERSION >= Opcodes.V1_7) {
         LOGGER.debug("Weaving to Java 7");
         weavingJavaVersion = Opcodes.V1_7;
-      } else if (javaClassVersion == Opcodes.V1_6){
+      } else if (JAVA_CLASS_VERSION == Opcodes.V1_6){
         LOGGER.debug("Weaving to Java 6");
         weavingJavaVersion = Opcodes.V1_6;
-      } else if (javaClassVersion == Opcodes.V1_5) {
+      } else if (JAVA_CLASS_VERSION == Opcodes.V1_5) {
         LOGGER.debug("Weaving to Java 5");
         weavingJavaVersion = Opcodes.V1_5;
       } // no need to list all Opcodes as Aries should only work with java5 or above.

Modified: aries/trunk/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/common/AbstractWovenProxyAdapter.java
URL: http://svn.apache.org/viewvc/aries/trunk/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/common/AbstractWovenProxyAdapter.java?rev=1291675&r1=1291674&r2=1291675&view=diff
==============================================================================
--- aries/trunk/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/common/AbstractWovenProxyAdapter.java
(original)
+++ aries/trunk/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/common/AbstractWovenProxyAdapter.java
Tue Feb 21 09:32:01 2012
@@ -18,10 +18,11 @@
  */
 package org.apache.aries.proxy.impl.common;
 
+import static org.apache.aries.proxy.impl.ProxyUtils.JAVA_CLASS_VERSION;
+
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.Serializable;
-import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
@@ -187,7 +188,7 @@ public abstract class AbstractWovenProxy
 
   protected boolean currentMethodDeclaringTypeIsInterface;
   
-  public static final int JAVA_CLASS_VERSION = new BigDecimal(System.getProperty("java.class.version")).intValue();
+ 
   public static final boolean IS_AT_LEAST_JAVA_6 = JAVA_CLASS_VERSION >= Opcodes.V1_6;
   
   /**
@@ -216,7 +217,7 @@ public abstract class AbstractWovenProxy
         name, signature, superName, interfaces });
 
     // always update to the most recent version of the JVM
-    version = AbstractWovenProxyAdapter.JAVA_CLASS_VERSION;
+    version = JAVA_CLASS_VERSION;
 
     superType = Type.getType("L" + superName + ";");
 



Mime
View raw message