commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ra...@apache.org
Subject svn commit: r729213 - /commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/
Date Wed, 24 Dec 2008 04:00:55 GMT
Author: rahul
Date: Tue Dec 23 20:00:54 2008
New Revision: 729213

URL: http://svn.apache.org/viewvc?rev=729213&view=rev
Log:
Address various compiler warnings and use JDK 1.5 features in tests (org.apache.commons.digester.plugins
test package).

Modified:
    commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/Container.java
    commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/Slider.java
    commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/TestConfigurablePluginAttributes.java
    commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/TestDeclaration.java
    commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/TestDefaultPlugin.java
    commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/TestInline.java
    commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/TestLocalRules.java
    commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/TestRecursion.java
    commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/TestRuleInfo.java

Modified: commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/Container.java
URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/Container.java?rev=729213&r1=729212&r2=729213&view=diff
==============================================================================
--- commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/Container.java
(original)
+++ commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/Container.java
Tue Dec 23 20:00:54 2008
@@ -22,7 +22,7 @@
 import java.util.LinkedList;
 
 public class Container implements Widget {
-    private LinkedList children = new LinkedList();
+    private LinkedList<Widget> children = new LinkedList<Widget>();
 
     public Container() {}
     
@@ -30,7 +30,7 @@
         children.add(child);
     }
 
-    public List getChildren() {
+    public List<Widget> getChildren() {
         return children;
     }
 }

Modified: commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/Slider.java
URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/Slider.java?rev=729213&r1=729212&r2=729213&view=diff
==============================================================================
--- commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/Slider.java
(original)
+++ commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/Slider.java
Tue Dec 23 20:00:54 2008
@@ -29,7 +29,7 @@
     public static void addRules(Digester digester, String pattern) {
         digester.addSetProperties(pattern);
         
-        Class[] paramtypes = {Integer.class};
+        Class<?>[] paramtypes = {Integer.class};
         digester.addCallMethod(pattern+"/min", "setMin", 0, paramtypes);  
         digester.addCallMethod(pattern+"/max", "setMax", 0, paramtypes);  
     }
@@ -37,7 +37,7 @@
     // define different rules on this class
     public static void addRangeRules(Digester digester, String pattern) {
         // note: deliberately no addSetProperties rule
-        Class[] paramtypes = {Integer.class, Integer.class};
+        Class<?>[] paramtypes = {Integer.class, Integer.class};
         digester.addCallMethod(pattern+"/range", "setRange", 2, paramtypes);  
         digester.addCallParam(pattern+"/range", 0, "min");  
         digester.addCallParam(pattern+"/range", 1, "max");  

Modified: commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/TestConfigurablePluginAttributes.java
URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/TestConfigurablePluginAttributes.java?rev=729213&r1=729212&r2=729213&view=diff
==============================================================================
--- commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/TestConfigurablePluginAttributes.java
(original)
+++ commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/TestConfigurablePluginAttributes.java
Tue Dec 23 20:00:54 2008
@@ -85,7 +85,7 @@
             throw e;
         }
 
-        List widgets = root.getWidgets();
+        List<Widget> widgets = root.getWidgets();
         assertTrue(widgets != null);
         assertEquals(4, widgets.size());
 
@@ -94,7 +94,7 @@
         assertEquals(TextLabel.class, widgets.get(2).getClass());
         assertEquals(TextLabel.class, widgets.get(3).getClass());
         
-        List gadgets = root.getGadgets();
+        List<Widget> gadgets = root.getGadgets();
         assertTrue(gadgets != null);
         assertEquals(4, gadgets.size());
 
@@ -142,7 +142,7 @@
             throw e;
         }
 
-        List widgets = root.getWidgets();
+        List<Widget> widgets = root.getWidgets();
         assertTrue(widgets != null);
         assertEquals(4, widgets.size());
 
@@ -151,7 +151,7 @@
         assertEquals(Slider.class, widgets.get(2).getClass());
         assertEquals(Slider.class, widgets.get(3).getClass());
         
-        List gadgets = root.getGadgets();
+        List<Widget> gadgets = root.getGadgets();
         assertTrue(gadgets != null);
         assertEquals(4, gadgets.size());
 
@@ -200,7 +200,7 @@
             throw e;
         }
 
-        List widgets = root.getWidgets();
+        List<Widget> widgets = root.getWidgets();
         assertTrue(widgets != null);
         assertEquals(4, widgets.size());
 
@@ -209,7 +209,7 @@
         assertEquals(TextLabel2.class, widgets.get(2).getClass());
         assertEquals(TextLabel2.class, widgets.get(3).getClass());
         
-        List gadgets = root.getGadgets();
+        List<Widget> gadgets = root.getGadgets();
         assertTrue(gadgets != null);
         assertEquals(4, gadgets.size());
 
