nus-yam/ex-repair huggingface dataset:
Program: 156164
Project: 156164
Buggy source:
@Override public Address parseAddress(JsonObject json){
  JsonArray results=json.getJsonArray("String_Node_Str");
  if (!results.isEmpty()) {
    Address address=new Address();
    JsonObject result=(JsonObject)results.get(0);
    JsonArray components=result.getJsonArray("String_Node_Str");
    for (    JsonObject component : components.getValuesAs(JsonObject.class)) {
      String value=component.getString("String_Node_Str");
      typesLoop:       for (      JsonString type : component.getJsonArray("String_Node_Str").getValuesAs(JsonString.class)) {
switch (type.getString()) {
case "String_Node_Str":
          address.setHouse(value);
        break typesLoop;
case "String_Node_Str":
      address.setStreet(value);
    break typesLoop;
case "String_Node_Str":
  address.setSettlement(value);
break typesLoop;
case "String_Node_Str":
address.setDistrict(value);
break typesLoop;
case "String_Node_Str":
address.setState(value);
break typesLoop;
case "String_Node_Str":
address.setCountry(value);
break typesLoop;
case "String_Node_Str":
address.setPostcode(value);
break typesLoop;
}
}
}
return address;
}
return null;
}

Fixed version (ground truth):
@Override public Address parseAddress(JsonObject json){
  JsonArray results=json.getJsonArray("String_Node_Str");
  if (!results.isEmpty()) {
    Address address=new Address();
    JsonObject result=(JsonObject)results.get(0);
    JsonArray components=result.getJsonArray("String_Node_Str");
    for (    JsonObject component : components.getValuesAs(JsonObject.class)) {
      String value=component.getString("String_Node_Str");
      typesLoop:       for (      JsonString type : component.getJsonArray("String_Node_Str").getValuesAs(JsonString.class)) {
switch (type.getString()) {
case "String_Node_Str":
          address.setHouse(value);
        break typesLoop;
case "String_Node_Str":
      address.setStreet(value);
    break typesLoop;
case "String_Node_Str":
  address.setSettlement(value);
break typesLoop;
case "String_Node_Str":
address.setDistrict(value);
break typesLoop;
case "String_Node_Str":
address.setState(value);
break typesLoop;
case "String_Node_Str":
address.setCountry(value);
break typesLoop;
case "String_Node_Str":
address.setPostcode(value);
break typesLoop;
default :
break;
}
}
}
return address;
}
return null;
}
Program: 156165
Project: 156165
Buggy source:
private static int getTagLength(int tag){
  return tagLengthMap.get(tag);
}

Fixed version (ground truth):
private static int getTagLength(int tag){
  return TAG_LENGTH_MAP.get(tag);
}
Program: 156166
Project: 156166
Buggy source:
@Override protected Object encodeCommand(Command command){
switch (command.getType()) {
case Command.TYPE_ENGINE_STOP:
    return encodeCommand(MSG_CUT_OIL);
case Command.TYPE_ENGINE_RESUME:
  return encodeCommand(MSG_RESUME_OIL);
}
return null;
}

Fixed version (ground truth):
@Override protected Object encodeCommand(Command command){
switch (command.getType()) {
case Command.TYPE_ENGINE_STOP:
    return encodeCommand(MSG_CUT_OIL);
case Command.TYPE_ENGINE_RESUME:
  return encodeCommand(MSG_RESUME_OIL);
default :
Log.warning(new UnsupportedOperationException(command.getType()));
break;
}
return null;
}
Program: 156168
Project: 156168
Buggy source:
@Override protected Object encodeCommand(Command command){
switch (command.getType()) {
case Command.TYPE_ENGINE_STOP:
    return formatCommand(command,"String_Node_Str",Command.KEY_UNIQUE_ID);
case Command.TYPE_ENGINE_RESUME:
  return formatCommand(command,"String_Node_Str",Command.KEY_UNIQUE_ID);
}
return null;
}

Fixed version (ground truth):
@Override protected Object encodeCommand(Command command){
switch (command.getType()) {
case Command.TYPE_ENGINE_STOP:
    return formatCommand(command,"String_Node_Str",Command.KEY_UNIQUE_ID);
case Command.TYPE_ENGINE_RESUME:
  return formatCommand(command,"String_Node_Str",Command.KEY_UNIQUE_ID);
default :
Log.warning(new UnsupportedOperationException(command.getType()));
break;
}
return null;
}
Program: 156169
Project: 156169
Buggy source:
@Override protected Object encodeCommand(Command command){
  command.set(Command.KEY_DEVICE_PASSWORD,"String_Node_Str");
switch (command.getType()) {
case Command.TYPE_ENGINE_STOP:
    return formatCommand(command,"String_Node_Str",Command.KEY_DEVICE_PASSWORD);
case Command.TYPE_ENGINE_RESUME:
  return formatCommand(command,"String_Node_Str",Command.KEY_DEVICE_PASSWORD);
}
return null;
}

Fixed version (ground truth):
@Override protected Object encodeCommand(Command command){
  command.set(Command.KEY_DEVICE_PASSWORD,"String_Node_Str");
switch (command.getType()) {
case Command.TYPE_ENGINE_STOP:
    return formatCommand(command,"String_Node_Str",Command.KEY_DEVICE_PASSWORD);
case Command.TYPE_ENGINE_RESUME:
  return formatCommand(command,"String_Node_Str",Command.KEY_DEVICE_PASSWORD);
default :
Log.warning(new UnsupportedOperationException(command.getType()));
break;
}
return null;
}
Program: 156170
Project: 156170
Buggy source:
@Override protected Object decode(ChannelHandlerContext ctx,Channel channel,ChannelBuffer buf) throws Exception {
  if (buf.readableBytes() < 20) {
    return null;
  }
  if (buf.getUnsignedByte(buf.readerIndex()) == 0x80) {
    int length=buf.readableBytes();
    byte bytes[]=new byte[length];
    buf.getBytes(buf.readerIndex(),bytes);
    ChannelBuffer result=(ChannelBuffer)super.decode(ctx,channel,ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN,bytes));
    if (result != null) {
      buf.skipBytes(result.readableBytes());
    }
    return result;
  }
  return super.decode(ctx,channel,buf);
}

