[jboss-cvs] JBossAS SVN: r110623 - in projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop: src/etc and 3 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Feb 11 05:28:40 EST 2011


Author: kabir.khan at jboss.com
Date: 2011-02-11 05:28:40 -0500 (Fri, 11 Feb 2011)
New Revision: 110623

Removed:
   projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/etc/jbossorg-eula.txt
Modified:
   projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/build-tests-jdk50.xml
   projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/ClassProxyFactory.java
   projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/MarshalledClassProxy.java
   projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/MarshalledInterfaceProxy.java
   projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/ProxyFactory.java
   projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/ProxyMethodInvocation.java
   projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/ProxyMixin.java
   projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/SecurityActions.java
   projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/container/ContainerCacheUtil.java
   projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/container/ContainerProxyCacheKey.java
   projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/container/ContainerProxyFactory.java
   projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/container/ContainerProxyMethodInvocation.java
   projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/container/GeneratedAOPProxyFactory.java
   projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/container/MarshalledContainerProxy.java
   projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/container/MarshalledProxyAdvisor.java
   projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/util/ClassInfoMethodHashing.java
   projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/util/GetDeclaringClassUtil.java
   projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/util/JavassistMethodHashing.java
   projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/util/JavassistUtils.java
   projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/util/MarshalledValue.java
   projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/util/MethodHashing.java
   projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/util/ReflectUtils.java
   projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/util/XmlHelper.java
Log:
[JBAOP-804] Port proxy factory fixes from trunk

Modified: projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/build-tests-jdk50.xml
===================================================================
--- projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/build-tests-jdk50.xml	2011-02-11 10:09:37 UTC (rev 110622)
+++ projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/build-tests-jdk50.xml	2011-02-11 10:28:40 UTC (rev 110623)
@@ -62,6 +62,7 @@
 
      <!-- Setup the build.log -->
      <property name="buildlog.level" value="info"/>
+     <echo>${project.output}/build.log</echo>
      <record name="${project.output}/build.log" append="no" loglevel="${buildlog.level}"/>
      <property name="init-buildlog.disable" value="true"/>
 

