Title: [waffle-scm] [446] trunk/waffle-core/src/test/java/org/codehaus/waffle/action: Removed generics warnings.

Diff

Modified: trunk/waffle-core/src/main/java/org/codehaus/waffle/action/AbstractMethodDefinitionFinder.java (445 => 446)

--- trunk/waffle-core/src/main/java/org/codehaus/waffle/action/AbstractMethodDefinitionFinder.java	2007-11-30 22:13:56 UTC (rev 445)
+++ trunk/waffle-core/src/main/java/org/codehaus/waffle/action/AbstractMethodDefinitionFinder.java	2007-11-30 23:10:40 UTC (rev 446)
@@ -45,7 +45,7 @@
     private static final String PRAGMA_SEPARATOR = "|";
     private static final String PRAGMA_REGEX = "\\" + PRAGMA_SEPARATOR;
 
-    private final Map<Class, Method> defaultMethodCache = new HashMap<Class, Method>();
+    private final Map<Class<?>, Method> defaultMethodCache = new HashMap<Class<?>, Method>();
     private final ServletContext servletContext;
     private final ArgumentResolver argumentResolver;
     private final ValueConverterFinder valueConverterFinder;
@@ -87,7 +87,7 @@
     }
 
     private MethodDefinition findDefaultActionMethod(Object controller, HttpServletRequest request) {
-        Class controllerType = controller.getClass();
+        Class<?> controllerType = controller.getClass();
 
         if (defaultMethodCache.containsKey(controllerType)) { // cache hit
             MethodDefinition methodDefinition = buildDefaultMethodDefinition(defaultMethodCache.get(controllerType), request);
@@ -241,7 +241,7 @@
     }
 
     private boolean hasEquivalentParameterTypes(MethodDefinition methodDefinition) {
-        Class[] methodParameterTypes = methodDefinition.getMethod().getParameterTypes();
+        Class<?>[] methodParameterTypes = methodDefinition.getMethod().getParameterTypes();
         List<Object> methodArguments = methodDefinition.getMethodArguments();
 
         if (methodParameterTypes.length != methodArguments.size()) {
@@ -249,7 +249,7 @@
         }
 
         for (int i = 0; i < methodParameterTypes.length; i++) {
-            Class methodParameterType = methodParameterTypes[i];
+            Class<?> methodParameterType = methodParameterTypes[i];
 
             // the types must be assignable to be considered a valid method (assume true if actualParameterType is null)
             if (methodArguments.get(i) != null) {
@@ -274,7 +274,7 @@
         return true;
     }
 
-    private Object convertValue(String value, Class type) {
+    private Object convertValue(String value, Class<?> type) {
         if (isEmpty(value) && type.isPrimitive()) {
             value = null; // this allows Ognl to use that primitives default value
         }

Modified: trunk/waffle-core/src/main/java/org/codehaus/waffle/action/NoMatchingActionMethodException.java (445 => 446)

--- trunk/waffle-core/src/main/java/org/codehaus/waffle/action/NoMatchingActionMethodException.java	2007-11-30 22:13:56 UTC (rev 445)
+++ trunk/waffle-core/src/main/java/org/codehaus/waffle/action/NoMatchingActionMethodException.java	2007-11-30 23:10:40 UTC (rev 446)
@@ -8,9 +8,9 @@
 @SuppressWarnings("serial")
 public class NoMatchingActionMethodException extends MatchingActionMethodException {
     private final String methodName;
-    private final Class actionClass;
+    private final Class<?> actionClass;
 
-    public NoMatchingActionMethodException(String methodName, Class actionClass) {
+    public NoMatchingActionMethodException(String methodName, Class<?> actionClass) {
         super("no matching methods for: " + methodName);
         this.methodName = methodName;
         this.actionClass = actionClass;
@@ -20,7 +20,7 @@
         return methodName;
     }
 
-    public Class getActionClass() {
+    public Class<?> getActionClass() {
         return actionClass;
     }
 }

Modified: trunk/waffle-core/src/main/java/org/codehaus/waffle/bind/ognl/OgnlBindErrorMessageResolver.java (445 => 446)

--- trunk/waffle-core/src/main/java/org/codehaus/waffle/bind/ognl/OgnlBindErrorMessageResolver.java	2007-11-30 22:13:56 UTC (rev 445)
+++ trunk/waffle-core/src/main/java/org/codehaus/waffle/bind/ognl/OgnlBindErrorMessageResolver.java	2007-11-30 23:10:40 UTC (rev 446)
@@ -59,7 +59,7 @@
         return messageResources.getMessage(DEFAULT_BIND_ERROR, fieldName, value);
     }
 
-    protected String findBindErrorMessageKey(Class type) {
+    protected String findBindErrorMessageKey(Class<?> type) {
         if (byte.class.equals(type)
                 || short.class.equals(type)
                 || int.class.equals(type)

Modified: trunk/waffle-core/src/test/java/org/codehaus/waffle/action/AnnotatedMethodDefinitionFinderTest.java (445 => 446)

--- trunk/waffle-core/src/test/java/org/codehaus/waffle/action/AnnotatedMethodDefinitionFinderTest.java	2007-11-30 22:13:56 UTC (rev 445)
+++ trunk/waffle-core/src/test/java/org/codehaus/waffle/action/AnnotatedMethodDefinitionFinderTest.java	2007-11-30 23:10:40 UTC (rev 446)
@@ -20,13 +20,12 @@
 import org.codehaus.waffle.action.annotation.DefaultActionMethod;
 import org.codehaus.waffle.bind.ognl.OgnlValueConverter;
 import org.codehaus.waffle.bind.ognl.OgnlValueConverterFinder;
+import org.codehaus.waffle.context.ContextContainer;
+import org.codehaus.waffle.context.RequestLevelContainer;
+import org.codehaus.waffle.i18n.MessagesContext;
 import org.codehaus.waffle.monitor.ActionMonitor;
 import org.codehaus.waffle.monitor.SilentMonitor;
 import org.codehaus.waffle.testmodel.SampleForMethodFinder;
-import org.codehaus.waffle.i18n.MessagesContext;
-import org.codehaus.waffle.context.ContextContainer;
-import org.codehaus.waffle.context.RequestLevelContainer;
-import org.codehaus.waffle.validation.ErrorsContext;
 import org.jmock.Expectations;
 import org.jmock.Mockery;
 import org.jmock.integration.junit4.JMock;

Modified: trunk/waffle-core/src/test/java/org/codehaus/waffle/servlet/WaffleServletTest.java (445 => 446)

--- trunk/waffle-core/src/test/java/org/codehaus/waffle/servlet/WaffleServletTest.java	2007-11-30 22:13:56 UTC (rev 445)
+++ trunk/waffle-core/src/test/java/org/codehaus/waffle/servlet/WaffleServletTest.java	2007-11-30 23:10:40 UTC (rev 446)
@@ -125,7 +125,7 @@
                 exactly(2).of(errorsContext).hasErrorMessages();
                 will(returnValue(false));
                 one(contextContainer).getAllComponentInstancesOfType(MethodInterceptor.class);
-                will(returnValue(new ArrayList()));
+                will(returnValue(new ArrayList<Object>()));
             }
         });
 
@@ -206,7 +206,7 @@
                 exactly(2).of(errorsContext).hasErrorMessages();
                 will(returnValue(false));
                 one(contextContainer).getAllComponentInstancesOfType(MethodInterceptor.class);
-                will(returnValue(new ArrayList()));
+                will(returnValue(new ArrayList<Object>()));
             }
         });
 
@@ -275,6 +275,7 @@
         Assert.assertEquals(1, nonDispatchingController.getCount());
     }
 
+    @SuppressWarnings("serial")
     @Test(expected = ServletException.class)
     public void cannotServiceIfControllerNotFound() throws Exception {
         // Mock ErrorsContext
@@ -288,7 +289,7 @@
                 one(errorsContext).hasErrorMessages();
                 will(returnValue(false));
                 one(contextContainer).getAllComponentInstancesOfType(MethodInterceptor.class);
-                will(returnValue(new ArrayList()));
+                will(returnValue(new ArrayList<Object>()));
             }
         });
 


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Reply via email to