Source:
<code>public EventDefinition readNextEvent() throws CTFReaderException { long eventID = 0; long timestamp = 0; if (lostEventsInThisPacket > lostSoFar) { EventDefinition eventDef = EventDeclaration.getLostEventDeclaration().createDefinition(streamInputReader); <START> ((IntegerDefinition)eventDef.getFields().getDefinitions().get("Lost events")).setValue(lostEventsInThisPacket); END> eventDef.setTimestamp(this.lastTimestamp); lostSoFar = lostEventsInThisPacket; return eventDef; } final StructDefinition sehd = streamEventHeaderDef; final BitBuffer currentBitBuffer = bitBuffer; if (sehd != null) { sehd.read(currentBitBuffer); Definition idDef = sehd.lookupDefinition("id"); if (idDef instanceof SimpleDatatypeDefinition) { eventID = ((SimpleDatatypeDefinition) idDef).getIntegerValue(); } IntegerDefinition timestampDef = sehd.lookupInteger("timestamp"); if (timestampDef != null) { timestamp = calculateTimestamp(timestampDef); } Definition variantDef = sehd.lookupDefinition("v"); if (variantDef instanceof VariantDefinition) { StructDefinition variantCurrentField = (StructDefinition) ((VariantDefinition) variantDef).getCurrentField(); Definition idIntegerDef = variantCurrentField.lookupDefinition("id"); if (idIntegerDef instanceof IntegerDefinition) { eventID = ((IntegerDefinition) idIntegerDef).getValue(); } Definition def = variantCurrentField.lookupDefinition("timestamp"); if (def instanceof IntegerDefinition) { timestamp = calculateTimestamp((IntegerDefinition) def); } } } if (streamEventContextDef != null) { streamEventContextDef.read(currentBitBuffer); } EventDefinition eventDef = events.get(eventID); if (eventDef == null) { throw new CTFReaderException("Incorrect event id : " + eventID); } if (eventDef.getEventContext() != null) { eventDef.getEventContext().read(currentBitBuffer); } if (eventDef.getFields() != null) { eventDef.getFields().read(currentBitBuffer); } eventDef.setTimestamp(timestamp); return eventDef; }</code><technical_language>is a string constant instead</technical_language>

Target:
public EventDefinition readNextEvent() throws CTFReaderException { long eventID = 0; long timestamp = 0; if (lostEventsInThisPacket > lostSoFar) { EventDefinition eventDef = EventDeclaration.getLostEventDeclaration().createDefinition(streamInputReader); ((IntegerDefinition) eventDef.getFields().getDefinitions().get(CTFStrings.LOST_EVENTS_FIELD)).setValue(lostEventsInThisPacket); eventDef.setTimestamp(this.lastTimestamp); lostSoFar = lostEventsInThisPacket; return eventDef; } final StructDefinition sehd = streamEventHeaderDef; final BitBuffer currentBitBuffer = bitBuffer; if (sehd != null) { sehd.read(currentBitBuffer); Definition idDef = sehd.lookupDefinition("id"); if (idDef instanceof SimpleDatatypeDefinition) { eventID = ((SimpleDatatypeDefinition) idDef).getIntegerValue(); } IntegerDefinition timestampDef = sehd.lookupInteger("timestamp"); if (timestampDef != null) { timestamp = calculateTimestamp(timestampDef); } Definition variantDef = sehd.lookupDefinition("v"); if (variantDef instanceof VariantDefinition) { StructDefinition variantCurrentField = (StructDefinition) ((VariantDefinition) variantDef).getCurrentField(); Definition idIntegerDef = variantCurrentField.lookupDefinition("id"); if (idIntegerDef instanceof IntegerDefinition) { eventID = ((IntegerDefinition) idIntegerDef).getValue(); } Definition def = variantCurrentField.lookupDefinition("timestamp"); if (def instanceof IntegerDefinition) { timestamp = calculateTimestamp((IntegerDefinition) def); } } } if (streamEventContextDef != null) { streamEventContextDef.read(currentBitBuffer); } EventDefinition eventDef = events.get(eventID); if (eventDef == null) { throw new CTFReaderException("Incorrect event id : " + eventID); } if (eventDef.getEventContext() != null) { eventDef.getEventContext().read(currentBitBuffer); } if (eventDef.getFields() != null) { eventDef.getFields().read(currentBitBuffer); } eventDef.setTimestamp(timestamp); return eventDef; }