Deleted: projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/etc/jbossorg-eula.txt
===================================================================
--- projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/etc/jbossorg-eula.txt	2011-02-11 10:09:37 UTC (rev 110622)
+++ projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/etc/jbossorg-eula.txt	2011-02-11 10:28:40 UTC (rev 110623)
@@ -1,107 +0,0 @@
-LICENSE AGREEMENT
-JBOSS(r)
-
-This License Agreement governs the use of the Software Packages and any updates to the Software 
-Packages, regardless of the delivery mechanism.  Each Software Package is a collective work 
-under U.S. Copyright Law.  Subject to the following terms, Red Hat, Inc. ("Red Hat") grants to 
-the user ("Client") a license to the applicable collective work(s) pursuant to the 
-GNU Lesser General Public License v. 2.1 except for the following Software Packages: 
-(a) JBoss Portal Forums and JBoss Transactions JTS, each of which is licensed pursuant to the 
-GNU General Public License v.2; 
-
-(b) JBoss Rules, which is licensed pursuant to the Apache  License v.2.0;
-
-(c) an optional download for JBoss Cache for the Berkeley DB for Java database, which is licensed under the 
-(open source) Sleepycat License (if Client does not wish to use the open source version of this database, 
-it may purchase a license from Sleepycat Software); 
-
-and (d) the BPEL extension for JBoss jBPM, which is licensed under the Common Public License v.1, 
-and, pursuant to the OASIS BPEL4WS standard, requires parties wishing to redistribute to enter various 
-royalty-free patent licenses.  
-
-Each of the foregoing licenses is available at http://www.opensource.org/licenses/index.php.
-
-1.  The Software.  "Software Packages" refer to the various software modules that are created and made available 
-for distribution by the JBoss.org open source community at http://www.jboss.org.   Each of the Software Packages 
-may be comprised of hundreds of software components.  The end user license agreement for each component is located in 
-the component's source code.  With the exception of certain image files identified in Section 2 below, 
-the license terms for the components permit Client to copy, modify, and redistribute the component, 
-in both source code and binary code forms.  This agreement does not limit Client's rights under, 
-or grant Client rights that supersede, the license terms of any particular component.
-
-2.  Intellectual Property Rights.  The Software Packages are owned by Red Hat and others and are protected under copyright 
-and other laws.  Title to the Software Packages and any component, or to any copy, modification, or merged portion shall 
-remain with the aforementioned, subject to the applicable license.  The "JBoss" trademark, "Red Hat" trademark, the 
-individual Software Package trademarks, and the "Shadowman" logo are registered trademarks of Red Hat and its affiliates 
-in the U.S. and other countries.  This agreement permits Client to distribute unmodified copies of the Software Packages 
-using the Red Hat trademarks that Red Hat has inserted in the Software Packages on the condition that Client follows Red Hat's 
-trademark guidelines for those trademarks located at http://www.redhat.com/about/corporate/trademark/.  Client must abide by 
-these trademark guidelines when distributing the Software Packages, regardless of whether the Software Packages have been modified. 
-If Client modifies the Software Packages, then Client must replace all Red Hat trademarks and logos identified at 
-http://www.jboss.com/company/logos, unless a separate agreement with Red Hat is executed or other permission granted.  
-Merely deleting the files containing the Red Hat trademarks may corrupt the Software Packages.  
-
-3.  Limited Warranty.  Except as specifically stated in this Paragraph 3 or a license for a particular 
-component, to the maximum extent permitted under applicable law, the Software Packages and the 
-components are provided and licensed "as is" without warranty of any kind, expressed or implied, 
-including the implied warranties of merchantability, non-infringement or fitness for a particular purpose.  
-Red Hat warrants that the media on which Software Packages may be furnished will be free from defects in 
-materials and manufacture under normal use for a period of 30 days from the date of delivery to Client.  
-Red Hat does not warrant that the functions contained in the Software Packages will meet Client's requirements 
-or that the operation of the Software Packages will be entirely error free or appear precisely as described 
-in the accompanying documentation. This warranty extends only to the party that purchases the Services 
-pertaining to the Software Packages from Red Hat or a Red Hat authorized distributor. 
-
-4.  Limitation of Remedies and Liability. To the maximum extent permitted by applicable law, the remedies 
-described below are accepted by Client as its only remedies.  Red Hat's entire liability, and Client's 
-exclusive remedies, shall be: If the Software media is defective, Client may return it within 30 days of 
-delivery along with a copy of Client's payment receipt and Red Hat, at its option, will replace it or 
-refund the money paid by Client for the Software.  To the maximum extent permitted by applicable law, 
-Red Hat or any Red Hat authorized dealer will not be liable to Client for any incidental or consequential 
-damages, including lost profits or lost savings arising out of the use or inability to use the Software, 
-even if Red Hat or such dealer has been advised of the possibility of such damages.  In no event shall 
-Red Hat's liability under this agreement exceed the amount that Client paid to Red Hat under this 
-Agreement during the twelve months preceding the action.
-
-5.  Export Control.  As required by U.S. law, Client represents and warrants that it: 
-(a) understands that the Software Packages are subject to export controls under the 
-U.S. Commerce Department's Export Administration Regulations ("EAR"); 
-
-(b) is not located in a prohibited destination country under the EAR or U.S. sanctions regulations 
-(currently Cuba, Iran, Iraq, Libya, North Korea, Sudan and Syria); 
-
-(c) will not export, re-export, or transfer the Software Packages to any prohibited destination, entity, 
-or individual without the necessary export license(s) or authorizations(s) from the U.S. Government; 
-
-(d) will not use or transfer the Software Packages for use in any sensitive nuclear, chemical or 
-biological weapons, or missile technology end-uses unless authorized by the U.S. Government by 
-regulation or specific license; 
-
-(e) understands and agrees that if it is in the United States and exports or transfers the Software 
-Packages to eligible end users, it will, as required by EAR Section 740.17(e), submit semi-annual 
-reports to the Commerce Department's Bureau of Industry & Security (BIS), which include the name and 
-address (including country) of each transferee; 
-
-and (f) understands that countries other than the United States may restrict the import, use, or 
-export of encryption products and that it shall be solely responsible for compliance with any such 
-import, use, or export restrictions.
-
-6.  Third Party Programs. Red Hat may distribute third party software programs with the Software Packages 
-that are not part of the Software Packages and which Client must install separately.  These third party 
-programs are subject to their own license terms.  The license terms either accompany the programs or 
-can be viewed at http://www.redhat.com/licenses/.  If Client does not agree to abide by the applicable 
-license terms for such programs, then Client may not install them.  If Client wishes to install the programs 
-on more than one system or transfer the programs to another party, then Client must contact the licensor 
-of the programs.
-
-7.  General.  If any provision of this agreement is held to be unenforceable, that shall not affect the 
-enforceability of the remaining provisions.  This License Agreement shall be governed by the laws of the 
-State of North Carolina and of the United States, without regard to any conflict of laws provisions, 
-except that the United Nations Convention on the International Sale of Goods shall not apply.
-
-Copyright 2006 Red Hat, Inc.  All rights reserved.  
-"JBoss" and the JBoss logo are registered trademarks of Red Hat, Inc.  
-All other trademarks are the property of their respective owners. 
-
-	Page 1 of 1	18 October 2006
-

