You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by iv...@apache.org on 2008/04/27 05:43:31 UTC

svn commit: r651881 - /wicket/trunk/wicket/src/main/java/org/apache/wicket/util/lang/Objects.java

Author: ivaynberg
Date: Sat Apr 26 20:43:30 2008
New Revision: 651881

URL: http://svn.apache.org/viewvc?rev=651881&view=rev
Log:
java5 todo

Modified:
    wicket/trunk/wicket/src/main/java/org/apache/wicket/util/lang/Objects.java

Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/util/lang/Objects.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/util/lang/Objects.java?rev=651881&r1=651880&r2=651881&view=diff
==============================================================================
--- wicket/trunk/wicket/src/main/java/org/apache/wicket/util/lang/Objects.java (original)
+++ wicket/trunk/wicket/src/main/java/org/apache/wicket/util/lang/Objects.java Sat Apr 26 20:43:30 2008
@@ -115,6 +115,7 @@
 		// This override is required to resolve classes inside in different
 		// bundle, i.e.
 		// The classes can be resolved by OSGI classresolver implementation
+		@Override
 		protected Class resolveClass(ObjectStreamClass desc) throws IOException,
 			ClassNotFoundException
 		{
@@ -153,6 +154,7 @@
 			return candidate;
 		}
 
+		@Override
 		protected Object resolveObject(Object obj) throws IOException
 		{
 			Object replaced = replacedComponents.get(obj);
@@ -176,6 +178,7 @@
 			enableReplaceObject(true);
 		}
 
+		@Override
 		protected Object replaceObject(Object obj) throws IOException
 		{
 			if (obj instanceof Component)
@@ -478,6 +481,7 @@
 				{
 					// This override is required to resolve classes inside in different bundle, i.e.
 					// The classes can be resolved by OSGI classresolver implementation
+					@Override
 					protected Class resolveClass(ObjectStreamClass desc) throws IOException,
 						ClassNotFoundException
 					{
@@ -621,7 +625,7 @@
 	 * @return converted value of the type given, or value if the value cannot be converted to the
 	 *         given type.
 	 */
-	public static<T> T convertValue(Object value, Class<T> toType)
+	public static <T> T convertValue(Object value, Class<T> toType)
 	{
 		Object result = null;
 
@@ -630,7 +634,7 @@
 			/* If array -> array then convert components of array individually */
 			if (value.getClass().isArray() && toType.isArray())
 			{
-				Class<?> componentType = toType.getComponentType();
+				Class< ? > componentType = toType.getComponentType();
 
 				result = Array.newInstance(componentType, Array.getLength(value));
 				for (int i = 0, icount = Array.getLength(value); i < icount; i++)
@@ -693,7 +697,7 @@
 				result = primitiveDefaults.get(toType);
 			}
 		}
-    return toType.cast( result );
+		return toType.cast(result);
 	}
 
 	/**
@@ -1179,8 +1183,7 @@
 	 * @param obj
 	 * @return hashcode of the object or 0 if obj is null
 	 */
-	// TODO when on Java 5, we can use Object... obj
-	public static int hashCode(final Object[] obj)
+	public static int hashCode(final Object... obj)
 	{
 		if (obj == null || obj.length == 0)
 		{