Fixed version (ground truth):
@Override protected Object decode(ChannelHandlerContext ctx,Channel channel,ChannelBuffer buf) throws Exception {
  if (buf.readableBytes() < 20) {
    return null;
  }
  if (buf.getUnsignedByte(buf.readerIndex()) == 0x80) {
    int length=buf.readableBytes();
    byte[] bytes=new byte[length];
    buf.getBytes(buf.readerIndex(),bytes);
    ChannelBuffer result=(ChannelBuffer)super.decode(ctx,channel,ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN,bytes));
    if (result != null) {
      buf.skipBytes(result.readableBytes());
    }
    return result;
  }
  return super.decode(ctx,channel,buf);
}
Program: 156171
Project: 156171
Buggy source:
private void async(final AsyncContext context,long userId){
  context.setTimeout(ASYNC_TIMEOUT);
  HttpServletRequest req=(HttpServletRequest)context.getRequest();
synchronized (asyncSessions) {
    if (Boolean.parseBoolean(req.getParameter("String_Node_Str")) || !asyncSessions.containsKey(userId)) {
      Collection<Long> devices=Context.getPermissionsManager().allowedDevices(userId);
      asyncSessions.put(userId,new AsyncSession(userId,devices));
    }
    asyncSessions.get(userId).request(context);
  }
}

Fixed version (ground truth):
private void async(final AsyncContext context,long userId){
  context.setTimeout(ASYNC_TIMEOUT);
  HttpServletRequest req=(HttpServletRequest)context.getRequest();
synchronized (ASYNC_SESSIONS) {
    if (Boolean.parseBoolean(req.getParameter("String_Node_Str")) || !ASYNC_SESSIONS.containsKey(userId)) {
      Collection<Long> devices=Context.getPermissionsManager().allowedDevices(userId);
      ASYNC_SESSIONS.put(userId,new AsyncSession(userId,devices));
    }
    ASYNC_SESSIONS.get(userId).request(context);
  }
}
Program: 156172
Project: 156172
Buggy source:
public static void sessionRefreshUser(long userId){
synchronized (asyncSessions) {
    asyncSessions.remove(userId);
  }
}

Fixed version (ground truth):
public static void sessionRefreshUser(long userId){
synchronized (ASYNC_SESSIONS) {
    ASYNC_SESSIONS.remove(userId);
  }
}
Program: 156173
Project: 156173
Buggy source:
public static void sessionRefreshDevice(long deviceId){
synchronized (asyncSessions) {
    Iterator<Entry<Long,AsyncSession>> iterator=asyncSessions.entrySet().iterator();
    while (iterator.hasNext()) {
      if (iterator.next().getValue().hasDevice(deviceId)) {
        iterator.remove();
      }
    }
  }
}

Fixed version (ground truth):
public static void sessionRefreshDevice(long deviceId){
synchronized (ASYNC_SESSIONS) {
    Iterator<Entry<Long,AsyncSession>> iterator=ASYNC_SESSIONS.entrySet().iterator();
    while (iterator.hasNext()) {
      if (iterator.next().getValue().hasDevice(deviceId)) {
        iterator.remove();
      }
    }
  }
}
Program: 156174
Project: 156174
Buggy source:
@Test public void testDecode() throws Exception {
  UlbotechProtocolDecoder decoder=new UlbotechProtocolDecoder(new UlbotechProtocol());
  verify(decoder.decode(null,null,ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString("String_Node_Str"))));
  verify(decoder.decode(null,null,ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString("String_Node_Str"))));
  verify(decoder.decode(null,null,ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString("String_Node_Str"))));
  verify(decoder.decode(null,null,ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString("String_Node_Str"))));
  verify(decoder.decode(null,null,ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString("String_Node_Str"))));
  assertNull(decoder.decode(null,null,ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString("String_Node_Str"))));
  assertNull(decoder.decode(null,null,ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString("String_Node_Str"))));
  verify(decoder.decode(null,null,ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString("String_Node_Str"))));
  verify(decoder.decode(null,null,ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString("String_Node_Str"))));
  verify(decoder.decode(null,null,ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString("String_Node_Str"))));
}

Fixed version (ground truth):
@Test public void testDecode() throws Exception {
  UlbotechProtocolDecoder decoder=new UlbotechProtocolDecoder(new UlbotechProtocol());
  verify(decoder.decode(null,null,ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString("String_Node_Str"))));
  verify(decoder.decode(null,null,ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString("String_Node_Str"))));
  verify(decoder.decode(null,null,ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString("String_Node_Str"))));
  verify(decoder.decode(null,null,ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString("String_Node_Str"))));
  verify(decoder.decode(null,null,ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString("String_Node_Str"))));
  verify(decoder.decode(null,null,ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString("String_Node_Str"))));
  assertNull(decoder.decode(null,null,ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString("String_Node_Str"))));
  assertNull(decoder.decode(null,null,ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString("String_Node_Str"))));
  verify(decoder.decode(null,null,ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString("String_Node_Str"))));
  verify(decoder.decode(null,null,ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString("String_Node_Str"))));
  verify(decoder.decode(null,null,ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString("String_Node_Str"))));
}
Program: 156175
Project: 156175
Buggy source:
public static AsyncHttpClient getAsyncHttpClient(){
  return asyncHttpClient;
}

Fixed version (ground truth):
public static AsyncHttpClient getAsyncHttpClient(){
  return ASYNC_HTTP_CLIENT;
}
Program: 156176
Project: 156176
Buggy source:
@Override protected Position handlePosition(Position position){
  return filter(position) ? null : position;
}

Fixed version (ground truth):
@Override protected Position handlePosition(Position position){
  if (filter(position)) {
    return null;
  }
  return position;
}
Program: 156177
Project: 156177
Buggy source:
private boolean filterZero(Position position){
  return filterZero && (position.getLatitude() == 0.0) && (position.getLongitude() == 0.0);
}

