maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject svn commit: r1345444 - in /maven/plugin-testing/trunk/maven-test-tools/src/main/java/org/apache/maven/shared/tools: easymock/MockManager.java easymock/TestFileManager.java test/ReflectiveSetter.java
Date Sat, 02 Jun 2012 05:36:06 GMT
Author: hboutemy
Date: Sat Jun  2 05:36:05 2012
New Revision: 1345444

URL: http://svn.apache.org/viewvc?rev=1345444&view=rev
Log:
use generics

Modified:
    maven/plugin-testing/trunk/maven-test-tools/src/main/java/org/apache/maven/shared/tools/easymock/MockManager.java
    maven/plugin-testing/trunk/maven-test-tools/src/main/java/org/apache/maven/shared/tools/easymock/TestFileManager.java
    maven/plugin-testing/trunk/maven-test-tools/src/main/java/org/apache/maven/shared/tools/test/ReflectiveSetter.java

Modified: maven/plugin-testing/trunk/maven-test-tools/src/main/java/org/apache/maven/shared/tools/easymock/MockManager.java
URL: http://svn.apache.org/viewvc/maven/plugin-testing/trunk/maven-test-tools/src/main/java/org/apache/maven/shared/tools/easymock/MockManager.java?rev=1345444&r1=1345443&r2=1345444&view=diff
==============================================================================
--- maven/plugin-testing/trunk/maven-test-tools/src/main/java/org/apache/maven/shared/tools/easymock/MockManager.java
(original)
+++ maven/plugin-testing/trunk/maven-test-tools/src/main/java/org/apache/maven/shared/tools/easymock/MockManager.java
Sat Jun  2 05:36:05 2012
@@ -20,7 +20,6 @@ package org.apache.maven.shared.tools.ea
  */
 
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 
 import org.easymock.MockControl;
@@ -33,7 +32,7 @@ import org.easymock.MockControl;
  */
 public class MockManager
 {
-    private List mockControls = new ArrayList();
+    private List<MockControl> mockControls = new ArrayList<MockControl>();
 
     /**
      * @param control to be add to the manager
@@ -56,10 +55,8 @@ public class MockManager
      */
     public void replayAll()
     {
-        for ( Iterator it = mockControls.iterator(); it.hasNext(); )
+        for ( MockControl control : mockControls )
         {
-            MockControl control = (MockControl) it.next();
-
             control.replay();
         }
     }
@@ -69,10 +66,8 @@ public class MockManager
      */
     public void verifyAll()
     {
-        for ( Iterator it = mockControls.iterator(); it.hasNext(); )
+        for ( MockControl control : mockControls )
         {
-            MockControl control = (MockControl) it.next();
-
             control.verify();
         }
     }

Modified: maven/plugin-testing/trunk/maven-test-tools/src/main/java/org/apache/maven/shared/tools/easymock/TestFileManager.java
URL: http://svn.apache.org/viewvc/maven/plugin-testing/trunk/maven-test-tools/src/main/java/org/apache/maven/shared/tools/easymock/TestFileManager.java?rev=1345444&r1=1345443&r2=1345444&view=diff
==============================================================================
--- maven/plugin-testing/trunk/maven-test-tools/src/main/java/org/apache/maven/shared/tools/easymock/TestFileManager.java
(original)
+++ maven/plugin-testing/trunk/maven-test-tools/src/main/java/org/apache/maven/shared/tools/easymock/TestFileManager.java
Sat Jun  2 05:36:05 2012
@@ -42,7 +42,7 @@ public class TestFileManager
     /** Temp dir from "java.io.tmpdir" property */
     public static final String TEMP_DIR_PATH = System.getProperty( "java.io.tmpdir" );
 
-    private List filesToDelete = new ArrayList();
+    private List<File> filesToDelete = new ArrayList<File>();
 
     private final String baseFilename;
 
@@ -147,9 +147,9 @@ public class TestFileManager
     public void cleanUp()
         throws IOException
     {
-        for ( Iterator it = filesToDelete.iterator(); it.hasNext(); )
+        for ( Iterator<File> it = filesToDelete.iterator(); it.hasNext(); )
         {
-            File file = (File) it.next();
+            File file = it.next();
 
             if ( file.exists() )
             {

Modified: maven/plugin-testing/trunk/maven-test-tools/src/main/java/org/apache/maven/shared/tools/test/ReflectiveSetter.java
URL: http://svn.apache.org/viewvc/maven/plugin-testing/trunk/maven-test-tools/src/main/java/org/apache/maven/shared/tools/test/ReflectiveSetter.java?rev=1345444&r1=1345443&r2=1345444&view=diff
==============================================================================
--- maven/plugin-testing/trunk/maven-test-tools/src/main/java/org/apache/maven/shared/tools/test/ReflectiveSetter.java
(original)
+++ maven/plugin-testing/trunk/maven-test-tools/src/main/java/org/apache/maven/shared/tools/test/ReflectiveSetter.java
Sat Jun  2 05:36:05 2012
@@ -33,14 +33,14 @@ import org.codehaus.plexus.util.StringUt
  */
 public class ReflectiveSetter
 {
-    private Map cachedPropertySetters = new HashMap();
+    private Map<String, Setter> cachedPropertySetters = new HashMap<String, Setter>();
 
-    private final Class targetClass;
+    private final Class<?> targetClass;
 
     /**
      * @param targetClass
      */
-    public ReflectiveSetter( Class targetClass )
+    public ReflectiveSetter( Class<?> targetClass )
     {
         this.targetClass = targetClass;
     }



Mime
View raw message