commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jcar...@apache.org
Subject svn commit: r320764 [1/2] - in /jakarta/commons/sandbox/proxy/trunk: ./ src/java/org/apache/commons/proxy/ src/java/org/apache/commons/proxy/factory/cglib/ src/java/org/apache/commons/proxy/factory/javassist/ src/java/org/apache/commons/proxy/factory/r...
Date Thu, 13 Oct 2005 13:26:27 GMT
Author: jcarman
Date: Thu Oct 13 06:26:06 2005
New Revision: 320764

URL: http://svn.apache.org/viewcvs?rev=320764&view=rev
Log:
Refactored to support earlier JVMs.

Added:
    jakarta/commons/sandbox/proxy/trunk/maven.xml   (with props)
Modified:
    jakarta/commons/sandbox/proxy/trunk/PROPOSAL.html
    jakarta/commons/sandbox/proxy/trunk/build.xml
    jakarta/commons/sandbox/proxy/trunk/commons-proxy.iml
    jakarta/commons/sandbox/proxy/trunk/commons-proxy.ipr
    jakarta/commons/sandbox/proxy/trunk/project.properties
    jakarta/commons/sandbox/proxy/trunk/project.xml
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/ProxyFactory.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/ProxyUtils.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/cglib/CglibProxyFactory.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/javassist/JavassistMethodInvocation.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/javassist/JavassistProxyFactory.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/javassist/JavassistUtils.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/AbstractInvocationHandler.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/ReflectionProxyFactory.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/util/AbstractProxyClassGenerator.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/util/AbstractProxyFactory.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/util/AbstractSubclassingProxyFactory.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/util/MethodSignature.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/util/ProxyClassCache.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/util/ProxyClassGenerator.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/handler/NullInvocationHandler.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/ExecutorMethodInterceptor.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/MethodInterceptorChain.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/filter/ReturnTypeFilter.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/filter/SimpleMethodFilter.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/BeanProvider.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/BurlapProvider.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/HessianProvider.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/JaxRpcProvider.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/RmiProvider.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/SessionBeanProvider.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/cache/AbstractCache.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/cache/SimpleCache.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/cache/ThreadLocalCache.java
    jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/TestProxyUtils.java
    jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/exception/AbstractExceptionClassTestCase.java
    jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/factory/AbstractProxyFactoryTestCase.java
    jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/factory/AbstractSubclassingProxyFactoryTestCase.java
    jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/factory/reflect/TestAbstractInvocationHandler.java
    jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/factory/util/TestMethodSignature.java
    jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/handler/TestNullInvocationHandler.java
    jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/interceptor/TestExecutorMethodInterceptor.java
    jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/interceptor/TestFilteredMethodInterceptor.java
    jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/interceptor/TestMethodInterceptorChain.java
    jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/interceptor/filter/TestPatternMethodFilter.java
    jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/interceptor/filter/TestReturnTypeFilter.java
    jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/interceptor/filter/TestSimpleMethodFilter.java
    jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/provider/TestCachedProvider.java
    jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/provider/TestPooledProvider.java

Modified: jakarta/commons/sandbox/proxy/trunk/PROPOSAL.html
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/PROPOSAL.html?rev=320764&r1=320763&r2=320764&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/PROPOSAL.html (original)
+++ jakarta/commons/sandbox/proxy/trunk/PROPOSAL.html Thu Oct 13 06:26:06 2005
@@ -50,8 +50,7 @@
 <h3>(1.5) Interaction With Other Packages</h3>
 
 <p>
-    <em>Proxy</em> relies on some JDK5-specific features, such as generics and read/write locks
-    (java.util.concurrent.locks package). It utilizes the JUnit unit testing framework for developing and executing unit tests, but this is of
+    <em>Proxy</em> utilizes the JUnit unit testing framework for developing and executing unit tests, but this is of
     interest only to developers of the component. The original will include support for the Hessian and Burlap remoting
     protocols.  The original codebase will also include support for CGLIB and Javassist-base proxies. Method interception will be
     done using the AOP Alliance API.

Modified: jakarta/commons/sandbox/proxy/trunk/build.xml
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/build.xml?rev=320764&r1=320763&r2=320764&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/build.xml (original)
+++ jakarta/commons/sandbox/proxy/trunk/build.xml Thu Oct 13 06:26:06 2005
@@ -66,6 +66,7 @@
         <runtime-dependency groupId="axis" artifactId="axis-jaxrpc" version="1.2.1" />
         <runtime-dependency groupId="axis" artifactId="axis-saaj" version="1.2.1" />
         <runtime-dependency groupId="axis" artifactId="axis-wsdl4j" version="1.5.1" />
+        <runtime-dependency groupId="concurrent" version="1.3.4" />
         <runtime-dependency groupId="log4j" version="1.2.9" />
         <runtime-dependency groupId="commons-discovery" version="0.2" />
         <runtime-dependency groupId="javassist" version="3.0"/>

Modified: jakarta/commons/sandbox/proxy/trunk/commons-proxy.iml
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/commons-proxy.iml?rev=320764&r1=320763&r2=320764&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/commons-proxy.iml (original)
+++ jakarta/commons/sandbox/proxy/trunk/commons-proxy.iml Thu Oct 13 06:26:06 2005
@@ -147,6 +147,15 @@
         <SOURCES />
       </library>
     </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/lib/runtime/concurrent/concurrent.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
     <orderEntryProperties />
   </component>
 </module>

Modified: jakarta/commons/sandbox/proxy/trunk/commons-proxy.ipr
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/commons-proxy.ipr?rev=320764&r1=320763&r2=320764&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/commons-proxy.ipr (original)
+++ jakarta/commons/sandbox/proxy/trunk/commons-proxy.ipr Thu Oct 13 06:26:06 2005
@@ -55,7 +55,7 @@
     <option name="DEBUGGING_INFO" value="true" />
     <option name="GENERATE_NO_WARNINGS" value="false" />
     <option name="DEPRECATION" value="true" />
-    <option name="ADDITIONAL_OPTIONS_STRING" value="" />
+    <option name="ADDITIONAL_OPTIONS_STRING" value="-target 1.3" />
     <option name="MAXIMUM_HEAP_SIZE" value="128" />
   </component>
   <component name="JavadocGenerationManager">
@@ -191,7 +191,7 @@
       <module fileurl="file://$PROJECT_DIR$/commons-proxy.iml" filepath="$PROJECT_DIR$/commons-proxy.iml" />
     </modules>
   </component>
-  <component name="ProjectRootManager" version="2" assert-keyword="true" jdk-15="true" project-jdk-name="1.5.0_04" />
+  <component name="ProjectRootManager" version="2" assert-keyword="false" jdk-15="false" project-jdk-name="java version &quot;1.4.2_08&quot;" />
   <component name="RmicSettings">
     <option name="IS_EANABLED" value="true" />
     <option name="DEBUGGING_INFO" value="true" />

Added: jakarta/commons/sandbox/proxy/trunk/maven.xml
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/maven.xml?rev=320764&view=auto
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/maven.xml (added)
+++ jakarta/commons/sandbox/proxy/trunk/maven.xml Thu Oct 13 06:26:06 2005
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+   Copyright 2005 The Apache Software Foundation
+
+   Licensed 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.
+-->
+<project xmlns:j="jelly:core" xmlns:ant="jelly:ant" xmlns:u="jelly:util">
+  <postGoal name="test:compile">
+       <!-- Compile RMI stubs  -->
+       <rmic base="${maven.test.dest}" includes="**/Rmi*Impl.class" />
+    </postGoal>
+</project>
\ No newline at end of file

Propchange: jakarta/commons/sandbox/proxy/trunk/maven.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/sandbox/proxy/trunk/maven.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: jakarta/commons/sandbox/proxy/trunk/project.properties
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/project.properties?rev=320764&r1=320763&r2=320764&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/project.properties (original)
+++ jakarta/commons/sandbox/proxy/trunk/project.properties Thu Oct 13 06:26:06 2005
@@ -97,4 +97,4 @@
 # maven.javadoc.links = http://foo/bar/api,\
 #                       http://flim/flam/api/
 ######################################################################
-maven.javadoc.links=http://java.sun.com/j2se/1.5.0/docs/api/,http://aopalliance.sourceforge.net/doc
\ No newline at end of file
+maven.javadoc.links=http://java.sun.com/j2se/1.5.0/docs/api/,http://aopalliance.sourceforge.net/doc

Modified: jakarta/commons/sandbox/proxy/trunk/project.xml
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/project.xml?rev=320764&r1=320763&r2=320764&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/project.xml (original)
+++ jakarta/commons/sandbox/proxy/trunk/project.xml Thu Oct 13 06:26:06 2005
@@ -241,6 +241,15 @@
                 <comment>discovery API</comment>
             </properties>
         </dependency>
+        <dependency>
+            <groupId>concurrent</groupId>
+            <artifactId>concurrent</artifactId>
+            <version>1.3.4</version>
+            <url>http://gee.cs.oswego.edu/dl/cpj/</url>
+            <properties>
+                <comment>Doug Lea's Concurrency API</comment>
+            </properties>
+        </dependency>
     </dependencies>
 
     <build>

