You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by sb...@apache.org on 2018/10/24 19:59:36 UTC

svn commit: r1844789 - in /aries/branches/java6support/proxy: ./ proxy-impl/ proxy-impl/src/main/java/org/apache/aries/proxy/impl/ proxy-impl/src/main/java/org/apache/aries/proxy/impl/gen/ proxy-itests/

Author: sbratton
Date: Wed Oct 24 19:59:35 2018
New Revision: 1844789

URL: http://svn.apache.org/viewvc?rev=1844789&view=rev
Log:
merge ^/aries/trunk/proxy into java6support/proxy r1796178 through r1844785

Modified:
    aries/branches/java6support/proxy/   (props changed)
    aries/branches/java6support/proxy/proxy-impl/pom.xml
    aries/branches/java6support/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/ProxyUtils.java
    aries/branches/java6support/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/gen/ProxySubclassAdapter.java
    aries/branches/java6support/proxy/proxy-itests/pom.xml

Propchange: aries/branches/java6support/proxy/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Oct 24 19:59:35 2018
@@ -1,2 +1,2 @@
 /aries/branches/1.0-prototype/proxy:1306564-1337594
-/aries/trunk/proxy:1728111-1796177
+/aries/trunk/proxy:1728111-1844785

Modified: aries/branches/java6support/proxy/proxy-impl/pom.xml
URL: http://svn.apache.org/viewvc/aries/branches/java6support/proxy/proxy-impl/pom.xml?rev=1844789&r1=1844788&r2=1844789&view=diff
==============================================================================
--- aries/branches/java6support/proxy/proxy-impl/pom.xml (original)
+++ aries/branches/java6support/proxy/proxy-impl/pom.xml Wed Oct 24 19:59:35 2018
@@ -32,7 +32,7 @@
     <artifactId>org.apache.aries.proxy</artifactId>
     <packaging>bundle</packaging>
     <name>Apache Aries Proxy Service</name>
-    <version>1.1.2-SNAPSHOT</version>
+    <version>1.1.3-SNAPSHOT</version>
     <description>
         This bundle contains the proxy service implementation for Apache Aries
     </description>
@@ -74,9 +74,15 @@
         </dependency>
         <dependency>
             <groupId>org.ow2.asm</groupId>
-            <artifactId>asm-debug-all</artifactId>
+            <artifactId>asm</artifactId>
             <optional>true</optional>
-            <version>6.0_ALPHA</version>
+            <version>6.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.ow2.asm</groupId>
+            <artifactId>asm-commons</artifactId>
+            <optional>true</optional>
+            <version>6.2</version>
         </dependency>
         <dependency>
             <groupId>org.slf4j</groupId>

Modified: aries/branches/java6support/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/ProxyUtils.java
URL: http://svn.apache.org/viewvc/aries/branches/java6support/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/ProxyUtils.java?rev=1844789&r1=1844788&r2=1844789&view=diff
==============================================================================
--- aries/branches/java6support/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/ProxyUtils.java (original)
+++ aries/branches/java6support/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/ProxyUtils.java Wed Oct 24 19:59:35 2018
@@ -1,31 +1,31 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.aries.proxy.impl;
-
-import java.math.BigDecimal;
-
-import org.objectweb.asm.Opcodes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ProxyUtils
-{
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.aries.proxy.impl;
+
+import java.math.BigDecimal;
+
+import org.objectweb.asm.Opcodes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ProxyUtils
+{
   private static Logger LOGGER = LoggerFactory.getLogger(ProxyUtils.class);
   public static final int JAVA_CLASS_VERSION = new BigDecimal(System.getProperty("java.class.version")).intValue();
   private static int weavingJavaVersion = -1; // initialise an invalid number
@@ -39,9 +39,17 @@ public class ProxyUtils
     	//In order to avoid an inconsistent stack error the version of the woven byte code needs to match
     	//the level of byte codes in the original class
     	switch(JAVA_CLASS_VERSION) {
-			case Opcodes.V1_9:
+			case Opcodes.V11:
+				LOGGER.debug("Weaving to Java 11");
+				weavingJavaVersion = Opcodes.V11;
+				break;
+			case Opcodes.V10:
+				LOGGER.debug("Weaving to Java 10");
+				weavingJavaVersion = Opcodes.V10;
+				break;
+			case Opcodes.V9:
 				LOGGER.debug("Weaving to Java 9");
-				weavingJavaVersion = Opcodes.V1_9;
+				weavingJavaVersion = Opcodes.V9;
 				break;
     		case Opcodes.V1_8:
     			LOGGER.debug("Weaving to Java 8");
@@ -66,4 +74,4 @@ public class ProxyUtils
     } 
     return weavingJavaVersion;
   } 
-}
+}

