commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r903774 - in /commons/proper/digester/trunk/src/test/org/apache/commons/digester/plugins: TestConfigurablePluginAttributes.java TestDeclaration.java TestDefaultPlugin.java TestInline.java TestLocalRules.java TestRuleInfo.java
Date Wed, 27 Jan 2010 18:07:34 GMT
Author: sebb
Date: Wed Jan 27 18:07:33 2010
New Revision: 903774

URL: http://svn.apache.org/viewvc?rev=903774&view=rev
Log:
Fix "potential null pointer" warnings

Modified:
    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/TestRuleInfo.java

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=903774&r1=903773&r2=903774&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
Wed Jan 27 18:07:33 2010
@@ -88,7 +88,7 @@
         }
 
         List<Widget> widgets = root.getWidgets();
-        assertTrue(widgets != null);
+        assertNotNull(widgets);
         assertEquals(4, widgets.size());
 
         assertEquals(TextLabel.class, widgets.get(0).getClass());
@@ -97,7 +97,7 @@
         assertEquals(TextLabel.class, widgets.get(3).getClass());
         
         List<Widget> gadgets = root.getGadgets();
-        assertTrue(gadgets != null);
+        assertNotNull(gadgets);
         assertEquals(4, gadgets.size());
 
         assertEquals(TextLabel.class, gadgets.get(0).getClass());
@@ -145,7 +145,7 @@
         }
 
         List<Widget> widgets = root.getWidgets();
-        assertTrue(widgets != null);
+        assertNotNull(widgets);
         assertEquals(4, widgets.size());
 
         assertEquals(Slider.class, widgets.get(0).getClass());
@@ -154,7 +154,7 @@
         assertEquals(Slider.class, widgets.get(3).getClass());
         
         List<Widget> gadgets = root.getGadgets();
-        assertTrue(gadgets != null);
+        assertNotNull(gadgets);
         assertEquals(4, gadgets.size());
 
         assertEquals(Slider.class, gadgets.get(0).getClass());
@@ -203,7 +203,7 @@
         }
 
         List<Widget> widgets = root.getWidgets();
-        assertTrue(widgets != null);
+        assertNotNull(widgets);
         assertEquals(4, widgets.size());
 
         assertEquals(TextLabel2.class, widgets.get(0).getClass());
@@ -212,7 +212,7 @@
         assertEquals(TextLabel2.class, widgets.get(3).getClass());
         
         List<Widget> gadgets = root.getGadgets();
-        assertTrue(gadgets != null);
+        assertNotNull(gadgets);
         assertEquals(4, gadgets.size());
 
         assertEquals(TextLabel.class, gadgets.get(0).getClass());

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=903774&r1=903773&r2=903774&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
Wed Jan 27 18:07:33 2010
@@ -81,16 +81,16 @@
         
         Object child;
         List<Widget> children = root.getChildren();
-        assertTrue(children != null);
+        assertNotNull(children);
         assertEquals(2, children.size());
         
         child = children.get(0);
-        assertTrue(child != null);
+        assertNotNull(child);
         assertEquals(TextLabel.class, child.getClass());
         assertEquals("label1", ((TextLabel)child).getLabel());
         
         child = children.get(1);
-        assertTrue(child != null);
+        assertNotNull(child);
         assertEquals(TextLabel.class, child.getClass());
         assertEquals("label2", ((TextLabel)child).getLabel());
     }

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=903774&r1=903773&r2=903774&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
Wed Jan 27 18:07:33 2010
@@ -84,23 +84,23 @@
         
         Object child;
         List<Widget> children = root.getChildren();
-        assertTrue(children != null);
+        assertNotNull(children);
         assertEquals(3, children.size());
         
         child = children.get(0);
-        assertTrue(child != null);
+        assertNotNull(child);
         assertEquals(TextLabel.class, child.getClass());
         TextLabel label1 = (TextLabel) child;
         assertEquals("label1", label1.getLabel());
         
         child = children.get(1);
-        assertTrue(child != null);
+        assertNotNull(child);
         assertEquals(TextLabel.class, child.getClass());
         TextLabel label2 = (TextLabel) child;
         assertEquals("label2", label2.getLabel());
         
         child = children.get(2);
-        assertTrue(child != null);
+        assertNotNull(child);
         assertEquals(Slider.class, child.getClass());
         Slider slider1 = (Slider) child;
         assertEquals("slider1", slider1.getLabel());
@@ -134,7 +134,7 @@
             digester.setLogger(oldLog);
         }
         
-        assertTrue(exception != null);
+        assertNotNull(exception);
         assertEquals(SAXParseException.class, exception.getClass());
         assertEquals(
             PluginInvalidInputException.class, 
@@ -169,7 +169,7 @@
             digester.setLogger(oldLog);
         }
         