Fixed version (ground truth):
private boolean filterZero(Position position){
  return filterZero && position.getLatitude() == 0.0 && position.getLongitude() == 0.0;
}
Program: 156179
Project: 156179
Buggy source:
@Override protected Object decode(Channel channel,SocketAddress remoteAddress,Object msg) throws Exception {
  HttpRequest request=(HttpRequest)msg;
  ChannelBuffer buf=request.getContent();
  int length=buf.readableBytes();
  buf.skipBytes("String_Node_Str".length());
  int index=ChannelBufferTools.find(buf,buf.readerIndex(),length,"String_Node_Str");
  String uniqueId=buf.toString(buf.readerIndex(),index - buf.readerIndex(),Charset.defaultCharset());
  if (!identify(uniqueId,channel)) {
    return null;
  }
  buf.skipBytes(uniqueId.length());
  buf.skipBytes("String_Node_Str".length());
  short packetId=buf.readUnsignedByte();
  short offset=buf.readUnsignedByte();
  short packetCount=buf.readUnsignedByte();
  buf.readUnsignedByte();
  short parameters=buf.readUnsignedByte();
  buf.skipBytes(offset - 5);
  if (channel != null) {
    sendContinue(channel);
    sendResponse(channel,packetId,packetCount);
  }
  if (packetId == 0x31 || packetId == 0x32 || packetId == 0x36) {
    if (simple) {
      return parseFormatA1(buf);
    }
 else {
      return parseFormatA(buf);
    }
  }
  return null;
}

Fixed version (ground truth):
@Override protected Object decode(Channel channel,SocketAddress remoteAddress,Object msg) throws Exception {
  HttpRequest request=(HttpRequest)msg;
  ChannelBuffer buf=request.getContent();
  int length=buf.readableBytes();
  buf.skipBytes("String_Node_Str".length());
  int index=ChannelBufferTools.find(buf,buf.readerIndex(),length,"String_Node_Str");
  String uniqueId=buf.toString(buf.readerIndex(),index - buf.readerIndex(),Charset.defaultCharset());
  if (!identify(uniqueId,channel)) {
    return null;
  }
  buf.skipBytes(uniqueId.length());
  buf.skipBytes("String_Node_Str".length());
  short packetId=buf.readUnsignedByte();
  short offset=buf.readUnsignedByte();
  short packetCount=buf.readUnsignedByte();
  buf.readUnsignedByte();
  buf.readUnsignedByte();
  buf.skipBytes(offset - 5);
  if (channel != null) {
    sendContinue(channel);
    sendResponse(channel,packetId,packetCount);
  }
  if (packetId == 0x31 || packetId == 0x32 || packetId == 0x36) {
    if (simple) {
      return parseFormatA1(buf);
    }
 else {
      return parseFormatA(buf);
    }
  }
  return null;
}
Program: 156180
Project: 156180
Buggy source:
@Override protected Object decode(ChannelHandlerContext ctx,Channel channel,ChannelBuffer buf) throws Exception {
  if (buf.readableBytes() < 2) {
    return null;
  }
  int index=buf.indexOf(buf.readerIndex() + 1,buf.writerIndex(),(byte)0x04);
  if (index != -1) {
    ChannelBuffer result=ChannelBuffers.buffer(ByteOrder.LITTLE_ENDIAN,index + 1 - buf.readerIndex());
    while (buf.readerIndex() <= index) {
      int b=buf.readUnsignedByte();
      if (b == 0x10) {
        result.writeByte(buf.readUnsignedByte() - 0x20);
      }
 else {
        result.writeByte(b);
      }
    }
    String s=ChannelBuffers.hexDump(result);
    return result;
  }
  return null;
}

Fixed version (ground truth):
@Override protected Object decode(ChannelHandlerContext ctx,Channel channel,ChannelBuffer buf) throws Exception {
  if (buf.readableBytes() < 2) {
    return null;
  }
  int index=buf.indexOf(buf.readerIndex() + 1,buf.writerIndex(),(byte)0x04);
  if (index != -1) {
    ChannelBuffer result=ChannelBuffers.buffer(ByteOrder.LITTLE_ENDIAN,index + 1 - buf.readerIndex());
    while (buf.readerIndex() <= index) {
      int b=buf.readUnsignedByte();
      if (b == 0x10) {
        result.writeByte(buf.readUnsignedByte() - 0x20);
      }
 else {
        result.writeByte(b);
      }
    }
    return result;
  }
  return null;
}
Program: 156181
Project: 156181
Buggy source:
private Position parsePositionReport2(ChannelBuffer buf,int sequenceNumber,long timestamp){
  Position position=new Position();
  position.setProtocol(getProtocolName());
  position.set(Event.KEY_INDEX,sequenceNumber);
  position.setDeviceId(getDeviceId());
  position.setTime(convertTimestamp(timestamp));
  position.setLatitude(buf.readInt() * 0.0000001);
  position.setLongitude(buf.readInt() * 0.0000001);
  buf.readUnsignedByte();
  position.setSpeed(UnitsConverter.knotsFromKph(buf.readUnsignedByte()));
  short flags=buf.readUnsignedByte();
  position.setValid((flags & 0x80) == 0x80 && (flags & 0x40) == 0x40);
  int x=buf.readUnsignedByte();
  buf.readUnsignedInt();
  return position;
}

