modules/core/domain/src/main/java/org/rhq/core/domain/cloud/composite/FailoverListComposite.java | 63 ++++------ 1 file changed, 30 insertions(+), 33 deletions(-)
New commits: commit 6c4b785259bdd080d9cf46e20cd4bbae3f407b61 Author: John Mazzitelli mazz@redhat.com Date: Sun Mar 21 21:52:17 2010 -0400
fix this so the test passes again, this was a legit test failure
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/composite/FailoverListComposite.java b/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/composite/FailoverListComposite.java index 46bc7c9..fe4510e 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/composite/FailoverListComposite.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/composite/FailoverListComposite.java @@ -152,10 +152,11 @@ public class FailoverListComposite implements Iterator<FailoverListComposite.Ser }
public void remove() { - throw new UnsupportedOperationException(this.getClass().getName().substring(this.getClass().getName().lastIndexOf(".")+1) + " are immutable lists, removal is disallowed"); + throw new UnsupportedOperationException(this.getClass().getName().substring( + this.getClass().getName().lastIndexOf(".") + 1) + + " are immutable lists, removal is disallowed"); }
- /** * Used to "serialize" this list in a human-readable form (useful for storing the list * in a text file that humans can read and potentially edit). @@ -182,13 +183,9 @@ public class FailoverListComposite implements Iterator<FailoverListComposite.Ser public static FailoverListComposite readAsText(String text) { List<ServerEntry> servers = new ArrayList<ServerEntry>();
- String[] failoverListArray = text.split("."); - // TODO: GWT (Check to make sure this works) - //StringTokenizer rowTokenizer = new StringTokenizer(text, "\n"); - //while (rowTokenizer.hasMoreTokens()) { + String[] failoverListArray = text.split("\n"); for (String row : failoverListArray) { try { - //String row = rowTokenizer.nextToken(); String[] addressPorts = row.split(":"); String[] ports = addressPorts[1].split("/"); servers.add(new ServerEntry(addressPorts[0], Integer.parseInt(ports[0]), Integer.parseInt(ports[1]))); @@ -199,34 +196,34 @@ public class FailoverListComposite implements Iterator<FailoverListComposite.Ser return new FailoverListComposite(servers); }
- /* TODO: GWT - private void writeObject(ObjectOutputStream out) throws IOException { - out.writeInt(size()); - for (ServerEntry entry : servers) { - out.writeUTF(entry.address); - out.writeInt(entry.port); - out.writeInt(entry.securePort); - } - } - - private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { - int size = in.readInt(); - - List<ServerEntry> entries = new ArrayList<ServerEntry>(); - for (int i = 0; i < size; i++) { - String address = in.readUTF(); - int port = in.readInt(); - int securePort = in.readInt(); - entries.add(new ServerEntry(address, port, securePort)); - } + /* TODO: GWT + private void writeObject(ObjectOutputStream out) throws IOException { + out.writeInt(size()); + for (ServerEntry entry : servers) { + out.writeUTF(entry.address); + out.writeInt(entry.port); + out.writeInt(entry.securePort); + } + } + + private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { + int size = in.readInt(); + + List<ServerEntry> entries = new ArrayList<ServerEntry>(); + for (int i = 0; i < size; i++) { + String address = in.readUTF(); + int port = in.readInt(); + int securePort = in.readInt(); + entries.add(new ServerEntry(address, port, securePort)); + }
- *//* - * no need to wrap 'entries' in a new list before putting them into the immutable wrapper; - * as long as the 'entries' reference does not escape this method, we can be assured that - * 'servers' is correctly immutable. *//* - servers = Collections.unmodifiableList(entries); - }*/ + * no need to wrap 'entries' in a new list before putting them into the immutable wrapper; + * as long as the 'entries' reference does not escape this method, we can be assured that + * 'servers' is correctly immutable. + *//* + servers = Collections.unmodifiableList(entries); + }*/
@Override public String toString() {
rhq-commits@lists.fedorahosted.org