You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by eh...@apache.org on 2007/09/22 08:35:35 UTC

svn commit: r578379 - /wicket/trunk/jdk-1.4/wicket-ioc/src/main/java/org/apache/wicket/proxy/LazyInitProxyFactory.java

Author: ehillenius
Date: Fri Sep 21 23:35:33 2007
New Revision: 578379

URL: http://svn.apache.org/viewvc?rev=578379&view=rev
Log:
removed isPrimitive from Classes

Modified:
    wicket/trunk/jdk-1.4/wicket-ioc/src/main/java/org/apache/wicket/proxy/LazyInitProxyFactory.java

Modified: wicket/trunk/jdk-1.4/wicket-ioc/src/main/java/org/apache/wicket/proxy/LazyInitProxyFactory.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket-ioc/src/main/java/org/apache/wicket/proxy/LazyInitProxyFactory.java?rev=578379&r1=578378&r2=578379&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket-ioc/src/main/java/org/apache/wicket/proxy/LazyInitProxyFactory.java (original)
+++ wicket/trunk/jdk-1.4/wicket-ioc/src/main/java/org/apache/wicket/proxy/LazyInitProxyFactory.java Fri Sep 21 23:35:33 2007
@@ -26,14 +26,13 @@
 import java.util.Arrays;
 import java.util.List;
 
-import org.apache.wicket.IClusterable;
-import org.apache.wicket.model.IModel;
-import org.apache.wicket.util.lang.Classes;
-
 import net.sf.cglib.proxy.Enhancer;
 import net.sf.cglib.proxy.MethodInterceptor;
 import net.sf.cglib.proxy.MethodProxy;
 
+import org.apache.wicket.IClusterable;
+import org.apache.wicket.model.IModel;
+
 /**
  * A factory class that creates lazy init proxies given a type and a
  * {@link IProxyTargetLocator} used to retrieve the object the proxy will
@@ -105,6 +104,14 @@
 public class LazyInitProxyFactory
 {
 	/**
+	 * Primitive java types and their object wrappers
+	 */
+	private static final List PRIMITIVES = Arrays.asList(new Class[] { String.class, byte.class,
+			Byte.class, short.class, Short.class, int.class, Integer.class, long.class, Long.class,
+			float.class, Float.class, double.class, Double.class, char.class, Character.class,
+			boolean.class, Boolean.class });
+
+	/**
 	 * Create a lazy init proxy for the specified type. The target object will
 	 * be located using the provided locator upon first method invocation.
 	 * 
@@ -119,7 +126,7 @@
 	 */
 	public static Object createProxy(Class type, IProxyTargetLocator locator)
 	{
-		if (Classes.isPrimitive(type))
+		if (PRIMITIVES.contains(type))
 		{
 			// We special-case primitives as sometimes people use these as
 			// SpringBeans (WICKET-603, WICKET-906). Go figure.