Author: pferraro
Date: 2008-11-01 14:02:11 -0400 (Sat, 01 Nov 2008)
New Revision: 2047
Modified:
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java
Log:
Minor logic consolidation
Modified:
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java
===================================================================
---
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java 2008-11-01
01:15:18 UTC (rev 2046)
+++
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java 2008-11-01
18:02:11 UTC (rev 2047)
@@ -495,7 +495,7 @@
if (line.startsWith("Node:"))
{
String[] entries = line.split(",");
- String nodeId = this.parseId(entries[0]);
+ String nodeId = this.parseIds(entries[0])[0];
// We can skip the first entry
for (int i = 1; i < entries.length; ++i)
@@ -522,7 +522,7 @@
else if (line.startsWith("Vhost:"))
{
String[] entries = line.split(",");
- String[] ids = this.parseId(entries[0]).split(":");
+ String[] ids = this.parseIds(entries[0]);
if (ids.length != 3)
{
@@ -570,7 +570,7 @@
else if (line.startsWith("Context:"))
{
String[] entries = line.split(",");
- String[] ids = this.parseId(entries[0]).split(":");
+ String[] ids = this.parseIds(entries[0]);
if (ids.length != 3)
{
@@ -642,7 +642,7 @@
return result;
}
- private String parseId(String entry)
+ private String[] parseIds(String entry)
{
int start = entry.indexOf('[') + 1;
int end = entry.indexOf(']');
@@ -652,7 +652,9 @@
throw new IllegalArgumentException(entry);
}
- return entry.substring(start, end);
+ String ids = entry.substring(start, end);
+
+ return (ids.length() > 2) ? ids.split(":") : new String[] { ids };
}
/**
Show replies by date