Modified: projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/ClassProxyFactory.java
===================================================================
--- projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/ClassProxyFactory.java	2011-02-11 10:09:37 UTC (rev 110622)
+++ projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/ClassProxyFactory.java	2011-02-11 10:28:40 UTC (rev 110623)
@@ -101,7 +101,7 @@
          }
          if (proxiesForLoader != null)
          {
-            WeakReference<Class<?>> ref = proxiesForLoader.get(pool.getClassLoader());
+            WeakReference<Class<?>> ref = proxiesForLoader.get(clazz);
             if (ref != null)
             {
                proxyClass = ref.get();
@@ -293,7 +293,7 @@
                for (int m = 0; m < methods.length; m++)
                {
                   if (methods[m].getDeclaringClass().getName().equals("java.lang.Object")) continue;
-                  Long hash = new Long(JavassistMethodHashing.methodHash(methods[m]));
+                  Long hash = Long.valueOf(JavassistMethodHashing.methodHash(methods[m]));
                   if (mixinMethods.contains(hash)) continue;
                   if (addedMethods.contains(hash)) throw new Exception("More than one mixin has same method");
                   mixinMethods.add(hash);
@@ -376,13 +376,13 @@
             if(!java.lang.reflect.Modifier.isVolatile( declaredMethods[i].getModifiers()))
             {
                long hash = org.jboss.aop.util.MethodHashing.methodHash(declaredMethods[i]);
-               if(!ignoredHash.contains(new Long(hash)))
-                  advised.put(new Long(hash), new MethodPersistentReference(declaredMethods[i], PersistentReference.REFERENCE_WEAK));
+               if(!ignoredHash.contains(Long.valueOf(hash)))
+                  advised.put(Long.valueOf(hash), new MethodPersistentReference(declaredMethods[i], PersistentReference.REFERENCE_WEAK));
             }
             else
             {
                long hash = org.jboss.aop.util.MethodHashing.methodHash(declaredMethods[i]);
-               ignoredHash.add(new Long(hash));
+               ignoredHash.add(Long.valueOf(hash));
             }
          }
       }

Modified: projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/MarshalledClassProxy.java
===================================================================
--- projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/MarshalledClassProxy.java	2011-02-11 10:09:37 UTC (rev 110622)
+++ projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/MarshalledClassProxy.java	2011-02-11 10:28:40 UTC (rev 110623)
@@ -22,6 +22,7 @@
 package org.jboss.aop.proxy;
 
 import org.jboss.aop.InstanceAdvisor;
+import org.jboss.aop.util.ReflectUtils;
 
 import java.io.ObjectStreamException;
 import java.io.Serializable;
@@ -48,7 +49,7 @@
    {
       this.clazz = clazz;
       this.advisor = advisor;
-      this.mixins = mixins;
+      this.mixins = ReflectUtils.copyArray(mixins);
    }
 
    public Object readResolve() throws ObjectStreamException

Modified: projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/MarshalledInterfaceProxy.java
===================================================================
--- projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/MarshalledInterfaceProxy.java	2011-02-11 10:09:37 UTC (rev 110622)
+++ projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/MarshalledInterfaceProxy.java	2011-02-11 10:28:40 UTC (rev 110623)
@@ -22,6 +22,7 @@
 package org.jboss.aop.proxy;
 
 import org.jboss.aop.InstanceAdvisor;
+import org.jboss.aop.util.ReflectUtils;
 import org.jboss.util.id.GUID;
 
 import java.io.ObjectStreamException;
@@ -51,7 +52,7 @@
       this.guid = guid;
       this.advisor = advisor;
       this.interfaces = intfs;
-      this.mixins = mixins;
+      this.mixins = ReflectUtils.copyArray(mixins);
    }
 
    public Object readResolve() throws ObjectStreamException