-        assertTrue(exception != null);
+        assertNotNull(exception);
         assertEquals(SAXParseException.class, exception.getClass());
         assertEquals(
             PluginConfigurationException.class, 

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=903774&r1=903773&r2=903774&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
Wed Jan 27 18:07:33 2010
@@ -82,18 +82,18 @@
         
         Object child;
         List<Widget> children = root.getChildren();
-        assertTrue(children != null);
+        assertNotNull(children);
         assertEquals(2, children.size());
         
         child = children.get(0);
-        assertTrue(child != null);
+        assertNotNull(child);
         assertEquals(TextLabel.class, child.getClass());
         TextLabel label1 = (TextLabel) child;
         assertEquals("anonymous", label1.getId());
         assertEquals("1", label1.getLabel());
         
         child = children.get(1);
-        assertTrue(child != null);
+        assertNotNull(child);
         assertEquals(TextLabel.class, child.getClass());
         TextLabel label2 = (TextLabel) child;
         assertEquals("L1", label2.getId());
@@ -128,18 +128,18 @@
         
         Object child;
         List<Widget> children = root.getChildren();
-        assertTrue(children != null);
+        assertNotNull(children);
         assertEquals(2, children.size());
         
         child = children.get(0);
-        assertTrue(child != null);
+        assertNotNull(child);
         assertEquals(TextLabel.class, child.getClass());
         TextLabel label1 = (TextLabel) child;
         assertEquals("anonymous", label1.getId());
         assertEquals("1", label1.getLabel());
         
         child = children.get(1);
-        assertTrue(child != null);
+        assertNotNull(child);
         assertEquals(TextLabel.class, child.getClass());
         TextLabel label2 = (TextLabel) child;
         assertEquals("L1", label2.getId());

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=903774&r1=903773&r2=903774&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
Wed Jan 27 18:07:33 2010
@@ -81,13 +81,13 @@
         
         Object child;
         List<Widget> children = root.getChildren();
-        assertTrue(children != null);
+        assertNotNull(children);
         assertEquals(3, children.size());
         
         // min/max rules should be in effect
         // setproperties should be in effect
         child = children.get(0);
-        assertTrue(child != null);
+        assertNotNull(child);
         assertEquals(Slider.class, child.getClass());
         Slider slider1 = (Slider) child;
         assertEquals("slider1", slider1.getLabel());
@@ -97,7 +97,7 @@
         // range rules should not be in effect
         // setproperties should be in effect
         child = children.get(1);
-        assertTrue(child != null);
+        assertNotNull(child);
         assertEquals(Slider.class, child.getClass());
         Slider slider2 = (Slider) child;
         assertEquals("slider2", slider2.getLabel());
@@ -106,7 +106,7 @@
         
         // setproperties should be working on text label
         child = children.get(2);
-        assertTrue(child != null);
+        assertNotNull(child);
         assertEquals(TextLabel.class, child.getClass());
         assertEquals("text1", ((TextLabel)child).getLabel());
     }
@@ -144,13 +144,13 @@
         
         Object child;
         List<Widget> children = root.getChildren();
-        assertTrue(children != null);
+        assertNotNull(children);
         assertEquals(3, children.size());
         
         // min/max rules should not  be in effect
         // setproperties should not be in effect
         child = children.get(0);
-        assertTrue(child != null);
+        assertNotNull(child);
         assertEquals(Slider.class, child.getClass());
         Slider slider1 = (Slider) child;
         assertEquals("nolabel", slider1.getLabel());
@@ -160,7 +160,7 @@
         // range rules should be in effect
         // setproperties should not be in effect
         child = children.get(1);
-        assertTrue(child != null);
+        assertNotNull(child);
         assertEquals(Slider.class, child.getClass());
         Slider slider2 = (Slider) child;
         assertEquals("nolabel", slider2.getLabel());
@@ -169,7 +169,7 @@
         
         // setproperties should be working on text label
         child = children.get(2);
-        assertTrue(child != null);
+        assertNotNull(child);
         assertEquals(TextLabel.class, child.getClass());
         assertEquals("text1", ((TextLabel)child).getLabel());
     }

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=903774&r1=903773&r2=903774&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
Wed Jan 27 18:07:33 2010
@@ -83,11 +83,11 @@
 
         Object child;
         List<Widget> children = root.getChildren();
-        assertTrue(children != null);
+        assertNotNull(children);
         assertEquals(1, children.size());
         
         child = children.get(0);
-        assertTrue(child != null);
+        assertNotNull(child);
         assertEquals(TextLabel2.class, child.getClass());
         TextLabel2 label = (TextLabel2) child;
         
@@ -125,11 +125,11 @@
 
         Object child;
         List<Widget> children = root.getChildren();
-        assertTrue(children != null);
+        assertNotNull(children);
         assertEquals(1, children.size());
         
         child = children.get(0);
-        assertTrue(child != null);
+        assertNotNull(child);
         assertEquals(TextLabel2.class, child.getClass());
         TextLabel2 label = (TextLabel2) child;
         
@@ -167,11 +167,11 @@
 
         Object child;
         List<Widget> children = root.getChildren();
-        assertTrue(children != null);
+        assertNotNull(children);
         assertEquals(1, children.size());
         
         child = children.get(0);
-        assertTrue(child != null);
+        assertNotNull(child);
         assertEquals(TextLabel2.class, child.getClass());
         TextLabel2 label = (TextLabel2) child;
         



Mime
View raw message