@@ -222,8 +222,8 @@
     // inner classes used for testing
     
     public static class MultiContainer {
-        private LinkedList widgets = new LinkedList();
-        private LinkedList gadgets = new LinkedList();
+        private LinkedList<Widget> widgets = new LinkedList<Widget>();
+        private LinkedList<Widget> gadgets = new LinkedList<Widget>();
     
         public MultiContainer() {}
         
@@ -231,7 +231,7 @@
             widgets.add(child);
         }
     
-        public List getWidgets() {
+        public List<Widget> getWidgets() {
             return widgets;
         }
 
@@ -239,7 +239,7 @@
             gadgets.add(child);
         }
     
-        public List getGadgets() {
+        public List<Widget> getGadgets() {
             return gadgets;
         }
     }

Modified: commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/TestDeclaration.java
URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/TestDeclaration.java?rev=729213&r1=729212&r2=729213&view=diff
==============================================================================
--- commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/TestDeclaration.java
(original)
+++ commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/TestDeclaration.java
Tue Dec 23 20:00:54 2008
@@ -78,7 +78,7 @@
         }
         
         Object child;
-        List children = root.getChildren();
+        List<Widget> children = root.getChildren();
         assertTrue(children != null);
         assertEquals(2, children.size());
         

Modified: commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/TestDefaultPlugin.java
URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/TestDefaultPlugin.java?rev=729213&r1=729212&r2=729213&view=diff
==============================================================================
--- commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/TestDefaultPlugin.java
(original)
+++ commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/TestDefaultPlugin.java
Tue Dec 23 20:00:54 2008
@@ -81,7 +81,7 @@
         }
         
         Object child;
-        List children = root.getChildren();
+        List<Widget> children = root.getChildren();
         assertTrue(children != null);
         assertEquals(3, children.size());
         

Modified: commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/TestInline.java
URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/TestInline.java?rev=729213&r1=729212&r2=729213&view=diff
==============================================================================
--- commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/TestInline.java
(original)
+++ commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/TestInline.java
Tue Dec 23 20:00:54 2008
@@ -79,7 +79,7 @@
         }
         
         Object child;
-        List children = root.getChildren();
+        List<Widget> children = root.getChildren();
         assertTrue(children != null);
         assertEquals(2, children.size());
         
@@ -125,7 +125,7 @@
         }
         
         Object child;
-        List children = root.getChildren();
+        List<Widget> children = root.getChildren();
         assertTrue(children != null);
         assertEquals(2, children.size());
         

Modified: commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/TestLocalRules.java
URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/TestLocalRules.java?rev=729213&r1=729212&r2=729213&view=diff
==============================================================================
--- commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/TestLocalRules.java
(original)
+++ commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/TestLocalRules.java
Tue Dec 23 20:00:54 2008
@@ -78,7 +78,7 @@
         }
         
         Object child;
-        List children = root.getChildren();
+        List<Widget> children = root.getChildren();
         assertTrue(children != null);
         assertEquals(3, children.size());
         
@@ -141,7 +141,7 @@
         }
         
         Object child;
-        List children = root.getChildren();
+        List<Widget> children = root.getChildren();
         assertTrue(children != null);
         assertEquals(3, children.size());
         

Modified: commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/TestRecursion.java
URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/TestRecursion.java?rev=729213&r1=729212&r2=729213&view=diff
==============================================================================
--- commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/TestRecursion.java
(original)
+++ commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/TestRecursion.java
Tue Dec 23 20:00:54 2008
@@ -20,7 +20,6 @@
 package org.apache.commons.digester.plugins;
 
 import java.util.List;
-import java.util.Iterator;
 
 import junit.framework.Test;
 import junit.framework.TestCase;
@@ -86,10 +85,9 @@
     }
 
     private int countWidgets(Container c) {
-        List l = c.getChildren();
+        List<Widget> l = c.getChildren();
         int sum = 0;
-        for(Iterator i = l.iterator(); i.hasNext(); ) {
-            Widget w = (Widget) i.next();
+        for(Widget w : l) {
             ++sum; 
             if (w instanceof Container) {
                 sum += countWidgets((Container) w);

Modified: commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/TestRuleInfo.java
URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/TestRuleInfo.java?rev=729213&r1=729212&r2=729213&view=diff
==============================================================================
--- commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/TestRuleInfo.java
(original)
+++ commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins/TestRuleInfo.java
Tue Dec 23 20:00:54 2008
@@ -80,7 +80,7 @@
         }
 
         Object child;
-        List children = root.getChildren();
+        List<Widget> children = root.getChildren();
         assertTrue(children != null);
         assertEquals(1, children.size());
         
@@ -122,7 +122,7 @@
         }
 
         Object child;
-        List children = root.getChildren();
+        List<Widget> children = root.getChildren();
         assertTrue(children != null);
         assertEquals(1, children.size());
         
@@ -164,7 +164,7 @@
         }
 
         Object child;
-        List children = root.getChildren();
+        List<Widget> children = root.getChildren();
         assertTrue(children != null);
         assertEquals(1, children.size());
         



Mime
View raw message