Modified: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/ProxyFactory.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/ProxyFactory.java?rev=320764&r1=320763&r2=320764&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/ProxyFactory.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/ProxyFactory.java Thu Oct 13 06:26:06 2005
@@ -42,7 +42,7 @@
      * @param proxyClasses     the interfaces that the proxy should implement
      * @return a proxy which delegates to the object provided by the target object provider
      */
-    public Object createDelegatorProxy( ObjectProvider delegateProvider, Class... proxyClasses );
+    public Object createDelegatorProxy( ObjectProvider delegateProvider, Class[] proxyClasses );
 
     /**
      * Creates a proxy which delegates to the object provided by <code>delegateProvider</code>.
@@ -53,7 +53,7 @@
      * @return a proxy which delegates to the object provided by the target <code>delegateProvider>
      */
     public Object createDelegatorProxy( ClassLoader classLoader, ObjectProvider delegateProvider,
-                                        Class... proxyClasses );
+                                        Class[] proxyClasses );
 
     /**
      * Creates a proxy which passes through a {@link MethodInterceptor method interceptor} before eventually reaching
@@ -65,7 +65,7 @@
      * @return a proxy which passes through a {@link MethodInterceptor method interceptor} before eventually reaching
      *         the <code>target</code> object.
      */
-    public Object createInterceptorProxy( Object target, MethodInterceptor interceptor, Class... proxyClasses );
+    public Object createInterceptorProxy( Object target, MethodInterceptor interceptor, Class[] proxyClasses );
 
     /**
      * Creates a proxy which passes through a {@link org.aopalliance.intercept.MethodInterceptor method interceptor}
@@ -79,7 +79,7 @@
      *         before eventually reaching the <code>target</code> object.
      */
     public Object createInterceptorProxy( ClassLoader classLoader, Object target, MethodInterceptor interceptor,
-                                          Class... proxyClasses );
+                                          Class[] proxyClasses );
 
     /**
      * Creates a proxy which uses the provided {@link InvocationHandler} to handle all method invocations.  The proxy
@@ -89,7 +89,7 @@
      * @param proxyClasses      the interfaces that the proxy should implement
      * @return a proxy which uses the provided {@link InvocationHandler} to handle all method invocations
      */
-    public Object createInvocationHandlerProxy( InvocationHandler invocationHandler, Class... proxyClasses );
+    public Object createInvocationHandlerProxy( InvocationHandler invocationHandler, Class[] proxyClasses );
 
     /**
      * Creates a proxy which uses the provided {@link InvocationHandler} to handle all method invocations.
@@ -100,7 +100,7 @@
      * @return a proxy which uses the provided {@link InvocationHandler} to handle all method invocations
      */
     public Object createInvocationHandlerProxy( ClassLoader classLoader, InvocationHandler invocationHandler,
-                                                Class... proxyClasses );
+                                                Class[] proxyClasses );
 
     /**
      * Returns true if this proxy factory can generate a proxy class which extends/implements
@@ -110,6 +110,6 @@
      * @return true if this proxy factory can generate a proxy class which extends/implements
      *         the <code>proxyClasses</code>.
      */
-    public boolean canProxy( Class... proxyClasses );
+    public boolean canProxy( Class[] proxyClasses );
 }
 

Modified: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/ProxyUtils.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/ProxyUtils.java?rev=320764&r1=320763&r2=320764&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/ProxyUtils.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/ProxyUtils.java Thu Oct 13 06:26:06 2005
@@ -18,9 +18,9 @@
 
 import org.apache.commons.proxy.handler.NullInvocationHandler;
 
-import java.util.List;
 import java.util.ArrayList;
 import java.util.Iterator;
+import java.util.List;
 
 /**
  * @author James Carman
@@ -34,7 +34,7 @@
      * @param proxyClasses the proxy interfaces
      * @return a "null object" which implements the <code>proxyClasses</code>.
      */
-    public static Object createNullObject( ProxyFactory proxyFactory, Class... proxyClasses )
+    public static Object createNullObject( ProxyFactory proxyFactory, Class[] proxyClasses )
     {
         return proxyFactory.createInvocationHandlerProxy( new NullInvocationHandler(), proxyClasses );
     }
@@ -46,7 +46,7 @@
      * @param proxyClasses the proxy interfaces
      * @return a "null object" which implements the <code>proxyClasses</code>.
      */
-    public static Object createNullObject( ProxyFactory proxyFactory, ClassLoader classLoader, Class... proxyClasses )
+    public static Object createNullObject( ProxyFactory proxyFactory, ClassLoader classLoader, Class[] proxyClasses )
     {
         return proxyFactory.createInvocationHandlerProxy( classLoader, new NullInvocationHandler(), proxyClasses );
     }
@@ -70,17 +70,27 @@
      */
     public static Class[] getAllInterfaces( Class cls )
     {
-        final List<Class> interfaces = getAllInterfacesImpl( cls );
+        final List interfaces = getAllInterfacesImpl( cls );
         return ( Class[] ) interfaces.toArray( new Class[interfaces.size()] );
     }
 
