mirror of
https://github.com/apache/struts.git
synced 2026-08-11 01:27:14 +00:00
Partial upgrade to java 5
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1173226 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -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);
|
||||
|
||||
+5
-5
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -90,6 +90,6 @@ public class Link implements Render, Comparable {
|
||||
return result;
|
||||
}
|
||||
|
||||
return new Integer(type).compareTo(new Integer(other.type));
|
||||
return new Integer(type).compareTo(other.type);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public class SiteGraphTest extends StrutsTestCase {
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user