Modified: projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/ProxyFactory.java
===================================================================
--- projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/ProxyFactory.java	2011-02-11 10:09:37 UTC (rev 110622)
+++ projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/ProxyFactory.java	2011-02-11 10:28:40 UTC (rev 110623)
@@ -219,7 +219,7 @@
          for (int m = 0; m < methods.length; m++)
          {
             if (methods[m].getDeclaringClass().getName().equals("java.lang.Object")) continue;
-            Long hash = new Long(JavassistMethodHashing.methodHash(methods[m]));
+            Long hash = Long.valueOf(JavassistMethodHashing.methodHash(methods[m]));
             if (addedMethods.contains(hash)) continue;
             addedMethods.add(hash);
             String aopReturnStr = (methods[m].getReturnType().equals(CtClass.voidType)) ? "" : "return ($r)";

Modified: projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/ProxyMethodInvocation.java
===================================================================
--- projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/ProxyMethodInvocation.java	2011-02-11 10:09:37 UTC (rev 110622)
+++ projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/ProxyMethodInvocation.java	2011-02-11 10:28:40 UTC (rev 110623)
@@ -59,7 +59,7 @@
 
    public Method getMethod()
    {
-      MethodPersistentReference ref = proxy.getMethodMap().get(new Long(methodHash));
+      MethodPersistentReference ref = proxy.getMethodMap().get(Long.valueOf(methodHash));
       return (Method)ref.get();
    }
 

Modified: projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/ProxyMixin.java
===================================================================
--- projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/ProxyMixin.java	2011-02-11 10:09:37 UTC (rev 110622)
+++ projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/ProxyMixin.java	2011-02-11 10:28:40 UTC (rev 110623)
@@ -23,6 +23,8 @@
 
 import java.io.Serializable;
 
+import org.jboss.aop.util.ReflectUtils;
+
 /**
  * Comment
  *
@@ -42,7 +44,7 @@
 
    public ProxyMixin(Object mixin, Class<?>[] interfaces)
    {
-      this.interfaces = interfaces;
+      this.interfaces = ReflectUtils.copyArray(interfaces);
       this.mixin = mixin;
    }
 
@@ -53,7 +55,7 @@
 
    public Class<?>[] getInterfaces()
    {
-      return interfaces;
+      return ReflectUtils.copyArray(interfaces);
    }
 
 }
\ No newline at end of file

Modified: projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/SecurityActions.java
===================================================================
--- projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/SecurityActions.java	2011-02-11 10:09:37 UTC (rev 110622)
+++ projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/SecurityActions.java	2011-02-11 10:28:40 UTC (rev 110623)
@@ -84,7 +84,7 @@
    
    public static class GetContextClassLoaderAction implements PrivilegedAction<ClassLoader>
    {
-      public static GetContextClassLoaderAction INSTANCE = new GetContextClassLoaderAction();
+      public static final GetContextClassLoaderAction INSTANCE = new GetContextClassLoaderAction();
       
       public ClassLoader run()
       {

Modified: projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/container/ContainerCacheUtil.java
===================================================================
--- projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/container/ContainerCacheUtil.java	2011-02-11 10:09:37 UTC (rev 110622)
+++ projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/container/ContainerCacheUtil.java	2011-02-11 10:28:40 UTC (rev 110623)
@@ -80,7 +80,7 @@
          return false;
       }
       
-      if (my != null && my != null)
+      if (my != null && other != null)
       {
          if (my.length != other.length)
          {

Modified: projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/container/ContainerProxyCacheKey.java
===================================================================
--- projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/container/ContainerProxyCacheKey.java	2011-02-11 10:09:37 UTC (rev 110622)
+++ projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/container/ContainerProxyCacheKey.java	2011-02-11 10:28:40 UTC (rev 110623)
@@ -104,7 +104,7 @@
          return true;
       }
  
-      if (obj.getClass() != ContainerProxyCacheKey.class)
+      if (obj.getClass() != this.getClass())
       {
          return false;
       }

Modified: projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/container/ContainerProxyFactory.java
===================================================================
--- projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/container/ContainerProxyFactory.java	2011-02-11 10:09:37 UTC (rev 110622)
+++ projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/container/ContainerProxyFactory.java	2011-02-11 10:28:40 UTC (rev 110623)
@@ -636,7 +636,7 @@
             for (int m = 0; m < methods.length; m++)
             {
                if (methods[m].getDeclaringClass().getName().equals("java.lang.Object")) continue;
-               Long hash = new Long(JavassistMethodHashing.methodHash(methods[m]));
+               Long hash = Long.valueOf(JavassistMethodHashing.methodHash(methods[m]));
                if (mixinMethods.contains(hash)) continue;
                if (addedMethods.contains(hash)) throw new Exception("More than one mixin has same method");
                mixinMethods.add(hash);
@@ -756,7 +756,7 @@
          {
             if (methods[m].getDeclaringClass().getName().equals("java.lang.Object")) continue;
             
-            Long hash = new Long(JavassistMethodHashing.methodHash(methods[m]));
+            Long hash = Long.valueOf(JavassistMethodHashing.methodHash(methods[m]));
             if (mixinMethods.contains(hash)) continue;
             if (addedMethods.contains(hash)) continue;
 
@@ -1045,7 +1045,7 @@
                {
                   throw new RuntimeException("cannot have an IntroductionInterface that introduces several mixins with the same interfaces " + mixin.getInterfaces()[i]);
                }
-               mixinInterfaces.put(mixin.getInterfaces()[i], new Integer(idx));
+               mixinInterfaces.put(mixin.getInterfaces()[i], Integer.valueOf(idx));
             }
          }
          if (intro.getInterfaces() != null)
@@ -1058,7 +1058,7 @@
                }
                else
                {
-                  intfs.put(intro.getInterfaces()[i], new Integer(idx));
+                  intfs.put(intro.getInterfaces()[i], Integer.valueOf(idx));
                }
             }
          }

Modified: projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/container/ContainerProxyMethodInvocation.java
===================================================================
--- projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/container/ContainerProxyMethodInvocation.java	2011-02-11 10:09:37 UTC (rev 110622)
+++ projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/container/ContainerProxyMethodInvocation.java	2011-02-11 10:28:40 UTC (rev 110623)
@@ -36,6 +36,11 @@
    AspectManaged proxy;
    static final Object[] NO_ARGS = new Object[0];
    
+   public ContainerProxyMethodInvocation()
+   {
+      //For serialization
+   }
+   
    public ContainerProxyMethodInvocation(MethodInfo info, Interceptor[] interceptors, AspectManaged proxy)
    {
       super(info, interceptors);

Modified: projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/container/GeneratedAOPProxyFactory.java
===================================================================
--- projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/container/GeneratedAOPProxyFactory.java	2011-02-11 10:09:37 UTC (rev 110622)
+++ projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/container/GeneratedAOPProxyFactory.java	2011-02-11 10:28:40 UTC (rev 110623)
@@ -131,6 +131,9 @@
             }
          }
 
+         if (proxyClass == null)
+            throw new IllegalStateException("No proxy class");
+         
          return instantiateAndConfigureProxy(proxyClass, params);
       }
       catch (Exception e)

Modified: projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/container/MarshalledContainerProxy.java
===================================================================
--- projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/container/MarshalledContainerProxy.java	2011-02-11 10:09:37 UTC (rev 110622)
+++ projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/container/MarshalledContainerProxy.java	2011-02-11 10:28:40 UTC (rev 110623)
@@ -48,6 +48,7 @@
 import org.jboss.aop.instrument.Untransformable;
 import org.jboss.aop.metadata.SimpleMetaData;
 import org.jboss.aop.util.MethodHashing;
+import org.jboss.aop.util.ReflectUtils;
 import org.jboss.util.id.GUID;
 
 /**
@@ -90,7 +91,7 @@
       Class<?> proxyClass = proxyInstance.getClass();
       this.proxyClassName = proxyClass.getName();
       this.key = key;
-      this.mixins = mixins;
+      this.mixins = ReflectUtils.copyArray(mixins);
       this.delegate = delegate;
       this.clazz = currentAdvisor.getClazz();
 
@@ -188,7 +189,7 @@
    
    public Object[] getMixins()
    {
-      return mixins;
+      return ReflectUtils.copyArray(mixins);
    }
 
    public Object getDelegate()

Modified: projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/container/MarshalledProxyAdvisor.java
===================================================================
--- projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/container/MarshalledProxyAdvisor.java	2011-02-11 10:09:37 UTC (rev 110622)
+++ projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/proxy/container/MarshalledProxyAdvisor.java	2011-02-11 10:28:40 UTC (rev 110623)
@@ -43,7 +43,7 @@
  */
 public class MarshalledProxyAdvisor extends Advisor implements InstanceAdvisor
 {
-   TLongObjectHashMap methodInfos = new TLongObjectHashMap();
+   TLongObjectHashMap methodInfosMap = new TLongObjectHashMap();
    Object instance;
    
    public MarshalledProxyAdvisor(String name, AspectManager manager)
@@ -58,7 +58,7 @@
    
    public void addMethodInfo(MethodInfo info)
    {
-      methodInfos.put(info.getHash(), info);
+      methodInfosMap.put(info.getHash(), info);
    }
    
    public void setInstance(Object instance)
@@ -99,13 +99,13 @@
    @Override
    public MethodInfo getMethodInfo(long hash)
    {
-      MethodInfo info = (MethodInfo)methodInfos.get(hash);
+      MethodInfo info = (MethodInfo)methodInfosMap.get(hash);
       return info;
    }
    
    public MethodInfo[] getMethodInfos()
    {
-      Object[] vals = methodInfos.getValues();
+      Object[] vals = methodInfosMap.getValues();
       MethodInfo[] infos = new MethodInfo[vals.length];
       System.arraycopy(vals, 0, infos, 0, vals.length);
       return infos;

Modified: projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/util/ClassInfoMethodHashing.java
===================================================================
--- projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/util/ClassInfoMethodHashing.java	2011-02-11 10:09:37 UTC (rev 110622)
+++ projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/util/ClassInfoMethodHashing.java	2011-02-11 10:28:40 UTC (rev 110623)
@@ -167,7 +167,7 @@
             if (superclass.isInterface() || Advisable.isAdvisableMethod(declaredMethods[i].getModifiers(), declaredMethods[i].getName()))
             {
                long hash = methodHash(declaredMethods[i]);
-               advised.put(new Long(hash), declaredMethods[i]);
+               advised.put(Long.valueOf(hash), declaredMethods[i]);
             }
          }
       }

Modified: projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/util/GetDeclaringClassUtil.java
===================================================================
--- projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/util/GetDeclaringClassUtil.java	2011-02-11 10:09:37 UTC (rev 110622)
+++ projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/util/GetDeclaringClassUtil.java	2011-02-11 10:28:40 UTC (rev 110623)
@@ -23,6 +23,7 @@
 
 import java.security.AccessController;
 import java.security.PrivilegedAction;
+import java.util.Locale;
 
 /**
  * Utility class to work around IBM JDKs broken Class.getDeclaringClass() implementation
@@ -37,7 +38,7 @@
    static
    {
       String vendor = getSystemProperty("java.vm.vendor");
-      isIBMJVM = vendor.toUpperCase().contains("IBM");
+      isIBMJVM = vendor.toUpperCase(Locale.ENGLISH).contains("IBM");
    }
    
    public static Class<?> getDeclaringClass(Class<?> clazz)

Modified: projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/util/JavassistMethodHashing.java
===================================================================
--- projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/util/JavassistMethodHashing.java	2011-02-11 10:09:37 UTC (rev 110622)
+++ projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/util/JavassistMethodHashing.java	2011-02-11 10:28:40 UTC (rev 110623)
@@ -155,7 +155,7 @@
             }
             else
             {
-               advised.put(new Long(hash), declaredMethods[i]);
+               advised.put(Long.valueOf(hash), declaredMethods[i]);
             }
          }
       }

Modified: projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/util/JavassistUtils.java
===================================================================
--- projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/util/JavassistUtils.java	2011-02-11 10:09:37 UTC (rev 110622)
+++ projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/util/JavassistUtils.java	2011-02-11 10:28:40 UTC (rev 110623)
@@ -34,7 +34,7 @@
  */
 public class JavassistUtils
 {
-   public static CtClass[] EMPTY_CTCLASS_ARRAY = new CtClass[0];
+   public static final CtClass[] EMPTY_CTCLASS_ARRAY = new CtClass[0];
    
    public static CtMethod[] getMethodsWithName(CtClass clazz, String name)
    {

Modified: projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/util/MarshalledValue.java
===================================================================
--- projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/util/MarshalledValue.java	2011-02-11 10:09:37 UTC (rev 110622)
+++ projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/util/MarshalledValue.java	2011-02-11 10:28:40 UTC (rev 110623)
@@ -94,7 +94,9 @@
     */
    public byte[] toByteArray()
    {
-      return serializedForm;
+      byte[] copy = new byte[serializedForm.length];
+      System.arraycopy(serializedForm, 0, copy, 0, serializedForm.length);
+      return copy;
    }
 
    /**

Modified: projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/util/MethodHashing.java
===================================================================
--- projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/util/MethodHashing.java	2011-02-11 10:09:37 UTC (rev 110622)
+++ projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/util/MethodHashing.java	2011-02-11 10:28:40 UTC (rev 110623)
@@ -53,7 +53,7 @@
 
    public static Method findMethodByHash(Class<?> clazz, long hash) throws Exception
    {
-      return findMethodByHash(clazz, new Long(hash));
+      return findMethodByHash(clazz, Long.valueOf(hash));
    }
 
    public static Method findMethodByHash(Class<?> clazz, Long hash) throws Exception
@@ -87,7 +87,7 @@
    
    public static Constructor<?> findConstructorByHash(Class<?> clazz, long hash) throws Exception
    {
-      return findConstructorByHash(clazz, new Long(hash));
+      return findConstructorByHash(clazz, Long.valueOf(hash));
    }
    
    public static Constructor<?> findConstructorByHash(Class<?> clazz, Long hash) throws Exception
@@ -240,9 +240,9 @@
           try
           {
              long hash = methodHash(method);
-             map.put(method.toString(), new Long(hash));
+             map.put(method.toString(), Long.valueOf(hash));
           }
-          catch (Exception e)
+          catch (Exception ignore)
           {
           }
        }
@@ -272,9 +272,9 @@
          {
             long hash = methodHash(methods[i]);
             //Use Clebert's Persistent References so we don't get memory leaks
-            map.put(new Long(hash), new MethodPersistentReference(methods[i], PersistentReference.REFERENCE_SOFT));
+            map.put(Long.valueOf(hash), new MethodPersistentReference(methods[i], PersistentReference.REFERENCE_SOFT));
          }
-         catch (Exception e)
+         catch (Exception ignore)
          {
          }
       }
@@ -304,9 +304,9 @@
          {
             long hash = constructorHash(constructors[i]);
             //Use Clebert's Persistent References so we don't get memory leaks
-            map.put(new Long(hash), new ConstructorPersistentReference(constructors[i], PersistentReference.REFERENCE_SOFT));
+            map.put(Long.valueOf(hash), new ConstructorPersistentReference(constructors[i], PersistentReference.REFERENCE_SOFT));
          }
-         catch (Exception e)
+         catch (Exception ignore)
          {
          }
       }

Modified: projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/util/ReflectUtils.java
===================================================================
--- projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/util/ReflectUtils.java	2011-02-11 10:09:37 UTC (rev 110622)
+++ projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/util/ReflectUtils.java	2011-02-11 10:28:40 UTC (rev 110623)
@@ -21,6 +21,7 @@
 */ 
 package org.jboss.aop.util;
 
+import java.lang.reflect.Array;
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
 import java.util.ArrayList;
@@ -34,7 +35,7 @@
  */
 public class ReflectUtils
 {
-   public static Class<?>[] EMPTY_CLASS_ARRAY = new Class[0];
+   public static final Class<?>[] EMPTY_CLASS_ARRAY = new Class[0];
    private static Pattern accessMethodPattern = Pattern.compile("access[$](\\d)+");
    
    public static Method[] getMethodsWithName(Class<?> clazz, String name)
@@ -83,5 +84,22 @@
 
       return true;
    }
-   
+
+   public static <T> T[] copyArray(T[] original)
+   {
+      if (original == null)
+         return null;
+      T[] copy = (T[])Array.newInstance(original.getClass().getComponentType(), original.length);
+      System.arraycopy(original, 0, copy, 0, copy.length);
+      return copy;
+   }
+
+   public static int[] copyArray(int[] original)
+   {
+      if (original == null)
+         return null;
+      int[] copy = new int[original.length];
+      System.arraycopy(original, 0, copy, 0, copy.length);
+      return copy;
+   }
 }

Modified: projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/util/XmlHelper.java
===================================================================
--- projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/util/XmlHelper.java	2011-02-11 10:09:37 UTC (rev 110622)
+++ projects/aop/branches/JBoss_AOP_2_1_6_GA_CP/aop/src/main/java/org/jboss/aop/util/XmlHelper.java	2011-02-11 10:28:40 UTC (rev 110623)
@@ -27,6 +27,7 @@
 
 import java.util.ArrayList;
 import java.util.Iterator;
+import java.util.Locale;
 
 /**
  * A utility class to cover up the rough bits of xml parsing
@@ -212,7 +213,7 @@
       Element child = getOptionalChild(element, name);
       if(child != null)
       {
-         String value = getElementContent(child).toLowerCase();
+         String value = getElementContent(child).toLowerCase(Locale.ENGLISH);
          return value.equals("true") || value.equals("yes");
       }
 



More information about the jboss-cvs-commits mailing list