Contribution for Bug352466: [TMF] Implement UML2 Sequence Diagram
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.tests / stubs / org / eclipse / linuxtools / tmf / trace / TmfEventParserStub.java
index ddc53dd5a08d0a19c12d8222ff6b1ed4dcea7f30..eab0891473a8abaebd56697eb45237f183bb1f7d 100644 (file)
@@ -74,44 +74,44 @@ public class TmfEventParserStub implements ITmfEventParser {
                String name = eventStream.getName();
                name = name.substring(name.lastIndexOf('/') + 1);
 
-        synchronized(stream) {
-               long location = 0;
-               if (context != null)
-                       location = ((TmfLocation<Long>) (context.getLocation())).getLocation();
-               stream.seek(location);
-
-               try {
-                       long ts        = stream.readLong();
-                       String source  = stream.readUTF();
-                       String type    = stream.readUTF();
-                       @SuppressWarnings("unused")
-                       int reference  = stream.readInt();
-                       int typeIndex  = Integer.parseInt(type.substring(typePrefix.length()));
-                       String[] fields = new String[typeIndex];
-                       for (int i = 0; i < typeIndex; i++) {
-                               fields[i] = stream.readUTF();
-                       }
-
-                       String content = "[";
-                       if (typeIndex > 0) {
-                               content += fields[0];
-                       }
-                       for (int i = 1; i < typeIndex; i++) {
-                               content += ", " + fields[i];
-                       }
-                       content += "]";
-
-                       TmfEvent event = new TmfEvent(
-                                       new TmfTimestamp(ts, (byte) -3, 0),     // millisecs
-                                       new TmfEventSource(source),
-                                       fTypes[typeIndex],
-                                       new TmfEventReference(name));
-                               TmfEventContent cnt = new TmfEventContent(event, content);
-                               event.setContent(cnt);
-                               return event;
-               } catch (EOFException e) {
-               }
-        }
+               // no need to use synchronized since it's already cover by the calling method
+               
+               long location = 0;
+               if (context != null)
+                   location = ((TmfLocation<Long>) (context.getLocation())).getLocation();
+               stream.seek(location);
+
+               try {
+                   long ts        = stream.readLong();
+                   String source  = stream.readUTF();
+                   String type    = stream.readUTF();
+                   @SuppressWarnings("unused")
+                   int reference  = stream.readInt();
+                   int typeIndex  = Integer.parseInt(type.substring(typePrefix.length()));
+                   String[] fields = new String[typeIndex];
+                   for (int i = 0; i < typeIndex; i++) {
+                       fields[i] = stream.readUTF();
+                   }
+
+                   String content = "[";
+                   if (typeIndex > 0) {
+                       content += fields[0];
+                   }
+                   for (int i = 1; i < typeIndex; i++) {
+                       content += ", " + fields[i];
+                   }
+                   content += "]";
+
+                   TmfEvent event = new TmfEvent(
+                           new TmfTimestamp(ts, (byte) -3, 0),     // millisecs
+                           new TmfEventSource(source),
+                           fTypes[typeIndex],
+                           new TmfEventReference(name));
+                   TmfEventContent cnt = new TmfEventContent(event, content);
+                   event.setContent(cnt);
+                   return event;
+               } catch (EOFException e) {
+               }
         return null;
     }
 
This page took 0.025134 seconds and 5 git commands to generate.