Modified: aries/branches/java6support/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/gen/ProxySubclassAdapter.java
URL: http://svn.apache.org/viewvc/aries/branches/java6support/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/gen/ProxySubclassAdapter.java?rev=1844789&r1=1844788&r2=1844789&view=diff
==============================================================================
--- aries/branches/java6support/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/gen/ProxySubclassAdapter.java (original)
+++ aries/branches/java6support/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/gen/ProxySubclassAdapter.java Wed Oct 24 19:59:35 2018
@@ -565,39 +565,75 @@ public class ProxySubclassAdapter extend
     switch (returnType.getSort())
     {
       case Type.BOOLEAN:
-        methodAdapter.cast(OBJECT_TYPE, Type.getType(Boolean.class));
+        try {
+          methodAdapter.cast(OBJECT_TYPE, Type.getType(Boolean.class));
+        } catch (IllegalArgumentException ex) {
+          LOGGER.debug("Ignore cast exception caused by ASM 6.1 and try further", ex);
+        }
         methodAdapter.unbox(Type.BOOLEAN_TYPE);
         break;
       case Type.BYTE:
-        methodAdapter.cast(OBJECT_TYPE, Type.getType(Byte.class));
+        try {
+          methodAdapter.cast(OBJECT_TYPE, Type.getType(Byte.class));
+        } catch (IllegalArgumentException ex) {
+          LOGGER.debug("Ignore cast exception caused by ASM 6.1 and try further", ex);
+        }
         methodAdapter.unbox(Type.BYTE_TYPE);
         break;
       case Type.CHAR:
-        methodAdapter.cast(OBJECT_TYPE, Type.getType(Character.class));
+        try {
+          methodAdapter.cast(OBJECT_TYPE, Type.getType(Character.class));
+        } catch (IllegalArgumentException ex) {
+          LOGGER.debug("Ignore cast exception caused by ASM 6.1 and try further", ex);
+        }
         methodAdapter.unbox(Type.CHAR_TYPE);
         break;
       case Type.DOUBLE:
-        methodAdapter.cast(OBJECT_TYPE, Type.getType(Double.class));
+        try {
+          methodAdapter.cast(OBJECT_TYPE, Type.getType(Double.class));
+        } catch (IllegalArgumentException ex) {
+          LOGGER.debug("Ignore cast exception caused by ASM 6.1 and try further", ex);
+        }
         methodAdapter.unbox(Type.DOUBLE_TYPE);
         break;
       case Type.FLOAT:
-        methodAdapter.cast(OBJECT_TYPE, Type.getType(Float.class));
+        try {
+          methodAdapter.cast(OBJECT_TYPE, Type.getType(Float.class));
+        } catch (IllegalArgumentException ex) {
+          LOGGER.debug("Ignore cast exception caused by ASM 6.1 and try further", ex);
+        }
         methodAdapter.unbox(Type.FLOAT_TYPE);
         break;
       case Type.INT:
-        methodAdapter.cast(OBJECT_TYPE, Type.getType(Integer.class));
+        try {
+          methodAdapter.cast(OBJECT_TYPE, Type.getType(Integer.class));
+        } catch (IllegalArgumentException ex) {
+          LOGGER.debug("Ignore cast exception caused by ASM 6.1 and try further", ex);
+        }
         methodAdapter.unbox(Type.INT_TYPE);
         break;
       case Type.LONG:
-        methodAdapter.cast(OBJECT_TYPE, Type.getType(Long.class));
+        try {
+          methodAdapter.cast(OBJECT_TYPE, Type.getType(Long.class));
+        } catch (IllegalArgumentException ex) {
+          LOGGER.debug("Ignore cast exception caused by ASM 6.1 and try further", ex);
+        }
         methodAdapter.unbox(Type.LONG_TYPE);
         break;
       case Type.SHORT:
-        methodAdapter.cast(OBJECT_TYPE, Type.getType(Short.class));
+        try {
+          methodAdapter.cast(OBJECT_TYPE, Type.getType(Short.class));
+        } catch (IllegalArgumentException ex) {
+          LOGGER.debug("Ignore cast exception caused by ASM 6.1 and try further", ex);
+        }
         methodAdapter.unbox(Type.SHORT_TYPE);
         break;
       case Type.VOID:
-        methodAdapter.cast(OBJECT_TYPE, Type.getType(Void.class));
+        try {
+          methodAdapter.cast(OBJECT_TYPE, Type.getType(Void.class));
+        } catch (IllegalArgumentException ex) {
+          LOGGER.debug("Ignore cast exception caused by ASM 6.1 and try further", ex);
+        }
         methodAdapter.unbox(Type.VOID_TYPE);
         break;
       default:
@@ -605,7 +641,11 @@ public class ProxySubclassAdapter extend
         // in this case check the cast and cast the object to the return
         // type
         methodAdapter.checkCast(returnType);
-        methodAdapter.cast(OBJECT_TYPE, returnType);
+        try {
+          methodAdapter.cast(OBJECT_TYPE, returnType);
+        } catch (IllegalArgumentException ex) {
+          LOGGER.debug("Ignore cast exception caused by ASM 6.1 and try further", ex);
+        }
         break;
     }
     // return the (appropriately cast) result of the invocation from the

Modified: aries/branches/java6support/proxy/proxy-itests/pom.xml
URL: http://svn.apache.org/viewvc/aries/branches/java6support/proxy/proxy-itests/pom.xml?rev=1844789&r1=1844788&r2=1844789&view=diff
==============================================================================
--- aries/branches/java6support/proxy/proxy-itests/pom.xml (original)
+++ aries/branches/java6support/proxy/proxy-itests/pom.xml Wed Oct 24 19:59:35 2018
@@ -69,7 +69,7 @@
             <groupId>org.apache.aries.proxy</groupId>
             <artifactId>org.apache.aries.proxy</artifactId>
             <scope>test</scope>
-            <version>1.1.1-SNAPSHOT</version>
+            <version>1.1.3-SNAPSHOT</version>
         </dependency>
 
         <!-- pax exam -->