Program: 3060
Project: 3060
Buggy source:
@SuppressWarnings("String_Node_Str") private Statsd(){
  e.submit(new Runnable(){
    @Override public void run(){
      DatagramSocket ds=null;
      boolean entered=BTraceRuntime.enter();
      try {
        ds=new DatagramSocket();
        DatagramPacket dp=new DatagramPacket(new byte[0],0);
        try {
          dp.setAddress(InetAddress.getByName(SharedSettings.GLOBAL.getStatsdHost()));
        }
 catch (        UnknownHostException e) {
          System.err.println("String_Node_Str" + SharedSettings.GLOBAL.getStatsdHost());
          dp.setAddress(InetAddress.getLoopbackAddress());
        }
catch (        SecurityException e) {
          dp.setAddress(InetAddress.getLoopbackAddress());
        }
        dp.setPort(SharedSettings.GLOBAL.getStatsdPort());
        while (true) {
          Collection<String> msgs=new LinkedList<>();
          msgs.add(q.take());
          q.drainTo(msgs);
          StringBuilder sb=new StringBuilder();
          for (          String m : msgs) {
            if (sb.length() + m.length() < 511) {
              sb.append(m).append('\n');
            }
 else {
              dp.setData(sb.toString().getBytes(CHARSET));
              ds.send(dp);
              sb.setLength(0);
            }
          }
          if (sb.length() > 0) {
            dp.setData(sb.toString().getBytes(CHARSET));
            ds.send(dp);
          }
        }
      }
 catch (      IOException|InterruptedException e) {
        e.printStackTrace();
      }
 finally {
        if (entered) {
          BTraceRuntime.leave();
        }
      }
    }
  }
);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private Statsd(){
  e.submit(new Runnable(){
    @Override public void run(){
      DatagramSocket ds=null;
      boolean entered=BTraceRuntime.enter();
      try {
        ds=new DatagramSocket();
        DatagramPacket dp=new DatagramPacket(new byte[0],0);
        try {
          dp.setAddress(InetAddress.getByName(SharedSettings.GLOBAL.getStatsdHost()));
        }
 catch (        UnknownHostException e) {
          System.err.println("String_Node_Str" + SharedSettings.GLOBAL.getStatsdHost());
          dp.setAddress(InetAddress.getLoopbackAddress());
        }
catch (        SecurityException e) {
          dp.setAddress(InetAddress.getLoopbackAddress());
        }
        dp.setPort(SharedSettings.GLOBAL.getStatsdPort());
        while (true) {
          Collection<String> msgs=new ArrayList<>();
          msgs.add(q.take());
          q.drainTo(msgs);
          StringBuilder sb=new StringBuilder();
          for (          String m : msgs) {
            if (sb.length() + m.length() < 511) {
              sb.append(m).append('\n');
            }
 else {
              dp.setData(sb.toString().getBytes(CHARSET));
              ds.send(dp);
              sb.setLength(0);
            }
          }
          if (sb.length() > 0) {
            dp.setData(sb.toString().getBytes(CHARSET));
            ds.send(dp);
          }
        }
      }
 catch (      IOException|InterruptedException e) {
        e.printStackTrace();
      }
 finally {
        if (entered) {
          BTraceRuntime.leave();
        }
      }
    }
  }
);
}