-    private static List<Class> getAllInterfacesImpl( Class cls )
+    public static Class[] toClassArray( Class c0 )
+    {
+        return new Class[] { c0 };
+    }
+
+    public static Object[] toObjectArray( Object o0 )
+    {
+        return new Object[] { o0 };
+    }
+
+    private static List getAllInterfacesImpl( Class cls )
     {
         if( cls == null )
         {
             return null;
         }
-        List<Class> list = new ArrayList<Class>();
+        List list = new ArrayList();
         while( cls != null )
         {
             Class[] interfaces = cls.getInterfaces();

Modified: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/cglib/CglibProxyFactory.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/cglib/CglibProxyFactory.java?rev=320764&r1=320763&r2=320764&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/cglib/CglibProxyFactory.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/cglib/CglibProxyFactory.java Thu Oct 13 06:26:06 2005
@@ -42,7 +42,7 @@
 //----------------------------------------------------------------------------------------------------------------------
 
     public Object createDelegatorProxy( ClassLoader classLoader, ObjectProvider targetProvider,
-                                        Class... proxyClasses )
+                                        Class[] proxyClasses )
     {
         final Enhancer enhancer = new Enhancer();
         enhancer.setClassLoader( classLoader );
@@ -53,7 +53,7 @@
     }
 
     public Object createInterceptorProxy( ClassLoader classLoader, Object target, MethodInterceptor interceptor,
-                                          Class... proxyClasses )
+                                          Class[] proxyClasses )
     {
         final Enhancer enhancer = new Enhancer();
         enhancer.setClassLoader( classLoader );
@@ -64,7 +64,7 @@
     }
 
     public Object createInvocationHandlerProxy( ClassLoader classLoader, InvocationHandler invocationHandler,
-                                                Class... proxyClasses )
+                                                Class[] proxyClasses )
     {
         final Enhancer enhancer = new Enhancer();
         enhancer.setClassLoader( classLoader );

Modified: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/javassist/JavassistMethodInvocation.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/javassist/JavassistMethodInvocation.java?rev=320764&r1=320763&r2=320764&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/javassist/JavassistMethodInvocation.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/javassist/JavassistMethodInvocation.java Thu Oct 13 06:26:06 2005
@@ -39,7 +39,7 @@
 // Fields
 //----------------------------------------------------------------------------------------------------------------------
 
-    private static WeakHashMap<ClassLoader, Map<String, WeakReference<Class>>> loaderToClassCache = new WeakHashMap<ClassLoader, Map<String, WeakReference<Class>>>();
+    private static WeakHashMap loaderToClassCache = new WeakHashMap();
     protected final Method method;
     protected final Object target;
     protected final Object[] arguments;
@@ -51,36 +51,36 @@
     public synchronized static Class getMethodInvocationClass( ClassLoader classLoader, Method interfaceMethod )
             throws CannotCompileException
     {
-        final Map<String, WeakReference<Class>> classCache = getClassCache( classLoader );
+        final Map classCache = getClassCache( classLoader );
         final String key = toClassCacheKey( interfaceMethod );
-        final WeakReference<Class> invocationClassRef = classCache.get( key );
+        final WeakReference invocationClassRef = ( WeakReference )classCache.get( key );
         Class invocationClass;
         if( invocationClassRef == null )
         {
             invocationClass = createInvocationClass( classLoader, interfaceMethod );
-            classCache.put( key, new WeakReference<Class>( invocationClass ) );
+            classCache.put( key, new WeakReference( invocationClass ) );
         }
         else
         {
             synchronized( invocationClassRef )
             {
-                invocationClass = invocationClassRef.get();
+                invocationClass = ( Class )invocationClassRef.get();
                 if( invocationClass == null )
                 {
                     invocationClass = createInvocationClass( classLoader, interfaceMethod );
-                    classCache.put( key, new WeakReference<Class>( invocationClass ) );
+                    classCache.put( key, new WeakReference( invocationClass ) );
                 }
             }
         }
         return invocationClass;
     }
 
-    private static Map<String, WeakReference<Class>> getClassCache( ClassLoader classLoader )
+    private static Map getClassCache( ClassLoader classLoader )
     {
-        Map<String, WeakReference<Class>> cache = loaderToClassCache.get( classLoader );
+        Map cache = ( Map )loaderToClassCache.get( classLoader );
         if( cache == null )
         {
-            cache = new HashMap<String, WeakReference<Class>>();
+            cache = new HashMap();
             loaderToClassCache.put( classLoader, cache );
         }
         return cache;
@@ -91,12 +91,19 @@
         return String.valueOf( method );
     }
 
+    private static String getSimpleName( Class c )
+    {
+        final String name = c.getName();
+        final int ndx = name.lastIndexOf( '.' );
+        return ndx == -1 ? name : name.substring( ndx + 1 );
+    }
+
     private static Class createInvocationClass( ClassLoader classLoader, Method interfaceMethod )
             throws CannotCompileException
     {
         Class invocationClass;
         final CtClass ctClass = JavassistUtils.createClass(
-                interfaceMethod.getDeclaringClass().getSimpleName() + "_" + interfaceMethod.getName() +
+                getSimpleName( interfaceMethod.getDeclaringClass() ) + "_" + interfaceMethod.getName() +
                 "_invocation",
                 JavassistMethodInvocation.class );
         final CtConstructor constructor = new CtConstructor(

Modified: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/javassist/JavassistProxyFactory.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/javassist/JavassistProxyFactory.java?rev=320764&r1=320763&r2=320764&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/javassist/JavassistProxyFactory.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/javassist/JavassistProxyFactory.java Thu Oct 13 06:26:06 2005
@@ -22,6 +22,7 @@
 import javassist.CtMethod;
 import org.aopalliance.intercept.MethodInterceptor;
 import org.apache.commons.proxy.ObjectProvider;
+import org.apache.commons.proxy.ProxyUtils;
 import org.apache.commons.proxy.exception.ProxyFactoryException;
 import org.apache.commons.proxy.factory.util.AbstractProxyClassGenerator;
 import org.apache.commons.proxy.factory.util.AbstractSubclassingProxyFactory;
@@ -54,12 +55,12 @@
 //----------------------------------------------------------------------------------------------------------------------
 
     public Object createDelegatorProxy( ClassLoader classLoader, ObjectProvider targetProvider,
-                                        Class... proxyClasses )
+                                        Class[] proxyClasses )
     {
         try
         {
             final Class clazz = delegatingProxyClassCache.getProxyClass( classLoader, proxyClasses );
-            return clazz.getConstructor( ObjectProvider.class ).newInstance( targetProvider );
+            return clazz.getConstructor( ProxyUtils.toClassArray( ObjectProvider.class ) ).newInstance( ProxyUtils.toObjectArray( targetProvider ) );
         }
         catch( Exception e )
         {
@@ -68,14 +69,14 @@
     }
 
     public Object createInterceptorProxy( ClassLoader classLoader, Object target, MethodInterceptor interceptor,
-                                          Class... proxyClasses )
+                                          Class[] proxyClasses )
     {
         try
         {
             final Class clazz = interceptingProxyClassCache.getProxyClass( classLoader, proxyClasses );
             final Method[] methods = AbstractProxyClassGenerator.getImplementationMethods( proxyClasses );
-            return clazz.getConstructor( Method[].class, Object.class, MethodInterceptor.class )
-                    .newInstance( methods, target, interceptor );
+            return clazz.getConstructor( new Class[] { Method[].class, Object.class, MethodInterceptor.class } )
+                    .newInstance( new Object[] { methods, target, interceptor } );
         }
         catch( Exception e )
         {
@@ -84,14 +85,14 @@
     }
 
     public Object createInvocationHandlerProxy( ClassLoader classLoader, InvocationHandler invocationHandler,
-                                                Class... proxyClasses )
+                                                Class[] proxyClasses )
     {
         try
         {
             final Class clazz = invocationHandlerProxyClassCache.getProxyClass( classLoader, proxyClasses );
             final Method[] methods = AbstractProxyClassGenerator.getImplementationMethods( proxyClasses );
-            return clazz.getConstructor( Method[].class, InvocationHandler.class )
-                    .newInstance( methods, invocationHandler );
+            return clazz.getConstructor( new Class[] { Method[].class, InvocationHandler.class } )
+                    .newInstance( new Object[] { methods, invocationHandler } );
         }
         catch( Exception e )
         {
@@ -105,7 +106,7 @@
 
     private static class InvocationHandlerProxyClassGenerator extends AbstractProxyClassGenerator
     {
-        public Class generateProxyClass( ClassLoader classLoader, Class... proxyClasses )
+        public Class generateProxyClass( ClassLoader classLoader, Class[] proxyClasses )
         {
             try
             {
@@ -143,7 +144,7 @@
 
     private static class InterceptingProxyClassGenerator extends AbstractProxyClassGenerator
     {
-        public Class generateProxyClass( ClassLoader classLoader, Class... proxyClasses )
+        public Class generateProxyClass( ClassLoader classLoader, Class[] proxyClasses )
         {
             try
             {
@@ -184,7 +185,7 @@
 
     private static class DelegatingProxyClassGenerator extends AbstractProxyClassGenerator
     {
-        public Class generateProxyClass( ClassLoader classLoader, Class... proxyClasses )
+        public Class generateProxyClass( ClassLoader classLoader, Class[] proxyClasses )
         {
             try
             {

Modified: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/javassist/JavassistUtils.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/javassist/JavassistUtils.java?rev=320764&r1=320763&r2=320764&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/javassist/JavassistUtils.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/javassist/JavassistUtils.java Thu Oct 13 06:26:06 2005
@@ -69,7 +69,7 @@
         return inputClass.getName();
     }
 
-    public static void addInterfaces( CtClass ctClass, Class... proxyClasses )
+    public static void addInterfaces( CtClass ctClass, Class[] proxyClasses )
     {
         for( int i = 0; i < proxyClasses.length; i++ )
         {

Modified: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/AbstractInvocationHandler.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/AbstractInvocationHandler.java?rev=320764&r1=320763&r2=320764&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/AbstractInvocationHandler.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/AbstractInvocationHandler.java Thu Oct 13 06:26:06 2005
@@ -37,7 +37,7 @@
      * @param proxyClasses the proxy interfaces
      * @return a proxy object which implements the specified proxy interfaces
      */
-    public Object createProxy( Class... proxyClasses )
+    public Object createProxy( Class[] proxyClasses )
     {
         return createProxy( Thread.currentThread().getContextClassLoader(), proxyClasses );
     }
@@ -49,7 +49,7 @@
      * @param proxyClasses the proxy interfaces
      * @return a proxy object which implements the specified proxy interfaces, using the specified class loader.
      */
-    public Object createProxy( ClassLoader classLoader, Class... proxyClasses )
+    public Object createProxy( ClassLoader classLoader, Class[] proxyClasses )
     {
         return Proxy.newProxyInstance( classLoader, proxyClasses, this );
     }

Modified: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/ReflectionProxyFactory.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/ReflectionProxyFactory.java?rev=320764&r1=320763&r2=320764&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/ReflectionProxyFactory.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/ReflectionProxyFactory.java Thu Oct 13 06:26:06 2005
@@ -36,21 +36,21 @@
 //----------------------------------------------------------------------------------------------------------------------
 
     public Object createDelegatorProxy( ClassLoader classLoader, ObjectProvider targetProvider,
-                                        Class... proxyClasses )
+                                        Class[] proxyClasses )
     {
         return Proxy.newProxyInstance( classLoader, proxyClasses,
                                        new DelegateProviderInvocationHandler( targetProvider ) );
     }
 
     public Object createInterceptorProxy( ClassLoader classLoader, Object target, MethodInterceptor interceptor,
-                                          Class... proxyClasses )
+                                          Class[] proxyClasses )
     {
         return new MethodInterceptorInvocationHandler( target, interceptor )
                 .createProxy( classLoader, proxyClasses );
     }
 
     public Object createInvocationHandlerProxy( ClassLoader classLoader, InvocationHandler invocationHandler,
-                                                Class... proxyClasses )
+                                                Class[] proxyClasses )
     {
         return Proxy.newProxyInstance( classLoader, proxyClasses, invocationHandler );
     }

Modified: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/util/AbstractProxyClassGenerator.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/util/AbstractProxyClassGenerator.java?rev=320764&r1=320763&r2=320764&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/util/AbstractProxyClassGenerator.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/util/AbstractProxyClassGenerator.java Thu Oct 13 06:26:06 2005
@@ -21,6 +21,7 @@
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
 
@@ -44,10 +45,10 @@
      * @param proxyClasses the interfaces the proxy class must implement
      * @return all methods that the proxy class must implement
      */
-    public static Method[] getImplementationMethods( Class... proxyClasses )
+    public static Method[] getImplementationMethods( Class[] proxyClasses )
     {
-        final Map<MethodSignature, Method> signatureMethodMap = new HashMap<MethodSignature, Method>();
-        final Set<MethodSignature> finalizedSignatures = new HashSet<MethodSignature>();
+        final Map signatureMethodMap = new HashMap();
+        final Set finalizedSignatures = new HashSet();
         for( int i = 0; i < proxyClasses.length; i++ )
         {
             Class proxyInterface = proxyClasses[i];
@@ -65,13 +66,13 @@
                 }
             }
         }
-        final Collection<Method> resultingMethods = signatureMethodMap.values();
-        for( MethodSignature signature : finalizedSignatures )
+        final Collection resultingMethods = signatureMethodMap.values();
+        for( Iterator i = finalizedSignatures.iterator(); i.hasNext(); )
         {
+            MethodSignature signature = ( MethodSignature ) i.next();
             resultingMethods.remove( signatureMethodMap.get( signature ) );
         }
-        final Method[] results = new Method[resultingMethods.size()];
-        return resultingMethods.toArray( results );
+        return ( Method[] ) resultingMethods.toArray( new Method[resultingMethods.size()] );
     }
 }
 

Modified: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/util/AbstractProxyFactory.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/util/AbstractProxyFactory.java?rev=320764&r1=320763&r2=320764&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/util/AbstractProxyFactory.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/util/AbstractProxyFactory.java Thu Oct 13 06:26:06 2005
@@ -40,7 +40,7 @@
      * @param proxyClasses the proxy classes
      * @return true if all <code>proxyClasses</code> are interfaces
      */
-    public boolean canProxy( Class... proxyClasses )
+    public boolean canProxy( Class[] proxyClasses )
     {
         for( int i = 0; i < proxyClasses.length; i++ )
         {
@@ -53,19 +53,19 @@
         return true;
     }
 
-    public final Object createDelegatorProxy( ObjectProvider targetProvider, Class... proxyClasses )
+    public final Object createDelegatorProxy( ObjectProvider targetProvider, Class[] proxyClasses )
     {
         return createDelegatorProxy( Thread.currentThread().getContextClassLoader(), targetProvider, proxyClasses );
     }
 
     public final Object createInterceptorProxy( Object target, MethodInterceptor interceptor,
-                                                Class... proxyClasses )
+                                                Class[] proxyClasses )
     {
         return createInterceptorProxy( Thread.currentThread().getContextClassLoader(), target, interceptor,
                                        proxyClasses );
     }
 
-    public final Object createInvocationHandlerProxy( InvocationHandler invocationHandler, Class... proxyClasses )
+    public final Object createInvocationHandlerProxy( InvocationHandler invocationHandler, Class[] proxyClasses )
     {
         return createInvocationHandlerProxy( Thread.currentThread().getContextClassLoader(), invocationHandler,
                                              proxyClasses );

Modified: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/util/AbstractSubclassingProxyFactory.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/util/AbstractSubclassingProxyFactory.java?rev=320764&r1=320763&r2=320764&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/util/AbstractSubclassingProxyFactory.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/util/AbstractSubclassingProxyFactory.java Thu Oct 13 06:26:06 2005
@@ -36,8 +36,10 @@
 
     private static boolean hasSuitableDefaultConstructor( Class superclass )
     {
-        for( Constructor constructor : superclass.getDeclaredConstructors() )
+        final Constructor[] declaredConstructors = superclass.getDeclaredConstructors();
+        for( int i = 0; i < declaredConstructors.length; i++ )
         {
+            Constructor constructor = declaredConstructors[i];
             if( constructor.getParameterTypes().length == 0 && ( Modifier.isPublic( constructor.getModifiers() ) ||
                                                                  Modifier.isProtected( constructor.getModifiers() ) ) )
             {
@@ -53,9 +55,9 @@
      * @param proxyClasses the proxy classes
      * @return the <code>proxyClasses</code> transformed into an array of only the interface classes
      */
-    protected static Class[] toInterfaces( Class... proxyClasses )
+    protected static Class[] toInterfaces( Class[] proxyClasses )
     {
-        final Collection<Class> interfaces = new LinkedList<Class>();
+        final Collection interfaces = new LinkedList();
         for( int i = 0; i < proxyClasses.length; i++ )
         {
             Class proxyInterface = proxyClasses[i];
@@ -67,9 +69,9 @@
         return ( Class[] ) interfaces.toArray( new Class[interfaces.size()] );
     }
 
-    private static Class[] toNonInterfaces( Class... proxyClasses )
+    private static Class[] toNonInterfaces( Class[] proxyClasses )
     {
-        final List<Class> superclasses = new LinkedList<Class>();
+        final List superclasses = new LinkedList();
         for( int i = 0; i < proxyClasses.length; i++ )
         {
             Class proxyClass = proxyClasses[i];
@@ -91,7 +93,7 @@
      * @param proxyClasses the proxy classes
      * @return true if a suitable superclass can be found, given the desired <code>proxyClasses</code>
      */
-    public boolean canProxy( Class... proxyClasses )
+    public boolean canProxy( Class[] proxyClasses )
     {
         try
         {
@@ -114,7 +116,7 @@
      * @throws ProxyFactoryException if multiple non-interface classes are contained in <code>proxyClasses</code> or any
      *                               of the non-interface classes are final
      */
-    public static Class getSuperclass( Class... proxyClasses )
+    public static Class getSuperclass( Class[] proxyClasses )
     {
         final Class[] superclasses = toNonInterfaces( proxyClasses );
         switch( superclasses.length )

Modified: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/util/MethodSignature.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/util/MethodSignature.java?rev=320764&r1=320763&r2=320764&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/util/MethodSignature.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/util/MethodSignature.java Thu Oct 13 06:26:06 2005
@@ -31,7 +31,7 @@
 //----------------------------------------------------------------------------------------------------------------------
 
     private final String name;
-    private final List<Class> parameterTypes;
+    private final List parameterTypes;
 
 //----------------------------------------------------------------------------------------------------------------------
 // Constructors
@@ -40,7 +40,7 @@
     public MethodSignature( Method method )
     {
         this.name = method.getName();
-        this.parameterTypes = Arrays.<Class>asList( method.getParameterTypes() );
+        this.parameterTypes = Arrays.asList( method.getParameterTypes() );
     }
 
 //----------------------------------------------------------------------------------------------------------------------

Modified: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/util/ProxyClassCache.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/util/ProxyClassCache.java?rev=320764&r1=320763&r2=320764&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/util/ProxyClassCache.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/util/ProxyClassCache.java Thu Oct 13 06:26:06 2005
@@ -31,7 +31,7 @@
 // Fields
 //----------------------------------------------------------------------------------------------------------------------
 
-    private final Map<ClassLoader, Map<String, WeakReference<Class>>> loaderToClassCache = new WeakHashMap<ClassLoader, Map<String, WeakReference<Class>>>();
+    private final Map loaderToClassCache = new WeakHashMap();
     private final ProxyClassGenerator proxyClassGenerator;
 
 //----------------------------------------------------------------------------------------------------------------------
@@ -47,44 +47,44 @@
 // Other Methods
 //----------------------------------------------------------------------------------------------------------------------
 
-    public synchronized Class getProxyClass( ClassLoader classLoader, Class... proxyClasses )
+    public synchronized Class getProxyClass( ClassLoader classLoader, Class[] proxyClasses )
     {
-        final Map<String, WeakReference<Class>> classCache = getClassCache( classLoader );
+        final Map classCache = getClassCache( classLoader );
         final String key = toClassCacheKey( proxyClasses );
         Class proxyClass;
-        WeakReference<Class> proxyClassReference = classCache.get( key );
+        WeakReference proxyClassReference = ( WeakReference )classCache.get( key );
         if( proxyClassReference == null )
         {
             proxyClass = proxyClassGenerator.generateProxyClass( classLoader, proxyClasses );
-            classCache.put( key, new WeakReference<Class>( proxyClass ) );
+            classCache.put( key, new WeakReference( proxyClass ) );
         }
         else
         {
             synchronized( proxyClassReference )
             {
-                proxyClass = proxyClassReference.get();
+                proxyClass = ( Class )proxyClassReference.get();
                 if( proxyClass == null )
                 {
                     proxyClass = proxyClassGenerator.generateProxyClass( classLoader, proxyClasses );
-                    classCache.put( key, new WeakReference<Class>( proxyClass ) );
+                    classCache.put( key, new WeakReference( proxyClass ) );
                 }
             }
         }
         return proxyClass;
     }
 
-    private Map<String, WeakReference<Class>> getClassCache( ClassLoader classLoader )
+    private Map getClassCache( ClassLoader classLoader )
     {
-        Map<String, WeakReference<Class>> cache = loaderToClassCache.get( classLoader );
+        Map cache = ( Map )loaderToClassCache.get( classLoader );
         if( cache == null )
         {
-            cache = new HashMap<String, WeakReference<Class>>();
+            cache = new HashMap();
             loaderToClassCache.put( classLoader, cache );
         }
         return cache;
     }
 
-    private String toClassCacheKey( Class... proxyClasses )
+    private String toClassCacheKey( Class[] proxyClasses )
     {
         final StringBuffer sb = new StringBuffer();
         for( int i = 0; i < proxyClasses.length; i++ )

Modified: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/util/ProxyClassGenerator.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/util/ProxyClassGenerator.java?rev=320764&r1=320763&r2=320764&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/util/ProxyClassGenerator.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/util/ProxyClassGenerator.java Thu Oct 13 06:26:06 2005
@@ -26,6 +26,6 @@
 // Other Methods
 //----------------------------------------------------------------------------------------------------------------------
 
-    public Class generateProxyClass( ClassLoader classLoader, Class... proxyClasses );
+    public Class generateProxyClass( ClassLoader classLoader, Class[] proxyClasses );
 }
 

Modified: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/handler/NullInvocationHandler.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/handler/NullInvocationHandler.java?rev=320764&r1=320763&r2=320764&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/handler/NullInvocationHandler.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/handler/NullInvocationHandler.java Thu Oct 13 06:26:06 2005
@@ -30,7 +30,7 @@
  */
 public class NullInvocationHandler implements InvocationHandler
 {
-    private static Map<Class,Object> primitiveValueMap = new HashMap<Class,Object>();
+    private static Map primitiveValueMap = new HashMap();
     static
     {
         primitiveValueMap.put( Integer.TYPE, new Integer( 0 ) );
@@ -48,7 +48,7 @@
 
     public Object invoke( Object proxy, Method method, Object[] args ) throws Throwable
     {
-        final Class<?> returnType = method.getReturnType();
+        final Class returnType = method.getReturnType();
         if( returnType.isPrimitive() )
         {
             return primitiveValueMap.get( returnType );

Modified: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/ExecutorMethodInterceptor.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/ExecutorMethodInterceptor.java?rev=320764&r1=320763&r2=320764&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/ExecutorMethodInterceptor.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/ExecutorMethodInterceptor.java Thu Oct 13 06:26:06 2005
@@ -16,10 +16,9 @@
  */
 package org.apache.commons.proxy.interceptor;
 
-import org.aopalliance.intercept.MethodInvocation;
+import EDU.oswego.cs.dl.util.concurrent.Executor;
 import org.aopalliance.intercept.MethodInterceptor;
-
-import java.util.concurrent.Executor;
+import org.aopalliance.intercept.MethodInvocation;
 
 /**
  * A method interceptor that uses an {@link Executor} to execute the method invocation.

Modified: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/MethodInterceptorChain.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/MethodInterceptorChain.java?rev=320764&r1=320763&r2=320764&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/MethodInterceptorChain.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/MethodInterceptorChain.java Thu Oct 13 06:26:06 2005
@@ -39,7 +39,7 @@
 // Constructors
 //----------------------------------------------------------------------------------------------------------------------
 
-    public MethodInterceptorChain( MethodInterceptor... interceptors )
+    public MethodInterceptorChain( MethodInterceptor[] interceptors )
     {
         this.interceptors = interceptors;
     }
@@ -49,7 +49,7 @@
 //----------------------------------------------------------------------------------------------------------------------
 
     private Object createProxy( ProxyFactory proxyFactory, ClassLoader classLoader, Object terminus,
-                                Class... proxyClasses )
+                                Class[] proxyClasses )
     {
         Object currentTarget = terminus;
         for( int i = interceptors.length - 1; i >= 0; --i )
@@ -60,16 +60,19 @@
         return currentTarget;
     }
 
-    public ObjectProvider createProxyProvider( ProxyFactory proxyFactory, Object terminus, Class... proxyClasses )
+    public ObjectProvider createProxyProvider( ProxyFactory proxyFactory, Object terminus )
+    {
+        return createProxyProvider( proxyFactory, terminus, new Class[] {} );
+    }
+
+    public ObjectProvider createProxyProvider( ProxyFactory proxyFactory, Object terminus, Class[] proxyClasses )
     {
         return createProxyProvider( proxyFactory, Thread.currentThread().getContextClassLoader(), terminus,
                                     proxyClasses );
     }
 
-
-
     public ObjectProvider createProxyProvider( ProxyFactory proxyFactory, ClassLoader classLoader, Object terminus,
-                                               Class... proxyClasses )
+                                               Class[] proxyClasses )
     {
         if( proxyClasses.length == 0 )
         {

Modified: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/filter/ReturnTypeFilter.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/filter/ReturnTypeFilter.java?rev=320764&r1=320763&r2=320764&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/filter/ReturnTypeFilter.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/filter/ReturnTypeFilter.java Thu Oct 13 06:26:06 2005
@@ -18,11 +18,11 @@
 
 import org.apache.commons.proxy.interceptor.MethodFilter;
 
-import java.util.Set;
-import java.util.HashSet;
+import java.lang.reflect.Method;
 import java.util.Arrays;
 import java.util.Collection;
-import java.lang.reflect.Method;
+import java.util.HashSet;
+import java.util.Set;
 
 /**
  * Filters methods based on their return type.
@@ -31,14 +31,14 @@
  */
 public class ReturnTypeFilter implements MethodFilter
 {
-    private final Set<Class> validReturnTypes = new HashSet<Class>();
+    private final Set validReturnTypes = new HashSet();
 
-    public ReturnTypeFilter( Class... validReturnTypes )
+    public ReturnTypeFilter( Class[] validReturnTypes )
     {
         this( Arrays.asList( validReturnTypes ) );
     }
 
-    public ReturnTypeFilter( Collection<Class> validReturnTypes )
+    public ReturnTypeFilter( Collection validReturnTypes )
     {
         this.validReturnTypes.addAll( validReturnTypes );
     }

Modified: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/filter/SimpleMethodFilter.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/filter/SimpleMethodFilter.java?rev=320764&r1=320763&r2=320764&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/filter/SimpleMethodFilter.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/filter/SimpleMethodFilter.java Thu Oct 13 06:26:06 2005
@@ -35,15 +35,20 @@
 // Fields
 //----------------------------------------------------------------------------------------------------------------------
 
-    private final Set<String> methodNames;
+    private final Set methodNames;
 
 //----------------------------------------------------------------------------------------------------------------------
 // Constructors
 //----------------------------------------------------------------------------------------------------------------------
 
-    public SimpleMethodFilter( String... methodNames )
+    public SimpleMethodFilter()
     {
-        this.methodNames = new HashSet<String>( Arrays.asList( methodNames ) );
+        this.methodNames = new HashSet();
+    }
+    
+    public SimpleMethodFilter( String[] methodNames )
+    {
+        this.methodNames = new HashSet( Arrays.asList( methodNames ) );
     }
 
 //----------------------------------------------------------------------------------------------------------------------

Modified: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/BeanProvider.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/BeanProvider.java?rev=320764&r1=320763&r2=320764&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/BeanProvider.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/BeanProvider.java Thu Oct 13 06:26:06 2005
@@ -16,8 +16,8 @@
  */
 package org.apache.commons.proxy.provider;
 
-import org.apache.commons.proxy.exception.ObjectProviderException;
 import org.apache.commons.proxy.ObjectProvider;
+import org.apache.commons.proxy.exception.ObjectProviderException;
 
 /**
  * Uses <code>Class.newInstance()</code> to instantiate an object.

Modified: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/BurlapProvider.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/BurlapProvider.java?rev=320764&r1=320763&r2=320764&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/BurlapProvider.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/BurlapProvider.java Thu Oct 13 06:26:06 2005
@@ -17,8 +17,8 @@
 package org.apache.commons.proxy.provider;
 
 import com.caucho.burlap.client.BurlapProxyFactory;
-import org.apache.commons.proxy.exception.ObjectProviderException;
 import org.apache.commons.proxy.ObjectProvider;
+import org.apache.commons.proxy.exception.ObjectProviderException;
 
 import java.net.MalformedURLException;
 

Modified: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/HessianProvider.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/HessianProvider.java?rev=320764&r1=320763&r2=320764&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/HessianProvider.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/HessianProvider.java Thu Oct 13 06:26:06 2005
@@ -17,8 +17,8 @@
 package org.apache.commons.proxy.provider;
 
 import com.caucho.hessian.client.HessianProxyFactory;
-import org.apache.commons.proxy.exception.ObjectProviderException;
 import org.apache.commons.proxy.ObjectProvider;
+import org.apache.commons.proxy.exception.ObjectProviderException;
 
 import java.net.MalformedURLException;
 

Modified: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/JaxRpcProvider.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/JaxRpcProvider.java?rev=320764&r1=320763&r2=320764&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/JaxRpcProvider.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/JaxRpcProvider.java Thu Oct 13 06:26:06 2005
@@ -16,8 +16,8 @@
  */
 package org.apache.commons.proxy.provider;
 
-import org.apache.commons.proxy.exception.ObjectProviderException;
 import org.apache.commons.proxy.ObjectProvider;
+import org.apache.commons.proxy.exception.ObjectProviderException;
 
 import javax.xml.namespace.QName;
 import javax.xml.rpc.Service;

Modified: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/RmiProvider.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/RmiProvider.java?rev=320764&r1=320763&r2=320764&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/RmiProvider.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/RmiProvider.java Thu Oct 13 06:26:06 2005
@@ -16,8 +16,8 @@
  */
 package org.apache.commons.proxy.provider;
 
-import org.apache.commons.proxy.exception.ObjectProviderException;
 import org.apache.commons.proxy.ObjectProvider;
+import org.apache.commons.proxy.exception.ObjectProviderException;
 
 import java.rmi.AccessException;
 import java.rmi.NotBoundException;

Modified: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/SessionBeanProvider.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/SessionBeanProvider.java?rev=320764&r1=320763&r2=320764&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/SessionBeanProvider.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/SessionBeanProvider.java Thu Oct 13 06:26:06 2005
@@ -74,8 +74,8 @@
             final InitialContext initialContext = properties == null ? new InitialContext() :
                                                   new InitialContext( properties );
             Object homeObject = PortableRemoteObject.narrow( initialContext.lookup( jndiName ), homeInterface );
-            final Method createMethod = homeObject.getClass().getMethod( "create" );
-            return serviceInterface.cast( createMethod.invoke( homeObject ) );
+            final Method createMethod = homeObject.getClass().getMethod( "create", new Class[] {} );
+            return createMethod.invoke( homeObject, new Object[] {} );
         }
         catch( NoSuchMethodException e )
         {

Modified: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/cache/AbstractCache.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/cache/AbstractCache.java?rev=320764&r1=320763&r2=320764&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/cache/AbstractCache.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/cache/AbstractCache.java Thu Oct 13 06:26:06 2005
@@ -16,6 +16,7 @@
  */
 package org.apache.commons.proxy.provider.cache;
 
+import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.Map;
 
@@ -29,7 +30,7 @@
 // Abstract Methods
 //----------------------------------------------------------------------------------------------------------------------
 
-    protected abstract Map<Object, CachedObject> getCachedObjectMap();
+    protected abstract Map getCachedObjectMap();
 
 //----------------------------------------------------------------------------------------------------------------------
 // Cache Implementation
@@ -37,9 +38,11 @@
 
     public void clearCache()
     {
-        for( Object cacheKey : new LinkedList<Object>( getCachedObjectMap().keySet() ) )
+        final LinkedList cacheKeys = new LinkedList( getCachedObjectMap().keySet() );
+        for( Iterator i = cacheKeys.iterator(); i.hasNext(); )
         {
-            final CachedObject cachedObject = getCachedObjectMap().get( cacheKey );
+            Object cacheKey = i.next();
+            final CachedObject cachedObject = ( CachedObject )getCachedObjectMap().get( cacheKey );
             getCachedObjectMap().remove( cacheKey );
             if( cachedObject.getListener() != null )
             {
@@ -51,7 +54,7 @@
 
     public Object retrieveObject( Object key )
     {
-        CachedObject cachedObject = getCachedObjectMap().get( key );
+        CachedObject cachedObject = ( CachedObject )getCachedObjectMap().get( key );
         return cachedObject == null ? null : cachedObject.getObject();
     }
 

Modified: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/cache/SimpleCache.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/cache/SimpleCache.java?rev=320764&r1=320763&r2=320764&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/cache/SimpleCache.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/cache/SimpleCache.java Thu Oct 13 06:26:06 2005
@@ -30,13 +30,13 @@
 // Fields
 //----------------------------------------------------------------------------------------------------------------------
 
-    private final Map<Object, CachedObject> map = Collections.synchronizedMap( new HashMap<Object, CachedObject>() );
+    private final Map map = Collections.synchronizedMap( new HashMap() );
 
 //----------------------------------------------------------------------------------------------------------------------
 // Other Methods
 //----------------------------------------------------------------------------------------------------------------------
 
-    protected Map<Object, CachedObject> getCachedObjectMap()
+    protected Map getCachedObjectMap()
     {
         return map;
     }

Modified: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/cache/ThreadLocalCache.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/cache/ThreadLocalCache.java?rev=320764&r1=320763&r2=320764&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/cache/ThreadLocalCache.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/provider/cache/ThreadLocalCache.java Thu Oct 13 06:26:06 2005
@@ -29,18 +29,18 @@
 // Fields
 //----------------------------------------------------------------------------------------------------------------------
 
-    private ThreadLocal<Map<Object, CachedObject>> threadLocalMap = new ThreadLocal<Map<Object, CachedObject>>();
+    private ThreadLocal threadLocalMap = new ThreadLocal();
 
 //----------------------------------------------------------------------------------------------------------------------
 // Other Methods
 //----------------------------------------------------------------------------------------------------------------------
 
-    public Map<Object, CachedObject> getCachedObjectMap()
+    public Map getCachedObjectMap()
     {
-        Map<Object, CachedObject> map = threadLocalMap.get();
+        Map map = ( Map )threadLocalMap.get();
         if( map == null )
         {
-            map = new HashMap<Object, CachedObject>();
+            map = new HashMap();
             threadLocalMap.set( map );
         }
         return map;

Modified: jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/TestProxyUtils.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/TestProxyUtils.java?rev=320764&r1=320763&r2=320764&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/TestProxyUtils.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/TestProxyUtils.java Thu Oct 13 06:26:06 2005
@@ -23,7 +23,7 @@
 {
     public void testCreateNullObject() throws Exception
     {
-        final Echo nullEcho = ( Echo )ProxyUtils.createNullObject( new JavassistProxyFactory(), Echo.class );
+        final Echo nullEcho = ( Echo )ProxyUtils.createNullObject( new JavassistProxyFactory(),  new Class[] { Echo.class } );
         assertNull( nullEcho.echoBack( "hello" ) );
         assertNull( nullEcho.echoBack( "hello", "world" ) );
         assertEquals( ( int ) 0, nullEcho.echoBack( 12345 ) );
@@ -31,7 +31,7 @@
 
     public void testCreateNullObjectWithClassLoader() throws Exception
     {
-        final Echo nullEcho = ( Echo )ProxyUtils.createNullObject( new JavassistProxyFactory(), Echo.class.getClassLoader(), Echo.class );
+        final Echo nullEcho = ( Echo )ProxyUtils.createNullObject( new JavassistProxyFactory(), Echo.class.getClassLoader(),  new Class[] { Echo.class } );
         assertNull( nullEcho.echoBack( "hello" ) );
         assertNull( nullEcho.echoBack( "hello", "world" ) );
         assertEquals( ( int ) 0, nullEcho.echoBack( 12345 ) );

Modified: jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/exception/AbstractExceptionClassTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/exception/AbstractExceptionClassTestCase.java?rev=320764&r1=320763&r2=320764&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/exception/AbstractExceptionClassTestCase.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/exception/AbstractExceptionClassTestCase.java Thu Oct 13 06:26:06 2005
@@ -24,16 +24,16 @@
  */
 public abstract class AbstractExceptionClassTestCase extends TestCase
 {
-    private final Class<? extends Exception> exceptionClass;
+    private final Class exceptionClass;
 
-    public AbstractExceptionClassTestCase( Class<? extends Exception> exceptionClass )
+    public AbstractExceptionClassTestCase( Class exceptionClass )
     {
         this.exceptionClass = exceptionClass;
     }
 
     public void testNoArgConstructor() throws Exception
     {
-        Exception e = exceptionClass.getConstructor().newInstance();
+        Exception e = ( Exception )exceptionClass.getConstructor( new Class[] {} ).newInstance( new Object[] {} );
         assertNull( e.getMessage() );
         assertNull( e.getCause() );
     }
@@ -41,7 +41,7 @@
     public void testMessageOnlyConstructor() throws Exception
     {
         final String message = "message";
-        Exception e = exceptionClass.getConstructor( String.class ).newInstance( message );
+        Exception e = ( Exception )exceptionClass.getConstructor( new Class[] { String.class } ).newInstance( new Object[] { message } );
         assertEquals( message, e.getMessage() );
         assertNull( e.getCause() );
     }
@@ -49,7 +49,7 @@
     public void testCauseOnlyConstructor() throws Exception
     {
         final Exception cause = new Exception();
-        Exception e = exceptionClass.getConstructor( Throwable.class ).newInstance( cause );
+        Exception e = ( Exception )exceptionClass.getConstructor( new Class[] { Throwable.class } ).newInstance( new Object[] { cause } );
         assertEquals( cause.toString(), e.getMessage() );
         assertEquals( cause, e.getCause() );
     }
@@ -58,7 +58,7 @@
     {
         final Exception cause = new Exception();
         final String message = "message";
-        Exception e = exceptionClass.getConstructor( String.class, Throwable.class ).newInstance( message, cause );
+        Exception e = ( Exception )exceptionClass.getConstructor( new Class[] { String.class, Throwable.class } ).newInstance( new Object[] { message, cause } );
         assertEquals( message, e.getMessage() );
         assertEquals( cause, e.getCause() );
     }

Modified: jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/factory/AbstractProxyFactoryTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/factory/AbstractProxyFactoryTestCase.java?rev=320764&r1=320763&r2=320764&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/factory/AbstractProxyFactoryTestCase.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/factory/AbstractProxyFactoryTestCase.java Thu Oct 13 06:26:06 2005
@@ -17,8 +17,9 @@
 
 import org.aopalliance.intercept.MethodInterceptor;
 import org.aopalliance.intercept.MethodInvocation;
+import org.apache.commons.proxy.ObjectProvider;
 import org.apache.commons.proxy.ProxyFactory;
-import static org.apache.commons.proxy.provider.ProviderUtils.*;
+import org.apache.commons.proxy.provider.ProviderUtils;
 import org.apache.commons.proxy.util.AbstractTestCase;
 import org.apache.commons.proxy.util.DuplicateEcho;
 import org.apache.commons.proxy.util.Echo;
@@ -42,6 +43,7 @@
 public abstract class AbstractProxyFactoryTestCase extends AbstractTestCase
 {
     protected final ProxyFactory factory;
+    private static final Class[] ECHO_ONLY = new Class[] { Echo.class };
 
     protected AbstractProxyFactoryTestCase( ProxyFactory factory )
     {
@@ -50,22 +52,22 @@
 
     public void testCanProxy()
     {
-        assertTrue( factory.canProxy( Echo.class ) );
-        assertFalse( factory.canProxy( EchoImpl.class ) );
+        assertTrue( factory.canProxy( ECHO_ONLY ) );
+        assertFalse( factory.canProxy( new Class[] { EchoImpl.class } ) );
     }
 
     public void testInterfaceHierarchies()
     {
-        final SortedSet<String> set = ( SortedSet<String> ) factory.createDelegatorProxy( constantProvider( new TreeSet<String>() ), SortedSet.class );
+        final SortedSet set = ( SortedSet ) factory.createDelegatorProxy( ProviderUtils.constantProvider( new TreeSet() ), new Class[] { SortedSet.class } );
         set.add( "Hello" );
     }
 
     public void testInvocationHandlerProxy() throws Exception
     {
         final InvocationHandlerTester tester = new InvocationHandlerTester();
-        final Echo echo = ( Echo )factory.createInvocationHandlerProxy( tester, Echo.class );
+        final Echo echo = ( Echo )factory.createInvocationHandlerProxy( tester, ECHO_ONLY );
         echo.echoBack( "hello" );
-        assertEquals( Echo.class.getMethod( "echoBack", String.class ), tester.method );
+        assertEquals( Echo.class.getMethod( "echoBack", new Class[] { String.class } ), tester.method );
         assertSame( echo, tester.proxy );
         assertNotNull( tester.args );
         assertEquals( 1, tester.args.length );
@@ -74,16 +76,16 @@
 
     public void testDelegatingProxyInterfaceOrder()
     {
-        final Echo echo = ( Echo ) factory.createDelegatorProxy( singletonProvider( beanProvider( EchoImpl.class ) ), Echo.class, DuplicateEcho.class );
-        final List<Class> expected = new LinkedList<Class>( Arrays.asList( Echo.class, DuplicateEcho.class ) );
-        final List<Class> actual = new LinkedList<Class>( Arrays.asList( echo.getClass().getInterfaces() ) );
+        final Echo echo = ( Echo ) factory.createDelegatorProxy( createSingletonEcho(), new Class[] { Echo.class, DuplicateEcho.class } );
+        final List expected = new LinkedList( Arrays.asList( new Class[] { Echo.class, DuplicateEcho.class } ) );
+        final List actual = new LinkedList( Arrays.asList( echo.getClass().getInterfaces() ) );
         actual.retainAll( expected );  // Doesn't alter order!
         assertEquals( expected, actual );
     }
 
     public void testCreateDelegatingProxy()
     {
-        final Echo echo = ( Echo ) factory.createDelegatorProxy( singletonProvider( beanProvider( EchoImpl.class ) ), Echo.class );
+        final Echo echo = ( Echo ) factory.createDelegatorProxy( createSingletonEcho(), ECHO_ONLY );
         echo.echo();
         assertEquals( "message", echo.echoBack( "message" ) );
         assertEquals( "ab", echo.echoBack( "a", "b" ) );
@@ -91,48 +93,53 @@
 
     public void testPrimitiveParameter()
     {
-        final Echo echo = ( Echo ) factory.createDelegatorProxy( singletonProvider( beanProvider( EchoImpl.class ) ), Echo.class );
+        final Echo echo = ( Echo ) factory.createDelegatorProxy( createSingletonEcho(), ECHO_ONLY );
         assertEquals( 1, echo.echoBack( 1 ) );
     }
 
     public void testCreateInterceptorProxy()
     {
-        final Echo target = ( Echo ) factory.createDelegatorProxy( singletonProvider( beanProvider( EchoImpl.class ) ), Echo.class );
-        final Echo proxy = ( Echo ) factory.createInterceptorProxy( target, new SuffixMethodInterceptor( " suffix" ), Echo.class );
+        final Echo target = ( Echo ) factory.createDelegatorProxy( createSingletonEcho(), ECHO_ONLY );
+        final Echo proxy = ( Echo ) factory.createInterceptorProxy( target, new SuffixMethodInterceptor( " suffix" ), ECHO_ONLY );
         proxy.echo();
         assertEquals( "message suffix", proxy.echoBack( "message" ) );
     }
 
+    private ObjectProvider createSingletonEcho()
+    {
+        return ProviderUtils.singletonProvider( ProviderUtils.beanProvider( EchoImpl.class ) );
+    }
+
     public void testMethodInvocationImplementation() throws Exception
     {
         final MethodInvocationTester tester = new MethodInvocationTester();
         final EchoImpl target = new EchoImpl();
-        final Echo proxy = ( Echo ) factory.createInterceptorProxy( target, tester, Echo.class );
+        final Echo proxy = ( Echo ) factory.createInterceptorProxy( target, tester, ECHO_ONLY );
         proxy.echo();
         assertNull( tester.arguments );
-        assertEquals( Echo.class.getMethod( "echo" ), tester.method );
+        assertEquals( Echo.class.getMethod( "echo", new Class[] {} ), tester.method );
         assertEquals( target, tester.target );
-        assertEquals( Echo.class.getMethod( "echo" ), tester.staticPart );
+        assertEquals( Echo.class.getMethod( "echo", new Class[] {} ), tester.staticPart );
         proxy.echoBack( "Hello" );
         assertNotNull( tester.arguments );
         assertEquals( 1, tester.arguments.length );
         assertEquals( "Hello", tester.arguments[0] );
-        assertEquals( Echo.class.getMethod( "echoBack", String.class ), tester.method );
+        assertEquals( Echo.class.getMethod( "echoBack", new Class[] { String.class } ), tester.method );
         proxy.echoBack( "Hello", "World" );
         assertNotNull( tester.arguments );
         assertEquals( 2, tester.arguments.length );
         assertEquals( "Hello", tester.arguments[0] );
         assertEquals( "World", tester.arguments[1] );
-        assertEquals( Echo.class.getMethod( "echoBack", String.class, String.class ), tester.method );
+        assertEquals( Echo.class.getMethod( "echoBack", new Class[] { String.class, String.class } ), tester.method );
     }
 
     public void testMethodInvocationDuplicateMethods() throws Exception
     {
         final MethodInvocationTester tester = new MethodInvocationTester();
         final EchoImpl target = new EchoImpl();
-        final Echo proxy = ( Echo ) factory.createInterceptorProxy( target, tester, Echo.class, DuplicateEcho.class );
+        final Echo proxy = ( Echo ) factory.createInterceptorProxy( target, tester, new Class[] { Echo.class, DuplicateEcho.class } );
         proxy.echoBack( "hello" );
-        assertEquals( Echo.class.getMethod( "echoBack", String.class ), tester.method );
+        assertEquals( Echo.class.getMethod( "echoBack", new Class[] { String.class } ), tester.method );
     }
 
 
@@ -140,8 +147,8 @@
     {
         final MethodInvocationTester tester = new MethodInvocationTester();
         final EchoImpl target = new EchoImpl();
-        final Echo proxy1 = ( Echo ) factory.createInterceptorProxy( target, tester, Echo.class );
-        final Echo proxy2 = ( Echo ) factory.createInterceptorProxy( target, tester, Echo.class, DuplicateEcho.class );
+        final Echo proxy1 = ( Echo ) factory.createInterceptorProxy( target, tester, ECHO_ONLY );
+        final Echo proxy2 = ( Echo ) factory.createInterceptorProxy( target, tester, new Class[] { Echo.class, DuplicateEcho.class } );
         proxy1.echoBack( "hello1" );
         final Class invocationClass1 = tester.invocationClass;
         proxy2.echoBack( "hello2" );
@@ -150,21 +157,21 @@
 
     public void testDelegatingProxyClassCaching() throws Exception
     {
-        final Echo proxy1 = ( Echo ) factory.createDelegatorProxy( constantProvider( new EchoImpl() ), Echo.class );
-        final Echo proxy2 = ( Echo ) factory.createDelegatorProxy( constantProvider( new EchoImpl() ), Echo.class );
+        final Echo proxy1 = ( Echo ) factory.createDelegatorProxy( ProviderUtils.constantProvider( new EchoImpl() ), ECHO_ONLY );
+        final Echo proxy2 = ( Echo ) factory.createDelegatorProxy( ProviderUtils.constantProvider( new EchoImpl() ), ECHO_ONLY );
         assertEquals( proxy1.getClass(), proxy2.getClass() );
     }
 
     public void testInterceptingProxyClassCaching() throws Exception
     {
-        final Echo proxy1 = ( Echo ) factory.createInterceptorProxy( new EchoImpl(), new NoOpMethodInterceptor(), Echo.class );
-        final Echo proxy2 = ( Echo ) factory.createInterceptorProxy( new EchoImpl(), new NoOpMethodInterceptor(), Echo.class );
+        final Echo proxy1 = ( Echo ) factory.createInterceptorProxy( new EchoImpl(), new NoOpMethodInterceptor(), ECHO_ONLY );
+        final Echo proxy2 = ( Echo ) factory.createInterceptorProxy( new EchoImpl(), new NoOpMethodInterceptor(), ECHO_ONLY );
         assertEquals( proxy1.getClass(), proxy2.getClass() );
     }
 
     public void testProxyWithCheckedException() throws Exception
     {
-        final Echo proxy = ( Echo ) factory.createDelegatorProxy( constantProvider( new EchoImpl() ), Echo.class );
+        final Echo proxy = ( Echo ) factory.createDelegatorProxy( ProviderUtils.constantProvider( new EchoImpl() ), ECHO_ONLY );
         try
         {
             proxy.ioException();
@@ -177,7 +184,7 @@
 
     public void testProxyWithUncheckedException() throws Exception
     {
-        final Echo proxy = ( Echo ) factory.createDelegatorProxy( constantProvider( new EchoImpl() ), Echo.class );
+        final Echo proxy = ( Echo ) factory.createDelegatorProxy( ProviderUtils.constantProvider( new EchoImpl() ), ECHO_ONLY );
         try
         {
             proxy.illegalArgument();
@@ -190,7 +197,7 @@
 
     public void testInterceptorProxyWithUncheckedException() throws Exception
     {
-        final Echo proxy = ( Echo ) factory.createInterceptorProxy( new EchoImpl(), new NoOpMethodInterceptor(),  Echo.class );
+        final Echo proxy = ( Echo ) factory.createInterceptorProxy( new EchoImpl(), new NoOpMethodInterceptor(),  ECHO_ONLY );
         try
         {
             proxy.illegalArgument();
@@ -203,7 +210,7 @@
 
     public void testInterceptorProxyWithCheckedException() throws Exception
     {
-        final Echo proxy = ( Echo ) factory.createInterceptorProxy( new EchoImpl(), new NoOpMethodInterceptor(),  Echo.class );
+        final Echo proxy = ( Echo ) factory.createInterceptorProxy( new EchoImpl(), new NoOpMethodInterceptor(), ECHO_ONLY );
         try
         {
             proxy.ioException();
@@ -216,14 +223,14 @@
 
     public void testWithNonAccessibleTargetType()
     {
-        final Echo proxy = ( Echo ) factory.createInterceptorProxy( new PrivateEcho(), new NoOpMethodInterceptor(), Echo.class );
+        final Echo proxy = ( Echo ) factory.createInterceptorProxy( new PrivateEcho(), new NoOpMethodInterceptor(), ECHO_ONLY );
         proxy.echo();
 
     }
 
     public void testChangingArguments()
     {
-        final Echo proxy = ( Echo ) factory.createInterceptorProxy( new EchoImpl(), new ChangeArgumentInterceptor(), Echo.class );
+        final Echo proxy = ( Echo ) factory.createInterceptorProxy( new EchoImpl(), new ChangeArgumentInterceptor(), ECHO_ONLY );
         assertEquals( "something different", proxy.echoBack( "whatever" ) );
     }
 

Modified: jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/factory/AbstractSubclassingProxyFactoryTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/factory/AbstractSubclassingProxyFactoryTestCase.java?rev=320764&r1=320763&r2=320764&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/factory/AbstractSubclassingProxyFactoryTestCase.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/factory/AbstractSubclassingProxyFactoryTestCase.java Thu Oct 13 06:26:06 2005
@@ -37,41 +37,41 @@
 
     public void testWithAbstractSuperclass()
     {
-        final Echo echo = ( Echo )factory.createDelegatorProxy( new ConstantProvider( new EchoImpl() ), AbstractEcho.class );
+        final Echo echo = ( Echo )factory.createDelegatorProxy( new ConstantProvider( new EchoImpl() ),  new Class[] { AbstractEcho.class } );
         assertEquals( "hello", echo.echoBack( "hello" ) );
         assertEquals( "helloworld", echo.echoBack( "hello", "world" ) );
     }
 
     public void testCanProxy()
     {
-        assertTrue( factory.canProxy( Echo.class ) );
-        assertTrue( factory.canProxy( EchoImpl.class ) );
-        assertFalse( factory.canProxy( FinalEcho.class ) );
-        assertTrue( factory.canProxy( FinalMethodEcho.class, Echo.class ) );
-        assertFalse( factory.canProxy( NoDefaultConstructorEcho.class ) );
-        assertTrue( factory.canProxy( ProtectedConstructorEcho.class ) );
-        assertFalse( factory.canProxy( InvisibleEcho.class ) );
-        assertFalse( factory.canProxy( Echo.class, EchoImpl.class, String.class ) );
+        assertTrue( factory.canProxy(  new Class[] { Echo.class } ) );
+        assertTrue( factory.canProxy(  new Class[] { EchoImpl.class } ) );
+        assertFalse( factory.canProxy(  new Class[] { FinalEcho.class } ) );
+        assertTrue( factory.canProxy(  new Class[] { FinalMethodEcho.class, Echo.class } ) );
+        assertFalse( factory.canProxy(  new Class[] { NoDefaultConstructorEcho.class } ) );
+        assertTrue( factory.canProxy(  new Class[] { ProtectedConstructorEcho.class } ) );
+        assertFalse( factory.canProxy(  new Class[] { InvisibleEcho.class } ) );
+        assertFalse( factory.canProxy(  new Class[] { Echo.class, EchoImpl.class, String.class } ) );
     }
 
     public void testDelegatorWithSuperclass()
     {
         final Echo echo = ( Echo ) factory
-                .createDelegatorProxy( new ConstantProvider( new EchoImpl() ), Echo.class, EchoImpl.class );
+                .createDelegatorProxy( new ConstantProvider( new EchoImpl() ),  new Class[] { Echo.class, EchoImpl.class } );
         assertTrue( echo instanceof EchoImpl );
     }
 
     public void testInterceptorWithSuperclass()
     {
         final Echo echo = ( Echo ) factory
-                .createInterceptorProxy( new EchoImpl(), new NoOpMethodInterceptor(), Echo.class, EchoImpl.class );
+                .createInterceptorProxy( new EchoImpl(), new NoOpMethodInterceptor(),  new Class[] { Echo.class, EchoImpl.class } );
         assertTrue( echo instanceof EchoImpl );
     }
 
     public void testInvocationHandlerWithSuperclass()
     {
         final Echo echo = ( Echo ) factory
-                .createInvocationHandlerProxy( new NullInvocationHandler(), Echo.class, EchoImpl.class );
+                .createInvocationHandlerProxy( new NullInvocationHandler(),  new Class[] { Echo.class, EchoImpl.class } );
         assertTrue( echo instanceof EchoImpl );
     }
 
@@ -93,7 +93,7 @@
         try
         {
             factory.createDelegatorProxy( new ConstantProvider( new EchoImpl() ),
-                                          EchoImpl.class, String.class );
+                                           new Class[] { EchoImpl.class, String.class } );
             fail();
         }
         catch( ProxyFactoryException e )
@@ -106,7 +106,7 @@
         try
         {
             factory.createInterceptorProxy( new EchoImpl(), new NoOpMethodInterceptor(),
-                                            EchoImpl.class, String.class );
+                                             new Class[] { EchoImpl.class, String.class } );
             fail();
         }
         catch( ProxyFactoryException e )
@@ -119,7 +119,7 @@
         try
         {
             factory.createInvocationHandlerProxy( new NullInvocationHandler(),
-                                                  EchoImpl.class, String.class );
+                                                   new Class[] { EchoImpl.class, String.class } );
             fail();
         }
         catch( ProxyFactoryException e )
@@ -133,7 +133,6 @@
 
     public static class FinalMethodEcho extends EchoImpl
     {
-        @Override
         public final String echoBack( String message )
         {
             return "final";



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message