Source:
<code><START> private CtfTmfEventField[] parseFields(EventDefinition eventDef) { <END> List<CtfTmfEventField> fields = new ArrayList<CtfTmfEventField>(); StructDefinition structFields = eventDef.getFields(); HashMap<String, Definition> definitions = structFields.getDefinitions(); String curFieldName = null; Definition curFieldDef; CtfTmfEventField curField; Iterator<Entry<String, Definition>> it = definitions.entrySet().iterator(); while(it.hasNext()) { Entry<String, Definition> entry = it.next(); curFieldName = entry.getKey(); curFieldDef = entry.getValue(); curField = CtfTmfEventField.parseField(curFieldDef, curFieldName); fields.add(curField); } long ip = -1; StructDefinition structContext = eventDef.getContext(); if (structContext != null) { definitions = structContext.getDefinitions(); String curContextName; Definition curContextDef; CtfTmfEventField curContext; it = definitions.entrySet().iterator(); while(it.hasNext()) { Entry<String, Definition> entry = it.next(); if (entry.getKey().equals("_ip")) { ip = ((IntegerDefinition) entry.getValue()).getValue(); } curContextName = CONTEXT_FIELD_PREFIX + entry.getKey(); curContextDef = entry.getValue(); curContext = CtfTmfEventField.parseField(curContextDef, curContextName); fields.add(curContext); } } final String name = eventDef.getDeclaration().getName(); List<Callsite> eventList = this.fTrace.getCTFTrace().getCallsiteCandidates(name); if (eventList != null) { final String callsite = "callsite"; if (eventList.size() == 1 || ip == -1) { Callsite cs = eventList.get(0); fields.add(new CTFStringField(cs.toString(), callsite)); } else { fields.add(new CTFStringField( this.fTrace.getCTFTrace().getCallsite(name, ip).toString(), callsite)); } } return fields.toArray(new CtfTmfEventField[fields.size()]); }</code><technical_language>want un-static-ize this? get trace EventDefinition</technical_language>

Target:
private CtfTmfEventField[] parseFields(EventDefinition eventDef) { List<CtfTmfEventField> fields = new ArrayList<CtfTmfEventField>(); StructDefinition structFields = eventDef.getFields(); HashMap<String, Definition> definitions = structFields.getDefinitions(); String curFieldName = null; Definition curFieldDef; CtfTmfEventField curField; Iterator<Entry<String, Definition>> it = definitions.entrySet().iterator(); while(it.hasNext()) { Entry<String, Definition> entry = it.next(); curFieldName = entry.getKey(); curFieldDef = entry.getValue(); curField = CtfTmfEventField.parseField(curFieldDef, curFieldName); fields.add(curField); } long ip = -1; StructDefinition structContext = eventDef.getContext(); if (structContext != null) { definitions = structContext.getDefinitions(); String curContextName; Definition curContextDef; CtfTmfEventField curContext; it = definitions.entrySet().iterator(); while(it.hasNext()) { Entry<String, Definition> entry = it.next(); if (entry.getKey().equals("_ip")) { ip = ((IntegerDefinition) entry.getValue()).getValue(); } curContextName = CONTEXT_FIELD_PREFIX + entry.getKey(); curContextDef = entry.getValue(); curContext = CtfTmfEventField.parseField(curContextDef, curContextName); fields.add(curContext); } } final String name = eventDef.getDeclaration().getName(); List<CTFCallsite> eventList = this.fTrace.getCTFTrace().getCallsiteCandidates(name); if (eventList != null) { final String callsite = "callsite"; if (eventList.size() == 1 || ip == -1) { CTFCallsite cs = eventList.get(0); fields.add(new CTFStringField(cs.toString(), callsite)); } else { fields.add(new CTFStringField( this.fTrace.getCTFTrace().getCallsite(name, ip).toString(), callsite)); } } return fields.toArray(new CtfTmfEventField[fields.size()]); }