struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcucchi...@apache.org
Subject svn commit: r1173226 - in /struts/struts2/trunk/plugins/sitegraph/src: main/java/org/apache/struts2/sitegraph/ main/java/org/apache/struts2/sitegraph/model/ test/java/org/apache/struts2/sitegraph/
Date Tue, 20 Sep 2011 16:29:38 GMT
Author: mcucchiara
Date: Tue Sep 20 16:29:37 2011
New Revision: 1173226

URL: http://svn.apache.org/viewvc?rev=1173226&view=rev
Log:
Partial upgrade to java 5

Modified:
    struts/struts2/trunk/plugins/sitegraph/src/main/java/org/apache/struts2/sitegraph/SiteGraph.java
    struts/struts2/trunk/plugins/sitegraph/src/main/java/org/apache/struts2/sitegraph/StrutsConfigRetriever.java
    struts/struts2/trunk/plugins/sitegraph/src/main/java/org/apache/struts2/sitegraph/model/Graph.java
    struts/struts2/trunk/plugins/sitegraph/src/main/java/org/apache/struts2/sitegraph/model/Link.java
    struts/struts2/trunk/plugins/sitegraph/src/test/java/org/apache/struts2/sitegraph/SiteGraphTest.java

Modified: struts/struts2/trunk/plugins/sitegraph/src/main/java/org/apache/struts2/sitegraph/SiteGraph.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/sitegraph/src/main/java/org/apache/struts2/sitegraph/SiteGraph.java?rev=1173226&r1=1173225&r2=1173226&view=diff
==============================================================================
--- struts/struts2/trunk/plugins/sitegraph/src/main/java/org/apache/struts2/sitegraph/SiteGraph.java
(original)
+++ struts/struts2/trunk/plugins/sitegraph/src/main/java/org/apache/struts2/sitegraph/SiteGraph.java
Tue Sep 20 16:29:37 2011
@@ -68,7 +68,7 @@ public class SiteGraph {
         if (args.length != 8 && args.length != 6) {
             InputStream is = SiteGraph.class.getResourceAsStream("sitegraph-usage.txt");
             byte[] buffer = new byte[2048];
-            int length = -1;
+            int length;
             ByteArrayOutputStream baos = new ByteArrayOutputStream();
             while ((length = is.read(buffer)) != -1) {
                 baos.write(buffer, 0, length);

Modified: struts/struts2/trunk/plugins/sitegraph/src/main/java/org/apache/struts2/sitegraph/StrutsConfigRetriever.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/sitegraph/src/main/java/org/apache/struts2/sitegraph/StrutsConfigRetriever.java?rev=1173226&r1=1173225&r2=1173226&view=diff
==============================================================================
--- struts/struts2/trunk/plugins/sitegraph/src/main/java/org/apache/struts2/sitegraph/StrutsConfigRetriever.java
(original)
+++ struts/struts2/trunk/plugins/sitegraph/src/main/java/org/apache/struts2/sitegraph/StrutsConfigRetriever.java
Tue Sep 20 16:29:37 2011
@@ -72,11 +72,11 @@ public class StrutsConfigRetriever {
         try {
             ConfigurationProvider configProvider = new StrutsXmlConfigurationProvider(configFile.getCanonicalPath(),
true, null);
             cm = new ConfigurationManager();
-            cm.addConfigurationProvider(new DefaultPropertiesProvider());
-            cm.addConfigurationProvider(new StrutsXmlConfigurationProvider("struts-default.xml",
false, null));
-            cm.addConfigurationProvider(configProvider);
-            cm.addConfigurationProvider(new LegacyPropertiesConfigurationProvider());
-            cm.addConfigurationProvider(new BeanSelectionProvider());
+            cm.addContainerProvider(new DefaultPropertiesProvider());
+            cm.addContainerProvider(new StrutsXmlConfigurationProvider("struts-default.xml",
false, null));
+            cm.addContainerProvider(configProvider);
+            cm.addContainerProvider(new LegacyPropertiesConfigurationProvider());
+            cm.addContainerProvider(new BeanSelectionProvider());
             isXWorkStarted = true;
         } catch (IOException e) {
             LOG.error("IOException", e);

Modified: struts/struts2/trunk/plugins/sitegraph/src/main/java/org/apache/struts2/sitegraph/model/Graph.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/sitegraph/src/main/java/org/apache/struts2/sitegraph/model/Graph.java?rev=1173226&r1=1173225&r2=1173226&view=diff
==============================================================================
--- struts/struts2/trunk/plugins/sitegraph/src/main/java/org/apache/struts2/sitegraph/model/Graph.java
(original)
+++ struts/struts2/trunk/plugins/sitegraph/src/main/java/org/apache/struts2/sitegraph/model/Graph.java
Tue Sep 20 16:29:37 2011
@@ -22,7 +22,6 @@
 package org.apache.struts2.sitegraph.model;
 
 import java.io.IOException;
-import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.Map;
 import java.util.Set;
@@ -57,14 +56,12 @@ public class Graph extends SubGraph {
         }
 
         // render all the nodes
-        for (Iterator iterator = nodes.iterator(); iterator.hasNext();) {
-            SiteGraphNode siteGraphNode = (SiteGraphNode) iterator.next();
+        for (SiteGraphNode siteGraphNode : nodes) {
             siteGraphNode.render(writer);
         }
 
         // finally, render the links
-        for (Iterator iterator = links.iterator(); iterator.hasNext();) {
-            Link link = (Link) iterator.next();
+        for (Link link : links) {
             link.render(writer);
         }
 

Modified: struts/struts2/trunk/plugins/sitegraph/src/main/java/org/apache/struts2/sitegraph/model/Link.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/sitegraph/src/main/java/org/apache/struts2/sitegraph/model/Link.java?rev=1173226&r1=1173225&r2=1173226&view=diff
==============================================================================
--- struts/struts2/trunk/plugins/sitegraph/src/main/java/org/apache/struts2/sitegraph/model/Link.java
(original)
+++ struts/struts2/trunk/plugins/sitegraph/src/main/java/org/apache/struts2/sitegraph/model/Link.java
Tue Sep 20 16:29:37 2011
@@ -90,6 +90,6 @@ public class Link implements Render, Com
             return result;
         }
 
-        return new Integer(type).compareTo(new Integer(other.type));
+        return new Integer(type).compareTo(other.type);
     }
 }

Modified: struts/struts2/trunk/plugins/sitegraph/src/test/java/org/apache/struts2/sitegraph/SiteGraphTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/sitegraph/src/test/java/org/apache/struts2/sitegraph/SiteGraphTest.java?rev=1173226&r1=1173225&r2=1173226&view=diff
==============================================================================
--- struts/struts2/trunk/plugins/sitegraph/src/test/java/org/apache/struts2/sitegraph/SiteGraphTest.java
(original)
+++ struts/struts2/trunk/plugins/sitegraph/src/test/java/org/apache/struts2/sitegraph/SiteGraphTest.java
Tue Sep 20 16:29:37 2011
@@ -46,7 +46,7 @@ public class SiteGraphTest extends Strut
         siteGraph.prepare();
 
         URL compare = SiteGraphTest.class.getResource("out.txt");
-        StringBuffer buffer = new StringBuffer(128);
+        StringBuilder buffer = new StringBuilder(128);
         InputStream in = compare.openStream();
         byte[] buf = new byte[4096];
         int nbytes;



Mime
View raw message