From: jihoonl Date: Wed, 8 Jul 2009 22:01:30 +0000 (+0000) Subject: Critical mistake was in Stream.java X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c550a82cedb7d0052602d3e25b67f9496eecbd48;p=IRC.git Critical mistake was in Stream.java allocating string problem also been removed after fixing the mistake --- diff --git a/Robust/src/Benchmarks/SingleTM/Intruder/Decoder.java b/Robust/src/Benchmarks/SingleTM/Intruder/Decoder.java index 41bfe2b1..972d1bf2 100644 --- a/Robust/src/Benchmarks/SingleTM/Intruder/Decoder.java +++ b/Robust/src/Benchmarks/SingleTM/Intruder/Decoder.java @@ -245,12 +245,12 @@ public class Decoder { String data = new String(); + Packet fragmentPtr = null; it.reset(fragmentListPtr); while(it.hasNext(fragmentListPtr)) { - Packet fragmentPtr = (Packet)it.next(fragmentListPtr); - - data = (new String(fragmentPtr.data)); + fragmentPtr = (Packet)it.next(fragmentListPtr); + data +=(fragmentPtr.data); } Decoded decodedPtr = new Decoded(); diff --git a/Robust/src/Benchmarks/SingleTM/Intruder/Stream.java b/Robust/src/Benchmarks/SingleTM/Intruder/Stream.java index 33a2577f..a432f096 100644 --- a/Robust/src/Benchmarks/SingleTM/Intruder/Stream.java +++ b/Robust/src/Benchmarks/SingleTM/Intruder/Stream.java @@ -96,10 +96,9 @@ public class Stream { bytes.fragmentId = p; bytes.numFragment = numPacket; bytes.length = str.length(); - endIndex = numByte -1; - String tmpstr = str.subString(beginIndex, endIndex); - bytes.data = new String(str); + String tmpstr = str.subString(beginIndex); + bytes.data = new String(tmpstr); status = packetQueuePtr.queue_push(bytes); if (status == false) { System.out.printString("Error: Queue push failed\n");