You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by th...@apache.org on 2008/12/01 17:17:19 UTC

svn commit: r722114 - /wicket/trunk/wicket/src/main/java/org/apache/wicket/util/tester/FormTester.java

Author: thrantal
Date: Mon Dec  1 08:17:18 2008
New Revision: 722114

URL: http://svn.apache.org/viewvc?rev=722114&view=rev
Log:
Added missing generics parameter types, and fixed other Java 5 stuff
- no functional changes

Modified:
    wicket/trunk/wicket/src/main/java/org/apache/wicket/util/tester/FormTester.java

Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/util/tester/FormTester.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/util/tester/FormTester.java?rev=722114&r1=722113&r2=722114&view=diff
==============================================================================
--- wicket/trunk/wicket/src/main/java/org/apache/wicket/util/tester/FormTester.java (original)
+++ wicket/trunk/wicket/src/main/java/org/apache/wicket/util/tester/FormTester.java Mon Dec  1 08:17:18 2008
@@ -173,18 +173,18 @@
 		 * @return the id value at the selected index
 		 */
 		@SuppressWarnings("unchecked")
-		private String selectAbstractChoice(FormComponent formComponent, final int index)
+		private String selectAbstractChoice(FormComponent<?> formComponent, final int index)
 		{
 			try
 			{
 				Method getChoicesMethod = formComponent.getClass().getMethod("getChoices",
-					(Class[])null);
+					(Class<?>[])null);
 				getChoicesMethod.setAccessible(true);
 				List<Object> choices = (List<Object>)getChoicesMethod.invoke(formComponent,
 					(Object[])null);
 
 				Method getChoiceRendererMethod = formComponent.getClass().getMethod(
-					"getChoiceRenderer", (Class[])null);
+					"getChoiceRenderer", (Class<?>[])null);
 				getChoiceRendererMethod.setAccessible(true);
 				IChoiceRenderer<Object> choiceRenderer = (IChoiceRenderer<Object>)getChoiceRendererMethod.invoke(
 					formComponent, (Object[])null);
@@ -380,7 +380,7 @@
 		{
 			@SuppressWarnings("unchecked")
 			@Override
-			public void onFormComponent(final FormComponent formComponent)
+			public void onFormComponent(final FormComponent<?> formComponent)
 			{
 				// do nothing for invisible component
 				if (!formComponent.isVisibleInHierarchy())
@@ -413,9 +413,9 @@
 				{
 					final String[] modelValues = formComponent.getValue().split(
 						FormComponent.VALUE_SEPARATOR);
-					for (int i = 0; i < modelValues.length; i++)
+					for (String modelValue : modelValues)
 					{
-						addFormComponentValue(formComponent, modelValues[i]);
+						addFormComponentValue(formComponent, modelValue);
 					}
 				}
 				else if (formComponent instanceof CheckGroup)
@@ -515,10 +515,10 @@
 			try
 			{
 				Method wantOnSelectionChangedNotificationsMethod = DropDownChoice.class.getDeclaredMethod(
-					"wantOnSelectionChangedNotifications", new Class[0]);
+					"wantOnSelectionChangedNotifications");
 				wantOnSelectionChangedNotificationsMethod.setAccessible(true);
-				boolean wantOnSelectionChangedNotifications = ((Boolean)wantOnSelectionChangedNotificationsMethod.invoke(
-					component, new Object[0])).booleanValue();
+				boolean wantOnSelectionChangedNotifications = (Boolean) wantOnSelectionChangedNotificationsMethod.invoke(
+						component);
 				if (wantOnSelectionChangedNotifications)
 				{
 					((DropDownChoice<?>)component).onSelectionChanged();
@@ -549,9 +549,9 @@
 
 		ChoiceSelector choiceSelector = choiceSelectorFactory.createForMultiple((FormComponent<?>)workingForm.get(formComponentId));
 
-		for (int i = 0; i < indexes.length; i++)
+		for (int index : indexes)
 		{
-			choiceSelector.doSelect(indexes[i]);
+			choiceSelector.doSelect(index);
 		}
 	}