[jboss-cvs] JBossAS SVN: r74492 - projects/vfs/trunk/src/main/java/org/jboss/virtual/plugins/context/memory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Jun 12 11:55:45 EDT 2008
Author: alesj
Date: 2008-06-12 11:55:45 -0400 (Thu, 12 Jun 2008)
New Revision: 74492
Modified:
projects/vfs/trunk/src/main/java/org/jboss/virtual/plugins/context/memory/MemoryContext.java
Log:
For-loop.
Modified: projects/vfs/trunk/src/main/java/org/jboss/virtual/plugins/context/memory/MemoryContext.java
===================================================================
--- projects/vfs/trunk/src/main/java/org/jboss/virtual/plugins/context/memory/MemoryContext.java 2008-06-12 15:51:59 UTC (rev 74491)
+++ projects/vfs/trunk/src/main/java/org/jboss/virtual/plugins/context/memory/MemoryContext.java 2008-06-12 15:55:45 UTC (rev 74492)
@@ -87,34 +87,34 @@
String protocolAndHost = url.getProtocol() + "://" + url.getHost();
StringBuffer path = new StringBuffer(protocolAndHost);
MemoryContextHandler current = root;
- for (int i = 0 ; i < tokens.size() ; i++)
+ for (String token : tokens)
{
path.append("/");
- path.append(tokens.get(i));
-
- if (!definitelyNew)
+ path.append(token);
+
+ if (definitelyNew == false)
{
try
{
- MemoryContextHandler child = current.getDirectChild(tokens.get(i));
+ MemoryContextHandler child = current.getDirectChild(token);
if (child != null)
{
current = child;
continue;
}
}
- catch(Exception ignore)
+ catch (Exception ignore)
{
}
definitelyNew = true;
- }
-
+ }
+
URL localUrl = new URL(path.toString());
if (current.getContents() != null)
{
throw new IllegalStateException("Cannot add a child to " + current + " it already has contents");
}
- current = new MemoryContextHandler(this, current, localUrl, tokens.get(i));
+ current = new MemoryContextHandler(this, current, localUrl, token);
}
current.setContents(contents);
More information about the jboss-cvs-commits
mailing list