jicarilla-sandbox/platform/components/collections/src/test/org/jicarilla/collections/test DefaultNodeTestCase.java,1.2,1.3 NodeBuilderTestCase.java,1.2,1.3 NodeTestCase.java,1.2,1.3

[email protected]
Newsgroups gmane.comp.java.jicarilla.cvs
Message-ID <[email protected]>
Update of /cvsroot/jicarilla/jicarilla-sandbox/platform/components/collections/src/test/org/jicarilla/collections/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2537/components/collections/src/test/org/jicarilla/collections/test

Modified Files:
	DefaultNodeTestCase.java NodeBuilderTestCase.java 
	NodeTestCase.java 
Log Message:
Ran some code analysis tools on the code and changed approximately 200 small things based on that. Nothing shocking (I hope!)

Index: DefaultNodeTestCase.java
===================================================================
RCS file: /cvsroot/jicarilla/jicarilla-sandbox/platform/components/collections/src/test/org/jicarilla/collections/test/DefaultNodeTestCase.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- DefaultNodeTestCase.java	4 Jan 2004 16:10:17 -0000	1.2
+++ DefaultNodeTestCase.java	26 Feb 2004 16:51:54 -0000	1.3
@@ -162,7 +162,7 @@
         // exceptions
         n2 = new DefaultNode(null, null, null )
         {
-            protected boolean equalSizes( Node n )
+            protected boolean equalSizes( final Node n )
             {
                 throw new ClassCastException();
             }
@@ -171,7 +171,7 @@
 
         n2 = new DefaultNode(null, null, null )
         {
-            protected boolean equalSizes( Node n )
+            protected boolean equalSizes( final Node n )
             {
                 throw new NullPointerException();
             }
@@ -220,7 +220,7 @@
 
     public void testSetName()
     {
-        String old = node.setName("blah");
+        final String old = node.setName("blah");
         assertEquals( "", old );
     }
 
@@ -243,7 +243,7 @@
 
     public void testAddChildren()
     {
-        ArrayList col = new ArrayList();
+        final List col = new ArrayList();
         col.add(n2);
         col.add(n3);
 
@@ -261,7 +261,7 @@
 
     public void testContainsChildren()
     {
-        ArrayList col = new ArrayList();
+        final List col = new ArrayList();
         col.add(n2);
         col.add(n3);
 
@@ -304,7 +304,7 @@
         node.addChild(n4);
         node.addChild(node);
 
-        List children = node.childrenToList();
+        final List children = node.childrenToList();
         assertTrue(children.contains(n2));
         assertTrue(children.contains(n3));
         assertTrue(children.contains(n4));
@@ -318,13 +318,13 @@
         node.addChild(n4);
         node.addChild(node);
 
-        Node[] children = new Node[4];
+        final Node[] children = new Node[4];
 
-        Iterator it = node.iterator();
+        final Iterator it = node.iterator();
         int i = 0;
         while( it.hasNext() )
         {
-            Node n = (Node)it.next();
+            final Node n = (Node)it.next();
             children[i] = n;
             i++;
         }
@@ -349,7 +349,7 @@
 
     public void testRemoveChildren()
     {
-        ArrayList col = new ArrayList();
+        final List col = new ArrayList();
         col.add(n2);
         col.add(n3);
 
@@ -435,7 +435,7 @@
 
     public void testPutAllAndKeySet()
     {
-        Map col = new HashMap();
+        final Map col = new HashMap();
         col.put("key", "value");
         col.put("key2", "value2");
         col.put("key3", "value3");
@@ -443,7 +443,7 @@
         node.putAll( col );
         node.putAll( new HashMap() );
 
-        Set keys = node.keySet();
+        final Set keys = node.keySet();
         assertTrue(keys.contains("key"));
         assertTrue(keys.contains("key2"));
         assertTrue(keys.contains("key3"));
@@ -462,14 +462,14 @@
 
     public void testValues()
     {
-        Map col = new HashMap();
+        final Map col = new HashMap();
         col.put("key", "value");
         col.put("key2", "value2");
         col.put("key3", "value3");
 
         node.putAll( col );
 
-        String[] values = (String[])node.values().toArray( new String[0] );
+        final String[] values = (String[])node.values().toArray( new String[0] );
 
         assertTrue( arrayContains(values, "value") );
         assertTrue( arrayContains(values, "value2") );
@@ -482,11 +482,11 @@
     // ----------------------------------------------------------------------
 
 
-    protected boolean arrayContains( Object[] arr, Object needle )
+    protected boolean arrayContains( final Object[] arr, final Object needle )
     {
         for( int i = 0; i < arr.length; i++ )
         {
-            Object o = arr[i];
+            final Object o = arr[i];
             if(needle.equals(o))
                 return true;
         }

Index: NodeBuilderTestCase.java
===================================================================
RCS file: /cvsroot/jicarilla/jicarilla-sandbox/platform/components/collections/src/test/org/jicarilla/collections/test/NodeBuilderTestCase.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- NodeBuilderTestCase.java	4 Jan 2004 16:10:17 -0000	1.2
+++ NodeBuilderTestCase.java	26 Feb 2004 16:51:54 -0000	1.3
@@ -59,7 +59,7 @@
         t = null;
         try
         {
-            SAXParser p = SAXParserFactory.newInstance().newSAXParser();
+            final SAXParser p = SAXParserFactory.newInstance().newSAXParser();
             new NodeBuilder( p, null );
         }
         catch( AssertionError th )
@@ -69,36 +69,36 @@
         assertNotNull( t );
 
 
-        SAXParser p = SAXParserFactory.newInstance().newSAXParser();
+        final SAXParser p = SAXParserFactory.newInstance().newSAXParser();
         assertNotNull( new NodeBuilder( p, new DefaultXMLNodeHandler() ) );
     }
 
     public void testGetParser() throws Throwable
     {
-        SAXParser p = SAXParserFactory.newInstance().newSAXParser();
-        Builder b = new Builder( p, new DefaultXMLNodeHandler() );
+        final SAXParser p = SAXParserFactory.newInstance().newSAXParser();
+        final Builder b = new Builder( p, new DefaultXMLNodeHandler() );
         assertEquals( p, b.getParser() );
     }
 
     public void testGetHandler() throws Throwable
     {
-        SAXParser p = SAXParserFactory.newInstance().newSAXParser();
-        DefaultXMLNodeHandler h = new DefaultXMLNodeHandler();
-        Builder b = new Builder( p, h  );
+        final SAXParser p = SAXParserFactory.newInstance().newSAXParser();
+        final DefaultXMLNodeHandler h = new DefaultXMLNodeHandler();
+        final Builder b = new Builder( p, h  );
         assertEquals( h, b.getHandler() );
     }
 
     public void testTreeFromXML() throws Throwable
     {
-        SAXParser p = SAXParserFactory.newInstance().newSAXParser();
-        Handler h = new Handler();
-        Builder b = new Builder( p, h  );
+        final SAXParser p = SAXParserFactory.newInstance().newSAXParser();
+        final Handler h = new Handler();
+        final Builder b = new Builder( p, h  );
 
-        String xml = "<?xml version=\"1.0\"?>\n" +
+        final String xml = "<?xml version=\"1.0\"?>\n" +
                 "<html><head><title>Blah</title></head></html>";
-        StringBufferInputStream s = new StringBufferInputStream(xml);
+        final StringBufferInputStream s = new StringBufferInputStream(xml);
 
-        Node n = b.treeFromXML( s );
+        final Node n = b.treeFromXML( s );
         assertNotNull(n);
         assertTrue( h.getNodeCalled );
         assertTrue( h.recycleCalled );
@@ -106,8 +106,8 @@
 
     public final static class Builder extends NodeBuilder
     {
-        public Builder( SAXParser parser,
-                AbstractXMLNodeHandler handler )
+        public Builder( final SAXParser parser,
+                final AbstractXMLNodeHandler handler )
         {
             super( parser, handler );
         }

Index: NodeTestCase.java
===================================================================
RCS file: /cvsroot/jicarilla/jicarilla-sandbox/platform/components/collections/src/test/org/jicarilla/collections/test/NodeTestCase.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- NodeTestCase.java	4 Jan 2004 16:10:17 -0000	1.2
+++ NodeTestCase.java	26 Feb 2004 16:51:54 -0000	1.3
@@ -49,17 +49,17 @@
                 return 0;
             }
 
-            public boolean containsKey( Object key )
+            public boolean containsKey( final Object key )
             {
                 return false;
             }
 
-            public boolean containsValue( Object value )
+            public boolean containsValue( final Object value )
             {
                 return false;
             }
 
-            public boolean equals( Object o )
+            public boolean equals( final Object o )
             {
                 return false;
             }
@@ -69,7 +69,7 @@
                 return null;
             }
 
-            public void putAll( Map t )
+            public void putAll( final Map t )
             {
             }
 
@@ -83,17 +83,17 @@
                 return null;
             }
 
-            public Object get( Object key )
+            public Object get( final Object key )
             {
                 return null;
             }
 
-            public Object remove( Object key )
+            public Object remove( final Object key )
             {
                 return null;
             }
 
-            public Object put( Object key, Object value )
+            public Object put( final Object key, final Object value )
             {
                 return null;
             }
@@ -103,7 +103,7 @@
                 return null;
             }
 
-            public String setName( String s )
+            public String setName( final String s )
             {
                 return null;
             }
@@ -113,7 +113,7 @@
                 return null;
             }
 
-            public Object setContents( Object o )
+            public Object setContents( final Object o )
             {
                 return null;
             }
@@ -134,22 +134,22 @@
             }
 
             // List
-            public boolean addChild( Node n )
+            public boolean addChild( final Node n )
             {
                 return false;
             }
 
-            public boolean addChildren( Collection c )
+            public boolean addChildren( final Collection c )
             {
                 return false;
             }
 
-            public boolean containsChild( Node n )
+            public boolean containsChild( final Node n )
             {
                 return false;
             }
 
-            public boolean containsChildren( Collection c )
+            public boolean containsChildren( final Collection c )
             {
                 return false;
             }
@@ -159,12 +159,12 @@
                 return null;
             }
 
-            public boolean removeChild( Node n )
+            public boolean removeChild( final Node n )
             {
                 return false;
             }
 
-            public boolean removeChildren( Collection c )
+            public boolean removeChildren( final Collection c )
             {
                 return false;
             }
@@ -174,7 +174,7 @@
                 return new Node[0];
             }
 
-            public Node[] childrenToArray( Object[] o )
+            public Node[] childrenToArray( final Object[] o )
             {
                 return new Node[0];
             }



-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.