/**
  * Writes a trace which has a source location
  *
  * @param refId file reference number
  * @param trace the trace
  */
 private void writeTraceWithLocation(int refId, Trace trace) {
   LocationProperties loc = findFirstLocation(trace);
   int line = 0;
   String className = ""; // $NON-NLS-1$
   String functionName = ""; // $NON-NLS-1$
   if (loc != null) {
     line = loc.getLineNumber();
     className = loc.getClassName();
     functionName = loc.getFunctionName();
   }
   com.nokia.tracecompiler.decodeplugins.dictionary.encoder.Trace.writeInstance(
       trace.getID(), refId, line, functionName, className);
 }
 /**
  * Creates a trace definition
  *
  * @param trace the trace
  */
 private void createTrace(Trace trace) {
   DictionaryDefRef defref = trace.getExtension(DictionaryDefRef.class);
   if (defref != null) {
     DictionaryFileRef fileref = trace.getExtension(DictionaryFileRef.class);
     com.nokia.tracecompiler.decodeplugins.dictionary.encoder.TraceGroup.startTrace(
         defref.getRefId(), trace.getName());
     if (fileref != null) {
       writeTraceWithLocation(fileref.getRefId(), trace);
     } else {
       com.nokia.tracecompiler.decodeplugins.dictionary.encoder.Trace.writeInstance(
           trace.getID(),
           0,
           0,
           "", //$NON-NLS-1$
           ""); //$NON-NLS-1$
     }
     com.nokia.tracecompiler.decodeplugins.dictionary.encoder.TraceGroup.endTrace();
   }
   trace.removeExtensions(DictionaryRef.class);
 }