Fixed version (ground truth):
private Position parsePositionReport2(ChannelBuffer buf,int sequenceNumber,long timestamp){
  Position position=new Position();
  position.setProtocol(getProtocolName());
  position.set(Event.KEY_INDEX,sequenceNumber);
  position.setDeviceId(getDeviceId());
  position.setTime(convertTimestamp(timestamp));
  position.setLatitude(buf.readInt() * 0.0000001);
  position.setLongitude(buf.readInt() * 0.0000001);
  buf.readUnsignedByte();
  position.setSpeed(UnitsConverter.knotsFromKph(buf.readUnsignedByte()));
  short flags=buf.readUnsignedByte();
  position.setValid((flags & 0x80) == 0x80 && (flags & 0x40) == 0x40);
  position.set(Event.KEY_SATELLITES,buf.readUnsignedByte());
  buf.readUnsignedInt();
  return position;
}
Program: 156184
Project: 156184
Buggy source:
@Test public void testDecode() throws Exception {
  FlextrackProtocolDecoder decoder=new FlextrackProtocolDecoder(new FlextrackProtocol());
  assertNull(decoder.decode(null,null,"String_Node_Str"));
  assertNull(decoder.decode(null,null,"String_Node_Str"));
  verify(decoder.decode(null,null,"String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testDecode() throws Exception {
  FlextrackProtocolDecoder decoder=new FlextrackProtocolDecoder(new FlextrackProtocol());
  assertNull(decoder.decode(null,null,"String_Node_Str"));
  assertNull(decoder.decode(null,null,"String_Node_Str"));
  verify(decoder.decode(null,null,"String_Node_Str"));
  verify(decoder.decode(null,null,"String_Node_Str"));
}
Program: 156185
Project: 156185
Buggy source:
private String calculateStatus(Position position){
  if (position.getAttributes().containsKey(Event.KEY_ALARM) && (Boolean)position.getAttributes().get(Event.KEY_ALARM)) {
    return "String_Node_Str";
  }
 else   if (position.getSpeed() < 1.0) {
    return "String_Node_Str";
  }
 else {
    return "String_Node_Str";
  }
}

Fixed version (ground truth):
private String calculateStatus(Position position){
  if (position.getAttributes().containsKey(Event.KEY_ALARM)) {
    return "String_Node_Str";
  }
 else   if (position.getSpeed() < 1.0) {
    return "String_Node_Str";
  }
 else {
    return "String_Node_Str";
  }
}
Program: 156186
Project: 156186
Buggy source:
@Override protected Address parseAddress(JsonObject json){
  JsonObject result=json.getJsonObject("String_Node_Str").getJsonObject("String_Node_Str");
  JsonObject dummy;
  if (result != null) {
    Address address=new Address();
    if (result.getJsonObject("String_Node_Str") != null) {
      address.setHouse(result.getJsonObject("String_Node_Str").getString("String_Node_Str"));
    }
    if (result.getJsonObject("String_Node_Str") != null) {
      address.setStreet(result.getJsonObject("String_Node_Str").getString("String_Node_Str"));
    }
    if (result.getJsonObject("String_Node_Str") != null) {
      address.setSettlement(result.getJsonObject("String_Node_Str").getString("String_Node_Str"));
    }
    if (result.getJsonObject("String_Node_Str") != null) {
      address.setDistrict(result.getJsonObject("String_Node_Str").getString("String_Node_Str"));
    }
    if (result.getJsonObject("String_Node_Str") != null) {
      address.setState(result.getJsonObject("String_Node_Str").getString("String_Node_Str"));
    }
    if (result.getJsonObject("String_Node_Str") != null) {
      address.setCountry(result.getJsonObject("String_Node_Str").getString("String_Node_Str"));
    }
    if (result.getJsonObject("String_Node_Str") != null) {
      address.setPostcode(result.getJsonObject("String_Node_Str").getString("String_Node_Str"));
    }
    return address;
  }
  return null;
}

Fixed version (ground truth):
@Override protected Address parseAddress(JsonObject json){
  JsonObject result=json.getJsonObject("String_Node_Str").getJsonObject("String_Node_Str");
  if (result != null) {
    Address address=new Address();
    if (result.getJsonObject("String_Node_Str") != null) {
      address.setHouse(result.getJsonObject("String_Node_Str").getString("String_Node_Str"));
    }
    if (result.getJsonObject("String_Node_Str") != null) {
      address.setStreet(result.getJsonObject("String_Node_Str").getString("String_Node_Str"));
    }
    if (result.getJsonObject("String_Node_Str") != null) {
      address.setSettlement(result.getJsonObject("String_Node_Str").getString("String_Node_Str"));
    }
    if (result.getJsonObject("String_Node_Str") != null) {
      address.setDistrict(result.getJsonObject("String_Node_Str").getString("String_Node_Str"));
    }
    if (result.getJsonObject("String_Node_Str") != null) {
      address.setState(result.getJsonObject("String_Node_Str").getString("String_Node_Str"));
    }
    if (result.getJsonObject("String_Node_Str") != null) {
      address.setCountry(result.getJsonObject("String_Node_Str").getString("String_Node_Str"));
    }
    if (result.getJsonObject("String_Node_Str") != null) {
      address.setPostcode(result.getJsonObject("String_Node_Str").getString("String_Node_Str"));
    }
    return address;
  }
  return null;
}
Program: 156187
Project: 156187
Buggy source:
@Override protected Address parseAddress(JsonObject json){
  JsonArray result=json.getJsonArray("String_Node_Str");
  if (result != null) {
    JsonObject result1=result.getJsonObject(0);
    JsonArray location=result1.getJsonArray("String_Node_Str");
    if (location != null) {
      JsonObject location1=location.getJsonObject(0);
      Address address=new Address();
      if (location1.containsKey("String_Node_Str")) {
        address.setStreet(location1.getString("String_Node_Str"));
      }
      if (location1.containsKey("String_Node_Str")) {
        address.setSettlement(location1.getString("String_Node_Str"));
      }
      if (location1.containsKey("String_Node_Str")) {
        address.setDistrict(location1.getString("String_Node_Str"));
      }
      if (location1.containsKey("String_Node_Str")) {
        address.setState(location1.getString("String_Node_Str"));
      }
      if (location1.containsKey("String_Node_Str")) {
        address.setCountry(location1.getString("String_Node_Str").toUpperCase());
      }
      if (location1.containsKey("String_Node_Str")) {
        address.setPostcode(location1.getString("String_Node_Str"));
      }
      return address;
    }
  }
  return null;
}

Fixed version (ground truth):
@Override protected Address parseAddress(JsonObject json){
  JsonArray result=json.getJsonArray("String_Node_Str");
  if (result != null) {
    JsonArray locations=result.getJsonObject(0).getJsonArray("String_Node_Str");
    if (locations != null) {
      JsonObject location=locations.getJsonObject(0);
      Address address=new Address();
      if (location.containsKey("String_Node_Str")) {
        address.setStreet(location.getString("String_Node_Str"));
      }
      if (location.containsKey("String_Node_Str")) {
        address.setSettlement(location.getString("String_Node_Str"));
      }
      if (location.containsKey("String_Node_Str")) {
        address.setDistrict(location.getString("String_Node_Str"));
      }
      if (location.containsKey("String_Node_Str")) {
        address.setState(location.getString("String_Node_Str"));
      }
      if (location.containsKey("String_Node_Str")) {
        address.setCountry(location.getString("String_Node_Str").toUpperCase());
      }
      if (location.containsKey("String_Node_Str")) {
        address.setPostcode(location.getString("String_Node_Str"));
      }
      return address;
    }
  }
  return null;
}
Program: 156188
Project: 156188
Buggy source:
@Override protected Address parseAddress(JsonObject json){
  JsonArray result=json.getJsonArray("String_Node_Str");
  if (result != null) {
    JsonObject result1=result.getJsonObject(0);
    JsonObject location=result1.getJsonObject("String_Node_Str");
    if (location != null) {
      Address address=new Address();
      if (location.containsKey("String_Node_Str")) {
        address.setHouse(location.getString("String_Node_Str"));
      }
      if (location.containsKey("String_Node_Str")) {
        address.setStreet(location.getString("String_Node_Str"));
      }
      if (location.containsKey("String_Node_Str")) {
        address.setSettlement(location.getString("String_Node_Str"));
      }
      if (location.containsKey("String_Node_Str")) {
        address.setDistrict(location.getString("String_Node_Str"));
      }
      if (location.containsKey("String_Node_Str")) {
        address.setState(location.getString("String_Node_Str"));
      }
      if (location.containsKey("String_Node_Str")) {
        address.setCountry(location.getString("String_Node_Str").toUpperCase());
      }
      if (location.containsKey("String_Node_Str")) {
        address.setPostcode(location.getString("String_Node_Str"));
      }
      return address;
    }
  }
  return null;
}

Fixed version (ground truth):
@Override protected Address parseAddress(JsonObject json){
  JsonArray result=json.getJsonArray("String_Node_Str");
  if (result != null) {
    JsonObject location=result.getJsonObject(0).getJsonObject("String_Node_Str");
    if (location != null) {
      Address address=new Address();
      if (location.containsKey("String_Node_Str")) {
        address.setHouse(location.getString("String_Node_Str"));
      }
      if (location.containsKey("String_Node_Str")) {
        address.setStreet(location.getString("String_Node_Str"));
      }
      if (location.containsKey("String_Node_Str")) {
        address.setSettlement(location.getString("String_Node_Str"));
      }
      if (location.containsKey("String_Node_Str")) {
        address.setDistrict(location.getString("String_Node_Str"));
      }
      if (location.containsKey("String_Node_Str")) {
        address.setState(location.getString("String_Node_Str"));
      }
      if (location.containsKey("String_Node_Str")) {
        address.setCountry(location.getString("String_Node_Str").toUpperCase());
      }
      if (location.containsKey("String_Node_Str")) {
        address.setPostcode(location.getString("String_Node_Str"));
      }
      return address;
    }
  }
  return null;
}
Program: 156189
Project: 156189
Buggy source:
private void mockData(long userId){
  if (config.getBoolean("String_Node_Str")) {
    try {
      Device device=new Device();
      device.setName("String_Node_Str");
      device.setUniqueId("String_Node_Str");
      addDevice(device);
      linkDevice(userId,device.getId());
      Position position=new Position();
      position.setDeviceId(device.getId());
      position.setTime(JsonConverter.parseDate("String_Node_Str"));
      position.setLatitude(-36.8785803);
      position.setLongitude(174.7281713);
      addPosition(position);
      position.setTime(JsonConverter.parseDate("String_Node_Str"));
      position.setLatitude(-36.8870932);
      position.setLongitude(174.7473116);
      addPosition(position);
      position.setTime(JsonConverter.parseDate("String_Node_Str"));
      position.setLatitude(-36.8932371);
      position.setLongitude(174.7743053);
      addPosition(position);
      updateLatestPosition(position);
    }
 catch (    SQLException|ParseException error) {
      Log.warning(error);
    }
  }
}

Fixed version (ground truth):
private void mockData(long userId){
  if (config.getBoolean("String_Node_Str")) {
    try {
      Device device=new Device();
      device.setName("String_Node_Str");
      device.setUniqueId("String_Node_Str");
      addDevice(device);
      linkDevice(userId,device.getId());
      Position position=new Position();
      position.setDeviceId(device.getId());
      position.setTime(JsonConverter.parseDate("String_Node_Str"));
      position.setLatitude(-36.8785803);
      position.setLongitude(174.7281713);
      addPosition(position);
      position.setTime(JsonConverter.parseDate("String_Node_Str"));
      position.setLatitude(-36.8870932);
      position.setLongitude(174.7473116);
      addPosition(position);
      position.setTime(JsonConverter.parseDate("String_Node_Str"));
      position.setLatitude(-36.8932371);
      position.setLongitude(174.7743053);
      addPosition(position);
      updateLatestPosition(position);
    }
 catch (    SQLException error) {
      Log.warning(error);
    }
  }
}
Program: 156193
Project: 156193
Buggy source:
@Test public void testDecode() throws Exception {
  OsmAndProtocolDecoder decoder=new OsmAndProtocolDecoder(new OsmAndProtocol());
  verify(decoder.decode(null,null,new DefaultHttpRequest(HttpVersion.HTTP_1_1,HttpMethod.GET,"String_Node_Str")));
  verify(decoder.decode(null,null,new DefaultHttpRequest(HttpVersion.HTTP_1_1,HttpMethod.GET,"String_Node_Str")));
  verify(decoder.decode(null,null,new DefaultHttpRequest(HttpVersion.HTTP_1_1,HttpMethod.GET,"String_Node_Str")));
  verify(decoder.decode(null,null,new DefaultHttpRequest(HttpVersion.HTTP_1_1,HttpMethod.GET,"String_Node_Str")));
  verify(decoder.decode(null,null,new DefaultHttpRequest(HttpVersion.HTTP_1_1,HttpMethod.GET,"String_Node_Str")));
}

Fixed version (ground truth):
@Test public void testDecode() throws Exception {
  OsmAndProtocolDecoder decoder=new OsmAndProtocolDecoder(new OsmAndProtocol());
  verify(decoder.decode(null,null,new DefaultHttpRequest(HttpVersion.HTTP_1_1,HttpMethod.GET,"String_Node_Str")));
  verify(decoder.decode(null,null,new DefaultHttpRequest(HttpVersion.HTTP_1_1,HttpMethod.GET,"String_Node_Str")));
  verify(decoder.decode(null,null,new DefaultHttpRequest(HttpVersion.HTTP_1_1,HttpMethod.GET,"String_Node_Str")));
  verify(decoder.decode(null,null,new DefaultHttpRequest(HttpVersion.HTTP_1_1,HttpMethod.GET,"String_Node_Str")));
  verify(decoder.decode(null,null,new DefaultHttpRequest(HttpVersion.HTTP_1_1,HttpMethod.GET,"String_Node_Str")));
  verify(decoder.decode(null,null,new DefaultHttpRequest(HttpVersion.HTTP_1_1,HttpMethod.GET,"String_Node_Str")));
}
Program: 156194
Project: 156194
Buggy source:
@Override public void sendCommand(ActiveDevice activeDevice,Command command){
  if (!supportedCommands.contains(command.getType())) {
    throw new RuntimeException("String_Node_Str" + command + "String_Node_Str"+ getName());
  }
  activeDevice.write(command);
}

Fixed version (ground truth):
@Override public void sendCommand(ActiveDevice activeDevice,Command command){
  if (!supportedCommands.contains(command.getType())) {
    throw new RuntimeException("String_Node_Str" + command.getType() + "String_Node_Str"+ getName());
  }
  activeDevice.write(command);
}
Program: 156195
Project: 156195
Buggy source:
@Override protected Object encodeCommand(Command command){
  String content="String_Node_Str";
switch (command.getType()) {
case Command.TYPE_ENGINE_STOP:
    content="String_Node_Str";
  break;
case Command.TYPE_ENGINE_RESUME:
content="String_Node_Str";
break;
}
int serverFlagBit=0x00;
int commandLength=serverFlagBit + content.length();
int packetLength=0x80 + content.length() + 2+ 2;
ChannelBuffer response=ChannelBuffers.directBuffer(10);
response.writeBytes(new byte[]{0x78,0x78});
response.writeByte(packetLength);
response.writeByte(0x80);
response.writeByte(commandLength);
response.writeByte(serverFlagBit);
response.writeBytes(content.getBytes());
response.writeBytes(new byte[]{0x00,0x02});
response.writeShort(1);
int crc=Crc.crc16Ccitt(response.toByteBuffer(2,response.writerIndex()));
response.writeShort(crc);
response.writeBytes(new byte[]{0x0D,0x0A});
return response;
}

Fixed version (ground truth):
@Override protected Object encodeCommand(Command command){
  String content="String_Node_Str";
switch (command.getType()) {
case Command.TYPE_ENGINE_STOP:
    content="String_Node_Str";
  break;
case Command.TYPE_ENGINE_RESUME:
content="String_Node_Str";
break;
}
int serverFlagBit=0x00;
int commandLength=serverFlagBit + content.length();
int packetLength=0x80 + content.length() + 2+ 2;
ChannelBuffer response=ChannelBuffers.dynamicBuffer();
response.writeBytes(new byte[]{0x78,0x78});
response.writeByte(packetLength);
response.writeByte(0x80);
response.writeByte(commandLength);
response.writeByte(serverFlagBit);
response.writeBytes(content.getBytes());
response.writeBytes(new byte[]{0x00,0x02});
response.writeShort(1);
int crc=Crc.crc16Ccitt(response.toByteBuffer(2,response.writerIndex()));
response.writeShort(crc);
response.writeBytes(new byte[]{0x0D,0x0A});
return response;
}
Program: 156196
Project: 156196
Buggy source:
private void send(HttpServletRequest req,HttpServletResponse resp) throws Exception {
  Command command=JsonConverter.objectFromJson(req.getReader(),new Command());
  getActiveDevice(command.getDeviceId()).write(command);
  sendResponse(resp.getWriter(),true);
}

Fixed version (ground truth):
private void send(HttpServletRequest req,HttpServletResponse resp) throws Exception {
  Command command=JsonConverter.objectFromJson(req.getReader(),new Command());
  getActiveDevice(command.getDeviceId()).sendCommand(command);
  sendResponse(resp.getWriter(),true);
}
Program: 156197
Project: 156197
Buggy source:
@Override public void handleUpstream(ChannelHandlerContext ctx,ChannelEvent evt) throws Exception {
  if (!(evt instanceof MessageEvent)) {
    ctx.sendUpstream(evt);
    return;
  }
  MessageEvent e=(MessageEvent)evt;
  Object originalMessage=e.getMessage();
  Object decodedMessage=decode(e.getChannel(),e.getRemoteAddress(),originalMessage);
  if (originalMessage == decodedMessage) {
    ctx.sendUpstream(evt);
  }
 else   if (decodedMessage != null) {
    if (decodedMessage instanceof Collection) {
      for (      Object o : (Collection)e.getMessage()) {
        fireMessageReceived(ctx,o,e.getRemoteAddress());
      }
    }
 else {
      fireMessageReceived(ctx,decodedMessage,e.getRemoteAddress());
    }
  }
}

Fixed version (ground truth):
@Override public void handleUpstream(ChannelHandlerContext ctx,ChannelEvent evt) throws Exception {
  if (!(evt instanceof MessageEvent)) {
    ctx.sendUpstream(evt);
    return;
  }
  MessageEvent e=(MessageEvent)evt;
  Object originalMessage=e.getMessage();
  Object decodedMessage=decode(e.getChannel(),e.getRemoteAddress(),originalMessage);
  if (originalMessage == decodedMessage) {
    ctx.sendUpstream(evt);
  }
 else   if (decodedMessage != null) {
    if (decodedMessage instanceof Collection) {
      for (      Object o : (Collection)decodedMessage) {
        fireMessageReceived(ctx,o,e.getRemoteAddress());
      }
    }
 else {
      fireMessageReceived(ctx,decodedMessage,e.getRemoteAddress());
    }
  }
}
Program: 156199
Project: 156199
Buggy source:
private QueryBuilder(DataSource dataSource,String query,boolean returnGeneratedKeys) throws SQLException {
  indexMap=new HashMap<String,List<Integer>>();
  connection=dataSource.getConnection();
  this.query=query;
  if (query != null) {
    String parsedQuery=parse(query.trim(),indexMap);
    try {
      if (returnGeneratedKeys) {
        statement=connection.prepareStatement(parsedQuery,Statement.RETURN_GENERATED_KEYS);
      }
 else {
        statement=connection.prepareStatement(parsedQuery);
      }
    }
 catch (    SQLException error) {
      connection.close();
      throw error;
    }
  }
}

Fixed version (ground truth):
private QueryBuilder(DataSource dataSource,String query,boolean returnGeneratedKeys) throws SQLException {
  indexMap=new HashMap<String,List<Integer>>();
  connection=dataSource.getConnection();
  this.query=query;
  this.returnGeneratedKeys=returnGeneratedKeys;
  if (query != null) {
    String parsedQuery=parse(query.trim(),indexMap);
    try {
      if (returnGeneratedKeys) {
        statement=connection.prepareStatement(parsedQuery,Statement.RETURN_GENERATED_KEYS);
      }
 else {
        statement=connection.prepareStatement(parsedQuery);
      }
    }
 catch (    SQLException error) {
      connection.close();
      throw error;
    }
  }
}
Program: 156200
Project: 156200
Buggy source:
public long executeUpdate() throws SQLException {
  if (query != null) {
    try {
      statement.executeUpdate();
      ResultSet resultSet=statement.getGeneratedKeys();
      if (resultSet.next()) {
        return resultSet.getLong(1);
      }
    }
  finally {
      statement.close();
      connection.close();
    }
  }
  return 0;
}

Fixed version (ground truth):
public long executeUpdate() throws SQLException {
  if (query != null) {
    try {
      statement.executeUpdate();
      if (returnGeneratedKeys) {
        ResultSet resultSet=statement.getGeneratedKeys();
        if (resultSet.next()) {
          return resultSet.getLong(1);
        }
      }
    }
  finally {
      statement.close();
      connection.close();
    }
  }
  return 0;
}
Program: 156201
Project: 156201
Buggy source:
@Override protected final void service(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException {
  String command=req.getPathInfo();
  try {
    if (command == null || !handle(command,req,resp)) {
      resp.sendError(HttpServletResponse.SC_BAD_REQUEST);
    }
  }
 catch (  Exception error) {
    sendResponse(resp.getWriter(),error);
  }
}

Fixed version (ground truth):
@Override protected final void service(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException {
  String command=req.getPathInfo();
  if (command == null) {
    command="String_Node_Str";
  }
  try {
    if (!handle(command,req,resp)) {
      resp.sendError(HttpServletResponse.SC_BAD_REQUEST);
    }
  }
 catch (  Exception error) {
    sendResponse(resp.getWriter(),error);
  }
}
Program: 156204
Project: 156204
Buggy source:
public void addUser(User user) throws SQLException {
  user.setId(QueryBuilder.create(dataSource,getQuery("String_Node_Str")).setObject(user).executeUpdate());
  Context.getPermissionsManager().refresh();
}

Fixed version (ground truth):
public void addUser(User user) throws SQLException {
  user.setId(QueryBuilder.create(dataSource,getQuery("String_Node_Str"),true).setObject(user).executeUpdate());
  Context.getPermissionsManager().refresh();
}
Program: 156205
Project: 156205
Buggy source:
public void addPosition(Position position) throws SQLException {
  position.setId(QueryBuilder.create(dataSource,getQuery("String_Node_Str")).setObject(position).setDate("String_Node_Str",position.getFixTime()).setLong("String_Node_Str",position.getDeviceId()).setLong("String_Node_Str",0).setString("String_Node_Str",position.getOther()).executeUpdate());
}

Fixed version (ground truth):
public void addPosition(Position position) throws SQLException {
  position.setId(QueryBuilder.create(dataSource,getQuery("String_Node_Str"),true).setObject(position).setDate("String_Node_Str",position.getFixTime()).setLong("String_Node_Str",position.getDeviceId()).setLong("String_Node_Str",0).setString("String_Node_Str",position.getOther()).executeUpdate());
}
Program: 156206
Project: 156206
Buggy source:
public void addDevice(Device device) throws SQLException {
  device.setId(QueryBuilder.create(dataSource,getQuery("String_Node_Str")).setObject(device).executeUpdate());
}

Fixed version (ground truth):
public void addDevice(Device device) throws SQLException {
  device.setId(QueryBuilder.create(dataSource,getQuery("String_Node_Str"),true).setObject(device).executeUpdate());
}
Program: 156207
Project: 156207
Buggy source:
private QueryBuilder(DataSource dataSource,String query) throws SQLException {
  indexMap=new HashMap<String,List<Integer>>();
  connection=dataSource.getConnection();
  this.query=query;
  if (query != null) {
    String parsedQuery=parse(query,indexMap);
    try {
      statement=connection.prepareStatement(parsedQuery,Statement.RETURN_GENERATED_KEYS);
    }
 catch (    SQLException error) {
      connection.close();
      throw error;
    }
  }
}

Fixed version (ground truth):
private QueryBuilder(DataSource dataSource,String query,boolean returnGeneratedKeys) throws SQLException {
  indexMap=new HashMap<String,List<Integer>>();
  connection=dataSource.getConnection();
  this.query=query;
  if (query != null) {
    String parsedQuery=parse(query.trim(),indexMap);
    try {
      if (returnGeneratedKeys) {
        statement=connection.prepareStatement(parsedQuery,Statement.RETURN_GENERATED_KEYS);
      }
 else {
        statement=connection.prepareStatement(parsedQuery);
      }
    }
 catch (    SQLException error) {
      connection.close();
      throw error;
    }
  }
}
Program: 156208
Project: 156208
Buggy source:
public static QueryBuilder create(DataSource dataSource,String query) throws SQLException {
  return new QueryBuilder(dataSource,query);
}

Fixed version (ground truth):
public static QueryBuilder create(DataSource dataSource,String query,boolean returnGeneratedKeys) throws SQLException {
  return new QueryBuilder(dataSource,query,returnGeneratedKeys);
}
Program: 156209
Project: 156209
Buggy source:
private void update(HttpServletRequest req,HttpServletResponse resp) throws Exception {
  User user=JsonConverter.objectFromJson(req.getReader(),new User());
  Context.getPermissionsManager().checkUser(getUserId(req),user.getId());
  Context.getDataManager().updateUser(user);
  sendResponse(resp.getWriter(),true);
}

Fixed version (ground truth):
private void update(HttpServletRequest req,HttpServletResponse resp) throws Exception {
  User user=JsonConverter.objectFromJson(req.getReader(),new User());
  if (user.getAdmin()) {
    Context.getPermissionsManager().checkAdmin(getUserId(req));
  }
 else {
    Context.getPermissionsManager().checkUser(getUserId(req),user.getId());
  }
  Context.getDataManager().updateUser(user);
  sendResponse(resp.getWriter(),true);
}
Program: 156210
Project: 156210
Buggy source:
private void createDatabaseSchema() throws SQLException {
  Connection connection=dataSource.getConnection();
  ResultSet result=connection.getMetaData().getTables(connection.getCatalog(),null,null,null);
  boolean exist=false;
  while (result.next()) {
    if (result.getString("String_Node_Str").equalsIgnoreCase("String_Node_Str")) {
      exist=true;
      break;
    }
  }
  if (exist) {
    return;
  }
  QueryBuilder.create(dataSource,properties.getProperty("String_Node_Str")).executeUpdate();
  User admin=new User();
  admin.setName("String_Node_Str");
  admin.setEmail("String_Node_Str");
  admin.setPassword("String_Node_Str");
  admin.setAdmin(true);
  addUser(admin);
  Server server=new Server();
  server.setRegistration(true);
  QueryBuilder.create(dataSource,properties.getProperty("String_Node_Str")).setObject(server).executeUpdate();
  mockData(admin.getId());
}

Fixed version (ground truth):
private void createDatabaseSchema() throws SQLException {
  Connection connection=dataSource.getConnection();
  ResultSet result=connection.getMetaData().getTables(connection.getCatalog(),null,null,null);
  boolean exist=false;
  while (result.next()) {
    if (result.getString("String_Node_Str").equalsIgnoreCase("String_Node_Str")) {
      exist=true;
      break;
    }
  }
  if (exist) {
    return;
  }
  QueryBuilder.create(dataSource,properties.getProperty("String_Node_Str")).executeUpdate();
  User admin=new User();
  admin.setName("String_Node_Str");
  admin.setEmail("String_Node_Str");
  admin.setPassword("String_Node_Str");
  admin.setAdmin(true);
  QueryBuilder.create(dataSource,properties.getProperty("String_Node_Str")).setObject(admin).executeUpdate();
  Server server=new Server();
  server.setRegistration(true);
  QueryBuilder.create(dataSource,properties.getProperty("String_Node_Str")).setObject(server).executeUpdate();
  mockData(admin.getId());
}
Program: 156211
Project: 156211
Buggy source:
public void checkDevice(long userId,long deviceId) throws SecurityException {
  if (getNotNull(userId).contains(deviceId)) {
    throw new SecurityException("String_Node_Str");
  }
}

Fixed version (ground truth):
public void checkDevice(long userId,long deviceId) throws SecurityException {
  if (!getNotNull(userId).contains(deviceId)) {
    throw new SecurityException("String_Node_Str");
  }
}
Program: 156214
Project: 156214
Buggy source:
private void parseIdentification(Channel channel,ChannelBuffer buf){
  boolean result=false;
  int length=buf.readUnsignedShort();
  String imei=buf.toString(buf.readerIndex(),length,Charset.defaultCharset());
  result=identify(imei);
  if (channel != null) {
    ChannelBuffer response=ChannelBuffers.directBuffer(1);
    response.writeByte(result ? 1 : 0);
    channel.write(response);
  }
}

Fixed version (ground truth):
private void parseIdentification(Channel channel,ChannelBuffer buf){
  int length=buf.readUnsignedShort();
  String imei=buf.toString(buf.readerIndex(),length,Charset.defaultCharset());
  boolean result=identify(imei);
  if (channel != null) {
    ChannelBuffer response=ChannelBuffers.directBuffer(1);
    response.writeByte(result ? 1 : 0);
    channel.write(response);
  }
}
Program: 156218
Project: 156218
Buggy source:
public GlobalSatProtocolDecoder(ServerManager serverManager){
  super(serverManager);
  format0="String_Node_Str";
  format1="String_Node_Str";
  if (getServerManager() != null) {
    Properties p=getServerManager().getProperties();
    if (p.contains("String_Node_Str")) {
      format0=p.getProperty("String_Node_Str");
    }
    if (p.contains("String_Node_Str")) {
      format1=p.getProperty("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
public GlobalSatProtocolDecoder(ServerManager serverManager){
  super(serverManager);
  format0="String_Node_Str";
  format1="String_Node_Str";
  if (getServerManager() != null) {
    Properties p=getServerManager().getProperties();
    if (p.containsKey("String_Node_Str")) {
      format0=p.getProperty("String_Node_Str");
    }
    if (p.containsKey("String_Node_Str")) {
      format1=p.getProperty("String_Node_Str");
    }
  }
}
Program: 156221
Project: 156221
Buggy source:
@Override protected Object decode(ChannelHandlerContext ctx,Channel channel,Object msg) throws Exception {
  if (msg instanceof Position) {
    Position position=(Position)msg;
    if (geocoder != null) {
      position.setAddress(geocoder.getAddress(position.getLatitude(),position.getLongitude()));
    }
  }
  return msg;
}

Fixed version (ground truth):
@Override protected Object decode(ChannelHandlerContext ctx,Channel channel,Object msg) throws Exception {
  if (geocoder != null) {
    if (msg instanceof Position) {
      Position position=(Position)msg;
      position.setAddress(geocoder.getAddress(position.getLatitude(),position.getLongitude()));
    }
 else     if (msg instanceof List) {
      List<Position> positions=(List<Position>)msg;
      for (      Position position : positions) {
        position.setAddress(geocoder.getAddress(position.getLatitude(),position.getLongitude()));
      }
    }
  }
  return msg;
}
Program: 156222
Project: 156222
Buggy source:
@Override public Logger getParentLogger() throws SQLFeatureNotSupportedException {
  return driver.getParentLogger();
}

Fixed version (ground truth):
public Logger getParentLogger() throws SQLFeatureNotSupportedException {
  throw new SQLFeatureNotSupportedException();
}