Critical mistake was in Stream.java
authorjihoonl <jihoonl>
Wed, 8 Jul 2009 22:01:30 +0000 (22:01 +0000)
committerjihoonl <jihoonl>
Wed, 8 Jul 2009 22:01:30 +0000 (22:01 +0000)
allocating string problem also been removed after fixing the mistake

Robust/src/Benchmarks/SingleTM/Intruder/Decoder.java
Robust/src/Benchmarks/SingleTM/Intruder/Stream.java

index 41bfe2b1e3071c2982dac39cffd1efeb1803eb86..972d1bf23d32fc28ee96a7462983273a7e6df75e 100644 (file)
@@ -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();
index 33a2577f1891661a55f4ec07fc485773c6506d6c..a432f0961c0d3709950e125507fad97cd2790e53 100644 (file)
@@ -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");