nus-yam/ex-repair huggingface dataset:
Program: 55292
Project: 55292
Buggy source:
@Override public void write(final byte[] b,final int off,final int len) throws IOException {
  while (this.totalLen + len > this.bufferSize) {
    resizeBuffer();
  }
  int written=0;
  while (written < len) {
    if (this.lenInPacket == RPCMessage.MAXIMUM_MSG_SIZE) {
      this.lenInPacket=0;
      this.totalLen+=RPCMessage.METADATA_SIZE;
    }
    final int amountOfDataToWrite=Math.min((len - written),(RPCMessage.MAXIMUM_MSG_SIZE - this.lenInPacket));
    System.arraycopy(b,off + written,this.buf,this.totalLen,amountOfDataToWrite);
    this.lenInPacket+=amountOfDataToWrite;
    this.totalLen+=amountOfDataToWrite;
    written+=amountOfDataToWrite;
  }
}

Fixed version (ground truth):
@Override public void write(final byte[] b,final int off,final int len) throws IOException {
  final int lengthIncludingMetaData=getLengthIncludingMetaData(len);
  while (this.totalLen + lengthIncludingMetaData > this.buf.length) {
    resizeBuffer();
  }
  int written=0;
  while (written < len) {
    if (this.lenInPacket == RPCMessage.MAXIMUM_MSG_SIZE) {
      this.lenInPacket=0;
      this.totalLen+=RPCMessage.METADATA_SIZE;
    }
    final int amountOfDataToWrite=Math.min((len - written),(RPCMessage.MAXIMUM_MSG_SIZE - this.lenInPacket));
    System.arraycopy(b,off + written,this.buf,this.totalLen,amountOfDataToWrite);
    this.lenInPacket+=amountOfDataToWrite;
    this.totalLen+=amountOfDataToWrite;
    written+=amountOfDataToWrite;
  }
}
Program: 55293
Project: 55293
Buggy source:
private void resizeBuffer(){
  final byte[] newBuf=new byte[this.buf.length * 2];
  System.arraycopy(this.buf,0,newBuf,0,this.totalLen);
  this.buf=newBuf;
  this.bufferSize=newBuf.length - RPCMessage.METADATA_SIZE;
}

Fixed version (ground truth):
private void resizeBuffer(){
  final byte[] newBuf=new byte[this.buf.length * 2];
  System.arraycopy(this.buf,0,newBuf,0,this.totalLen);
  this.buf=newBuf;
}
Program: 55294
Project: 55294
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override protected Kryo initialValue(){
  final Kryo kryo=new Kryo();
  if (kryoTypesToRegister != null) {
    kryo.setAutoReset(false);
    kryo.setRegistrationRequired(true);
    for (    final Class<?> kryoType : kryoTypesToRegister) {
      kryo.register(kryoType);
    }
  }
  return kryo;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override protected Kryo initialValue(){
  final Kryo kryo=new Kryo();
  if (kryoTypesToRegister != null) {
    kryo.setAutoReset(false);
    kryo.setRegistrationRequired(true);
    kryo.setReferences(false);
    for (    final Class<?> kryoType : kryoTypesToRegister) {
      kryo.register(kryoType);
    }
  }
  return kryo;
}
Program: 55295
Project: 55295
Buggy source:
/** 
 * Reads library data from the given stream.
 * @param in the stream to read the library data from
 * @throws IOException throws if an error occurs while reading from the stream
 */
private void readLibraryFromStreamInternal(final DataInput in) throws IOException {
  final String libraryFileName=StringRecord.readString(in);
  if (libraryFileName == null) {
    throw new IOException("String_Node_Str");
  }
  final long length=in.readLong();
  if (length > (long)Integer.MAX_VALUE) {
    throw new IOException("String_Node_Str" + libraryFileName + "String_Node_Str");
  }
  final byte[] buf=new byte[(int)length];
  in.readFully(buf);
  final Path storePath=new Path(this.libraryCachePath + "String_Node_Str" + libraryFileName);
synchronized (this.fs) {
    if (!fs.exists(storePath)) {
      final FSDataOutputStream fos=fs.create(storePath,false);
      fos.write(buf,0,buf.length);
      fos.close();
    }
  }
}

Fixed version (ground truth):
/** 
 * Reads library data from the given stream.
 * @param input the stream to read the library data from
 * @throws IOException throws if an error occurs while reading from the stream
 */
private void readLibraryFromStreamInternal(final Input input) throws IOException {
  final String libraryFileName=input.readString();
  if (libraryFileName == null) {
    throw new IOException("String_Node_Str");
  }
  final long length=input.readLong();
  if (length > (long)Integer.MAX_VALUE) {
    throw new IOException("String_Node_Str" + libraryFileName + "String_Node_Str");
  }
  final byte[] buf=new byte[(int)length];
  input.readBytes(buf);
  final Path storePath=new Path(this.libraryCachePath + "String_Node_Str" + libraryFileName);
synchronized (this.fs) {
    if (!fs.exists(storePath)) {
      final FSDataOutputStream fos=fs.create(storePath,false);
      fos.write(buf,0,buf.length);
      fos.close();
    }
  }
}
Program: 55296
Project: 55296
Buggy source:
/** 
 * Writes data from the library with the given file name to the specified stream.
 * @param libraryFileName the name of the library
 * @param out the stream to write the data to
 * @throws IOException thrown if an error occurs while writing the data
 */
private void writeLibraryToStreamInternal(final String libraryFileName,final DataOutput out) throws IOException {
  if (libraryFileName == null) {
    throw new IOException("String_Node_Str");
  }
  final Path storePath=new Path(this.libraryCachePath + "String_Node_Str" + libraryFileName);
synchronized (this.fs) {
    if (!fs.exists(storePath)) {
      throw new IOException(storePath + "String_Node_Str");
    }
    final FileStatus status=fs.getFileStatus(storePath);
    StringRecord.writeString(out,libraryFileName);
    out.writeLong(status.getLen());
    final FSDataInputStream inStream=fs.open(storePath);
    final byte[] buf=new byte[8192];
    int read=inStream.read(buf,0,buf.length);
    while (read > 0) {
      out.write(buf,0,read);
      read=inStream.read(buf,0,buf.length);
    }
    inStream.close();
  }
}

Fixed version (ground truth):
/** 
 * Writes data from the library with the given file name to the specified stream.
 * @param libraryFileName the name of the library
 * @param output the stream to write the data to
 * @throws IOException thrown if an error occurs while writing the data
 */
private void writeLibraryToStreamInternal(final String libraryFileName,final Output output) throws IOException {
  if (libraryFileName == null) {
    throw new IOException("String_Node_Str");
  }
  final Path storePath=new Path(this.libraryCachePath + "String_Node_Str" + libraryFileName);
synchronized (this.fs) {
    if (!fs.exists(storePath)) {
      throw new IOException(storePath + "String_Node_Str");
    }
    final FileStatus status=fs.getFileStatus(storePath);
    output.writeString(libraryFileName);
    output.writeLong(status.getLen());
    final FSDataInputStream inStream=fs.open(storePath);
    final byte[] buf=new byte[8192];
    int read=inStream.read(buf,0,buf.length);
    while (read > 0) {
      output.writeBytes(buf,0,read);
      read=inStream.read(buf,0,buf.length);
    }
    inStream.close();
  }
}
Program: 55297
Project: 55297
Buggy source:
/** 
 * Writes data from the library with the given file name to the specified stream.
 * @param libraryFileName the name of the library
 * @param out the stream to write the data to
 * @throws IOException thrown if an error occurs while writing the data
 */
public static void writeLibraryToStream(final String libraryFileName,final DataOutput out) throws IOException {
  final LibraryCacheManager lib=get();
  lib.writeLibraryToStreamInternal(libraryFileName,out);
}

Fixed version (ground truth):
/** 
 * Writes data from the library with the given file name to the specified stream.
 * @param libraryFileName the name of the library
 * @param output the stream to write the data to
 * @throws IOException thrown if an error occurs while writing the data
 */
public static void writeLibraryToStream(final String libraryFileName,final Output output) throws IOException {
  final LibraryCacheManager lib=get();
  lib.writeLibraryToStreamInternal(libraryFileName,output);
}
Program: 55298
Project: 55298
Buggy source:
/** 
 * Reads library data from the given stream.
 * @param in the stream to read the library data from
 * @throws IOException throws if an error occurs while reading from the stream
 */
public static void readLibraryFromStream(final DataInput in) throws IOException {
  final LibraryCacheManager lib=get();
  lib.readLibraryFromStreamInternal(in);
}

Fixed version (ground truth):
/** 
 * Reads library data from the given stream.
 * @param in the stream to read the library data from
 * @throws IOException throws if an error occurs while reading from the stream
 */
public static void readLibraryFromStream(final Input input) throws IOException {
  final LibraryCacheManager lib=get();
  lib.readLibraryFromStreamInternal(input);
}
Program: 55299
Project: 55299
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void read(final DataInput in) throws IOException {
  LibraryCacheManager.readLibraryFromStream(in);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void read(final Kryo kryo,final Input input){
  try {
    LibraryCacheManager.readLibraryFromStream(input);
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}
Program: 55300
Project: 55300
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void write(final DataOutput out) throws IOException {
  if (this.libraryFileName == null) {
    throw new IOException("String_Node_Str");
  }
  LibraryCacheManager.writeLibraryToStream(this.libraryFileName,out);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void write(final Kryo kryo,final Output output){
  if (this.libraryFileName == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  try {
    LibraryCacheManager.writeLibraryToStream(this.libraryFileName,output);
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}
Program: 55301
Project: 55301
Buggy source:
/** 
 * Returns a list of types frequently used by the RPC protocols of this package and its parent packages.
 * @return a list of types frequently used by the RPC protocols of this package
 */
public static List<Class<?>> getRPCTypesToRegister(){
  final ArrayList<Class<?>> types=new ArrayList<Class<?>>();
  types.add(AbstractJobResult.class);
  types.add(AbstractJobResult.ReturnCode.class);
  types.add(ChannelID.class);
  types.add(ChannelType.class);
  types.add(CompressionLevel.class);
  types.add(ExecutionState.class);
  types.add(GateID.class);
  types.add(HashMap.class);
  types.add(IntegerRecord.class);
  types.add(JobCancelResult.class);
  types.add(JobEvent.class);
  types.add(JobGraph.class);
  types.add(JobID.class);
  types.add(JobProgressResult.class);
  types.add(JobStatus.class);
  types.add(JobSubmissionResult.class);
  types.add(JobVertexID.class);
  types.add(LibraryCacheProfileRequest.class);
  types.add(LibraryCacheProfileResponse.class);
  types.add(Path.class);
  types.add(SerializableArrayList.class);
  types.add(SerializableHashMap.class);
  types.add(SerializableHashSet.class);
  types.add(Set.class);
  types.add(VertexEvent.class);
  return types;
}

Fixed version (ground truth):
/** 
 * Returns a list of types frequently used by the RPC protocols of this package and its parent packages.
 * @return a list of types frequently used by the RPC protocols of this package
 */
public static List<Class<?>> getRPCTypesToRegister(){
  final ArrayList<Class<?>> types=new ArrayList<Class<?>>();
  types.add(AbstractJobResult.class);
  types.add(AbstractJobResult.ReturnCode.class);
  types.add(ChannelID.class);
  types.add(ChannelType.class);
  types.add(CompressionLevel.class);
  types.add(ExecutionState.class);
  types.add(GateID.class);
  types.add(HashMap.class);
  types.add(IntegerRecord.class);
  types.add(JobCancelResult.class);
  types.add(JobEvent.class);
  types.add(JobGraph.class);
  types.add(JobID.class);
  types.add(JobProgressResult.class);
  types.add(JobStatus.class);
  types.add(JobSubmissionResult.class);
  types.add(JobVertexID.class);
  types.add(LibraryCacheProfileRequest.class);
  types.add(LibraryCacheProfileResponse.class);
  types.add(LibraryCacheUpdate.class);
  types.add(Path.class);
  types.add(SerializableArrayList.class);
  types.add(SerializableHashMap.class);
  types.add(SerializableHashSet.class);
  types.add(Set.class);
  types.add(VertexEvent.class);
  return types;
}
Program: 55304
Project: 55304
Buggy source:
/** 
 * Tries to locate a class with given name and to instantiate a instance manager from it.
 * @param instanceManagerClassName the name of the class to instantiate the instance manager object from
 * @return the {@link InstanceManager} object instantiated from the class with the provided name
 */
@SuppressWarnings("String_Node_Str") static InstanceManager loadInstanceManager(final String instanceManagerClassName){
  Class<? extends InstanceManager> instanceManagerClass;
  try {
    instanceManagerClass=(Class<? extends InstanceManager>)Class.forName(instanceManagerClassName);
  }
 catch (  ClassNotFoundException e) {
    LOG.error("String_Node_Str" + instanceManagerClassName + "String_Node_Str"+ StringUtils.stringifyException(e));
    return null;
  }
  InstanceManager instanceManager;
  try {
    instanceManager=instanceManagerClass.newInstance();
  }
 catch (  InstantiationException e) {
    LOG.error("String_Node_Str" + StringUtils.stringifyException(e));
    return null;
  }
catch (  IllegalAccessException e) {
    LOG.error("String_Node_Str" + StringUtils.stringifyException(e));
    return null;
  }
  return instanceManager;
}

Fixed version (ground truth):
/** 
 * Tries to locate a class with given name and to instantiate a instance manager from it.
 * @param instanceManagerClassName the name of the class to instantiate the instance manager object from
 * @return the {@link InstanceManager} object instantiated from the class with the provided name
 */
@SuppressWarnings("String_Node_Str") static InstanceManager loadInstanceManager(final String instanceManagerClassName,final RPCService rpcService){
  Class<? extends InstanceManager> instanceManagerClass;
  try {
    instanceManagerClass=(Class<? extends InstanceManager>)Class.forName(instanceManagerClassName);
  }
 catch (  ClassNotFoundException e) {
    LOG.error("String_Node_Str" + instanceManagerClassName + "String_Node_Str"+ StringUtils.stringifyException(e));
    return null;
  }
  Constructor<? extends InstanceManager> constructor;
  try {
    constructor=instanceManagerClass.getConstructor(RPCService.class);
  }
 catch (  Exception e) {
    LOG.error(StringUtils.stringifyException(e));
    return null;
  }
  InstanceManager instanceManager;
  try {
    instanceManager=constructor.newInstance(rpcService);
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str" + StringUtils.stringifyException(e));
    return null;
  }
  return instanceManager;
}
Program: 55305
Project: 55305
Buggy source:
/** 
 * Returns a list of types frequently used by the RPC protocols of this package and its parent packages.
 * @return a list of types frequently used by the RPC protocols of this package
 */
public static List<Class<?>> getRPCTypesToRegister(){
  final List<Class<?>> types=ManagementTypeUtils.getRPCTypesToRegister();
  types.add(AbstractTaskResult.ReturnCode.class);
  types.add(ChannelDeploymentDescriptor.class);
  types.add(CheckpointState.class);
  types.add(ConnectionInfoLookupResponse.class);
  types.add(ConnectionInfoLookupResponse.ReturnCode.class);
  types.add(ExecutionVertexID.class);
  types.add(FileInputSplit.class);
  types.add(GateDeploymentDescriptor.class);
  types.add(Inet4Address.class);
  types.add(InputSplitWrapper.class);
  types.add(InstanceConnectionInfo.class);
  types.add(LocalInstance.class);
  types.add(RemoteReceiver.class);
  types.add(TaskCancelResult.class);
  types.add(TaskCheckpointState.class);
  types.add(TaskDeploymentDescriptor.class);
  types.add(TaskExecutionState.class);
  types.add(TaskSubmissionResult.class);
  return types;
}

Fixed version (ground truth):
/** 
 * Returns a list of types frequently used by the RPC protocols of this package and its parent packages.
 * @return a list of types frequently used by the RPC protocols of this package
 */
public static List<Class<?>> getRPCTypesToRegister(){
  final List<Class<?>> types=ManagementTypeUtils.getRPCTypesToRegister();
  types.add(AbstractTaskResult.ReturnCode.class);
  types.add(ChannelDeploymentDescriptor.class);
  types.add(CheckpointState.class);
  types.add(ConnectionInfoLookupResponse.class);
  types.add(ConnectionInfoLookupResponse.ReturnCode.class);
  types.add(ExecutionVertexID.class);
  types.add(FileInputSplit.class);
  types.add(GateDeploymentDescriptor.class);
  types.add(Inet4Address.class);
  types.add(InetSocketAddress.class);
  types.add(InputSplitWrapper.class);
  types.add(InstanceConnectionInfo.class);
  types.add(LocalInstance.class);
  types.add(RemoteReceiver.class);
  types.add(TaskCancelResult.class);
  types.add(TaskCheckpointState.class);
  types.add(TaskDeploymentDescriptor.class);
  types.add(TaskExecutionState.class);
  types.add(TaskSubmissionResult.class);
  return types;
}
Program: 55306
Project: 55306
Buggy source:
@Test public void testLargeSortAcrossMultipleWindows() throws Exception {
  try {
    final int NUM_RECORDS=1000000;
    final TestData.Generator generator=new TestData.Generator(SEED,KEY_MAX,VALUE_LENGTH,KeyMode.RANDOM,ValueMode.CONSTANT,VAL);
    final MutableObjectIterator<PactRecord> source=new TestData.GeneratorIterator(generator,NUM_RECORDS);
    LOG.debug("String_Node_Str");
    Sorter<PactRecord> sorter=new AsynchronousPartialSorter<PactRecord>(this.memoryManager,source,this.parentTask,this.serializer,this.comparator,32 * 1024 * 1024);
    runPartialSorter(sorter,NUM_RECORDS,28);
  }
 catch (  Exception t) {
    t.printStackTrace();
    Assert.fail("String_Node_Str" + t.getMessage());
  }
}

Fixed version (ground truth):
@Test public void testLargeSortAcrossMultipleWindows() throws Exception {
  try {
    final int NUM_RECORDS=1000000;
    final TestData.Generator generator=new TestData.Generator(SEED,KEY_MAX,VALUE_LENGTH,KeyMode.RANDOM,ValueMode.CONSTANT,VAL);
    final MutableObjectIterator<PactRecord> source=new TestData.GeneratorIterator(generator,NUM_RECORDS);
    LOG.debug("String_Node_Str");
    Sorter<PactRecord> sorter=new AsynchronousPartialSorter<PactRecord>(this.memoryManager,source,this.parentTask,this.serializer,this.comparator,10 * 1024 * 1024);
    runPartialSorter(sorter,NUM_RECORDS,25);
  }
 catch (  Exception t) {
    t.printStackTrace();
    Assert.fail("String_Node_Str" + t.getMessage());
  }
}
Program: 55307
Project: 55307
Buggy source:
@Test public void testLargeSortAcrossTwoWindows() throws Exception {
  try {
    final int NUM_RECORDS=100000;
    final TestData.Generator generator=new TestData.Generator(SEED,KEY_MAX,VALUE_LENGTH,KeyMode.RANDOM,ValueMode.CONSTANT,VAL);
    final MutableObjectIterator<PactRecord> source=new TestData.GeneratorIterator(generator,NUM_RECORDS);
    LOG.debug("String_Node_Str");
    Sorter<PactRecord> sorter=new AsynchronousPartialSorter<PactRecord>(this.memoryManager,source,this.parentTask,this.serializer,this.comparator,32 * 1024 * 1024);
    runPartialSorter(sorter,NUM_RECORDS,2);
  }
 catch (  Exception t) {
    t.printStackTrace();
    Assert.fail("String_Node_Str" + t.getMessage());
  }
}

Fixed version (ground truth):
@Test public void testLargeSortAcrossTwoWindows() throws Exception {
  try {
    final int NUM_RECORDS=100000;
    final TestData.Generator generator=new TestData.Generator(SEED,KEY_MAX,VALUE_LENGTH,KeyMode.RANDOM,ValueMode.CONSTANT,VAL);
    final MutableObjectIterator<PactRecord> source=new TestData.GeneratorIterator(generator,NUM_RECORDS);
    LOG.debug("String_Node_Str");
    Sorter<PactRecord> sorter=new AsynchronousPartialSorter<PactRecord>(this.memoryManager,source,this.parentTask,this.serializer,this.comparator,10 * 1024 * 1024);
    runPartialSorter(sorter,NUM_RECORDS,2);
  }
 catch (  Exception t) {
    t.printStackTrace();
    Assert.fail("String_Node_Str" + t.getMessage());
  }
}
Program: 55310
Project: 55310
Buggy source:
DatagramPacket[] createPackets(final InetSocketAddress remoteAddress,final int requestID){
  if (this.totalLen == 0) {
    return new DatagramPacket[0];
  }
  final int maximumPacketSize=RPCMessage.MAXIMUM_MSG_SIZE + RPCMessage.METADATA_SIZE;
  final short numberOfPackets=(short)(this.totalLen / maximumPacketSize + 1);
  final DatagramPacket[] packets=new DatagramPacket[numberOfPackets];
  for (short i=0; i < numberOfPackets; ++i) {
    final boolean lastPacket=(i == (numberOfPackets - 1));
    int offset;
    if (lastPacket) {
      offset=(numberOfPackets - 1) * maximumPacketSize + this.lenInPacket;
    }
 else {
      offset=(i + 1) * maximumPacketSize - RPCMessage.METADATA_SIZE;
    }
    shortToByteArray(i,this.buf,offset);
    shortToByteArray(numberOfPackets,this.buf,offset + 2);
    DatagramPacket packet;
    if (lastPacket) {
      packet=new DatagramPacket(this.buf,i * maximumPacketSize,this.lenInPacket + RPCMessage.METADATA_SIZE);
    }
 else {
      packet=new DatagramPacket(this.buf,i * maximumPacketSize,maximumPacketSize);
    }
    packet.setSocketAddress(remoteAddress);
    packets[i]=packet;
  }
  return packets;
}

Fixed version (ground truth):
DatagramPacket[] createPackets(final InetSocketAddress remoteAddress){
  if (this.totalLen == 0) {
    return new DatagramPacket[0];
  }
  final int maximumPacketSize=RPCMessage.MAXIMUM_MSG_SIZE + RPCMessage.METADATA_SIZE;
  final short numberOfPackets=(short)(this.totalLen / maximumPacketSize + 1);
  short fragmentationID=0;
  if (numberOfPackets > 1) {
    fragmentationID=(short)((double)Short.MIN_VALUE + (Math.random() * 2.0 * (double)Short.MAX_VALUE));
  }
  final DatagramPacket[] packets=new DatagramPacket[numberOfPackets];
  for (short i=0; i < numberOfPackets; ++i) {
    final boolean lastPacket=(i == (numberOfPackets - 1));
    int offset;
    if (lastPacket) {
      offset=(numberOfPackets - 1) * maximumPacketSize + this.lenInPacket;
    }
 else {
      offset=(i + 1) * maximumPacketSize - RPCMessage.METADATA_SIZE;
    }
    shortToByteArray(i,this.buf,offset);
    shortToByteArray(numberOfPackets,this.buf,offset + 2);
    shortToByteArray(fragmentationID,this.buf,offset + 4);
    DatagramPacket packet;
    if (lastPacket) {
      packet=new DatagramPacket(this.buf,i * maximumPacketSize,this.lenInPacket + RPCMessage.METADATA_SIZE);
    }
 else {
      packet=new DatagramPacket(this.buf,i * maximumPacketSize,maximumPacketSize);
    }
    packet.setSocketAddress(remoteAddress);
    packets[i]=packet;
  }
  return packets;
}
Program: 55311
Project: 55311
Buggy source:
private MultiPacketInputStreamKey(final SocketAddress socketAddress,final int requestID){
  this.socketAddress=socketAddress;
  this.requestID=requestID;
}

Fixed version (ground truth):
private MultiPacketInputStreamKey(final SocketAddress socketAddress,final short fragmentationID){
  this.socketAddress=socketAddress;
  this.fragmentationID=fragmentationID;
}
Program: 55312
Project: 55312
Buggy source:
@Override public Object invoke(final Object proxy,final Method method,final Object[] args) throws Throwable {
  final int requestID=Integer.MIN_VALUE + (int)(Math.random() * (double)Integer.MAX_VALUE * 2.0);
  final RPCRequest rpcRequest=new RPCRequest(requestID,this.interfaceName,method,args);
  return sendRPCRequest(this.remoteSocketAddress,rpcRequest);
}

Fixed version (ground truth):
@Override public Object invoke(final Object proxy,final Method method,final Object[] args) throws Throwable {
  final int requestID=(int)((double)Integer.MIN_VALUE + (Math.random() * (double)Integer.MAX_VALUE * 2.0));
  final RPCRequest rpcRequest=new RPCRequest(requestID,this.interfaceName,method,args);
  return sendRPCRequest(this.remoteSocketAddress,rpcRequest);
}
Program: 55313
Project: 55313
Buggy source:
void removeIncompleteInputStream(final SocketAddress socketAddress,final int requestID){
  this.incompleteInputStreams.remove(new MultiPacketInputStreamKey(socketAddress,requestID));
}

Fixed version (ground truth):
void removeIncompleteInputStream(final SocketAddress socketAddress,final short fragmentationID){
  this.incompleteInputStreams.remove(new MultiPacketInputStreamKey(socketAddress,fragmentationID));
}
Program: 55314
Project: 55314
Buggy source:
@Override public int hashCode(){
  return this.socketAddress.hashCode() + this.requestID;
}

Fixed version (ground truth):
@Override public int hashCode(){
  return this.socketAddress.hashCode() + this.fragmentationID;
}
Program: 55315
Project: 55315
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public boolean equals(final Object obj){
  if (!(obj instanceof MultiPacketInputStreamKey)) {
    return false;
  }
  final MultiPacketInputStreamKey mpisk=(MultiPacketInputStreamKey)obj;
  if (this.requestID != mpisk.requestID) {
    return false;
  }
  if (!this.socketAddress.equals(mpisk.socketAddress)) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public boolean equals(final Object obj){
  if (!(obj instanceof MultiPacketInputStreamKey)) {
    return false;
  }
  final MultiPacketInputStreamKey mpisk=(MultiPacketInputStreamKey)obj;
  if (this.fragmentationID != mpisk.fragmentationID) {
    return false;
  }
  if (!this.socketAddress.equals(mpisk.socketAddress)) {
    return false;
  }
  return true;
}
Program: 55316
Project: 55316
Buggy source:
MultiPacketInputStream getIncompleteInputStream(final SocketAddress socketAddress,final int requestID,final short numberOfPackets){
  final MultiPacketInputStreamKey key=new MultiPacketInputStreamKey(socketAddress,requestID);
  MultiPacketInputStream mpis=this.incompleteInputStreams.get(key);
  if (mpis == null) {
    mpis=new MultiPacketInputStream(numberOfPackets);
    MultiPacketInputStream oldVal=this.incompleteInputStreams.putIfAbsent(key,mpis);
    if (oldVal != null) {
      mpis=oldVal;
    }
  }
  return mpis;
}

Fixed version (ground truth):
MultiPacketInputStream getIncompleteInputStream(final SocketAddress socketAddress,final short fragmentationID,final short numberOfPackets){
  final MultiPacketInputStreamKey key=new MultiPacketInputStreamKey(socketAddress,fragmentationID);
  MultiPacketInputStream mpis=this.incompleteInputStreams.get(key);
  if (mpis == null) {
    mpis=new MultiPacketInputStream(numberOfPackets);
    MultiPacketInputStream oldVal=this.incompleteInputStreams.putIfAbsent(key,mpis);
    if (oldVal != null) {
      mpis=oldVal;
    }
  }
  return mpis;
}
Program: 55318
Project: 55318
Buggy source:
@Override public void run(){
  final Kryo kryo=RPCService.createKryoObject();
  final byte[] buf=new byte[SEND_BUFFER];
  final MultiPacketOutputStream mbos=new MultiPacketOutputStream(buf);
  while (!this.shutdownRequested) {
    SendingRequest sendingRequest=null;
    try {
      sendingRequest=this.msgQueue.take();
    }
 catch (    InterruptedException ie) {
      if (this.shutdownRequested) {
        return;
      }
 else {
        continue;
      }
    }
    mbos.reset();
    final Output output=new Output(mbos);
    kryo.writeObject(output,new RPCEnvelope(sendingRequest.rpcMessage));
    output.close();
    mbos.close();
    final DatagramPacket[] packets=mbos.createPackets(sendingRequest.remoteSocketAddress,sendingRequest.rpcMessage.getRequestID());
    try {
      for (int i=0; i < packets.length; ++i) {
        this.socket.send(packets[i]);
      }
    }
 catch (    IOException ioe) {
      Log.error("String_Node_Str",ioe);
      return;
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  final byte[] buf=new byte[SEND_BUFFER];
  final MultiPacketOutputStream mbos=new MultiPacketOutputStream(buf);
  while (!this.shutdownRequested) {
    SendingRequest sendingRequest=null;
    try {
      sendingRequest=this.msgQueue.take();
    }
 catch (    InterruptedException ie) {
      if (this.shutdownRequested) {
        return;
      }
 else {
        continue;
      }
    }
    mbos.reset();
    final Output output=new Output(mbos);
    final Kryo kryo=RPCService.createKryoObject();
    kryo.writeObject(output,new RPCEnvelope(sendingRequest.rpcMessage));
    output.close();
    mbos.close();
    final DatagramPacket[] packets=mbos.createPackets(sendingRequest.remoteSocketAddress);
    try {
      for (int i=0; i < packets.length; ++i) {
        this.socket.send(packets[i]);
      }
    }
 catch (    IOException ioe) {
      Log.error("String_Node_Str",ioe);
      return;
    }
  }
}
Program: 55320
Project: 55320
Buggy source:
public void testSinglePacketSerialization(){
  final byte[] sourceBuf=new byte[512];
  for (int i=0; i < sourceBuf.length; ++i) {
    sourceBuf[i]=(byte)(i % 23);
  }
  final byte[] targetBuf=new byte[8192];
  final MultiPacketOutputStream mpos=new MultiPacketOutputStream(targetBuf);
  try {
    mpos.write(sourceBuf);
  }
 catch (  IOException ioe) {
    fail(StringUtils.stringifyException(ioe));
  }
  final DatagramPacket[] packets=mpos.createPackets(TEST_REMOTE_ADDRESS,0);
  assertNotNull(packets);
  assertEquals(1,packets.length);
  final int offset=packets[0].getOffset();
  final int length=packets[0].getLength();
  assertEquals(0,offset);
  assertEquals(sourceBuf.length + RPCMessage.METADATA_SIZE,length);
  final byte[] packetBuf=packets[0].getData();
  for (int i=offset; i < (offset + length - RPCMessage.METADATA_SIZE); ++i) {
    assertEquals((byte)(i % 23),packetBuf[i]);
  }
  assertEquals(0,packetBuf[offset + length - RPCMessage.METADATA_SIZE]);
  assertEquals(0,packetBuf[offset + length - RPCMessage.METADATA_SIZE + 1]);
  assertEquals(1,packetBuf[offset + length - RPCMessage.METADATA_SIZE + 2]);
  assertEquals(0,packetBuf[offset + length - RPCMessage.METADATA_SIZE + 3]);
}

Fixed version (ground truth):
@Test public void testSinglePacketSerialization(){
  final byte[] sourceBuf=new byte[512];
  for (int i=0; i < sourceBuf.length; ++i) {
    sourceBuf[i]=(byte)(i % 23);
  }
  final byte[] targetBuf=new byte[8192];
  final MultiPacketOutputStream mpos=new MultiPacketOutputStream(targetBuf);
  try {
    mpos.write(sourceBuf);
  }
 catch (  IOException ioe) {
    fail(StringUtils.stringifyException(ioe));
  }
  final DatagramPacket[] packets=mpos.createPackets(TEST_REMOTE_ADDRESS);
  assertNotNull(packets);
  assertEquals(1,packets.length);
  final int offset=packets[0].getOffset();
  final int length=packets[0].getLength();
  assertEquals(0,offset);
  assertEquals(sourceBuf.length + RPCMessage.METADATA_SIZE,length);
  final byte[] packetBuf=packets[0].getData();
  for (int i=offset; i < (offset + length - RPCMessage.METADATA_SIZE); ++i) {
    assertEquals((byte)(i % 23),packetBuf[i]);
  }
  assertEquals(0,packetBuf[offset + length - RPCMessage.METADATA_SIZE]);
  assertEquals(0,packetBuf[offset + length - RPCMessage.METADATA_SIZE + 1]);
  assertEquals(1,packetBuf[offset + length - RPCMessage.METADATA_SIZE + 2]);
  assertEquals(0,packetBuf[offset + length - RPCMessage.METADATA_SIZE + 3]);
}
Program: 55321
Project: 55321
Buggy source:
@Override public int testMethod(final boolean par1,final int par2,final List<String> par3){
  assertEquals(true,par1);
  assertEquals(this.counter.getAndIncrement(),par2);
  assertEquals(NUMBER_OF_TEST_STRINGS,par3.size());
  for (int i=0; i < NUMBER_OF_TEST_STRINGS; ++i) {
    assertEquals(constructTestString(i),par3.get(i));
  }
  return par2;
}

Fixed version (ground truth):
@Override public int testMethod(final boolean par1,final int par2,final List<String> par3){
  if (par1) {
    assertEquals(this.counter.getAndIncrement(),par2);
  }
  assertEquals(NUMBER_OF_TEST_STRINGS,par3.size());
  for (int i=0; i < NUMBER_OF_TEST_STRINGS; ++i) {
    assertEquals(constructTestString(i),par3.get(i));
  }
  return par2;
}
Program: 55324
Project: 55324
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void run(){
  final RPCProtocol callbackHandler=callbackHandlers.get(rpcRequest.getInterfaceName());
  if (callbackHandler == null) {
    Log.error("String_Node_Str" + rpcRequest.getInterfaceName());
    return;
  }
  Method method=null;
  try {
    method=callbackHandler.getClass().getMethod(rpcRequest.getMethodName(),rpcRequest.getParameterTypes());
  }
 catch (  Exception e) {
    e.printStackTrace();
    Log.error("String_Node_Str",e);
    return;
  }
  RPCResponse rpcResponse=null;
  try {
    final Object retVal=method.invoke(callbackHandler,rpcRequest.getArgs());
    rpcResponse=new RPCReturnValue(rpcRequest.getMessageID(),retVal);
  }
 catch (  InvocationTargetException ite) {
    rpcResponse=new RPCThrowable(rpcRequest.getMessageID(),ite.getTargetException());
  }
catch (  Exception e) {
    e.printStackTrace();
    Log.error("String_Node_Str",e);
    return;
  }
  final DatagramPacket[] packets=messageToPackets(remoteSocketAddress,rpcResponse);
  cachedResponses.put(messageID,new CachedResponse(System.currentTimeMillis(),packets));
  try {
    sendPackets(packets);
  }
 catch (  IOException e) {
    Log.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void run(){
  final Kryo kryo=threadLocalKryo.get();
  kryo.reset();
  final RPCEnvelope envelope=kryo.readObject(input,RPCEnvelope.class);
  final RPCMessage msg=envelope.getRPCMessage();
  if (msg instanceof RPCRequest) {
    processIncomingRPCRequest(remoteSocketAddress,(RPCRequest)msg);
  }
 else   if (msg instanceof RPCResponse) {
    processIncomingRPCResponse(remoteSocketAddress,(RPCResponse)msg);
  }
 else {
    processIncomingRPCCleanup(remoteSocketAddress,(RPCCleanup)msg);
  }
}
Program: 55326
Project: 55326
Buggy source:
/** 
 * Default constructor for serialization/deserialization.
 */
public ChannelDeploymentDescriptor(){
  this.outputChannelID=new ChannelID();
  this.inputChannelID=new ChannelID();
}

Fixed version (ground truth):
/** 
 * Default constructor required by kryo.
 */
@SuppressWarnings("String_Node_Str") private ChannelDeploymentDescriptor(){
  this.outputChannelID=null;
  this.inputChannelID=null;
}
Program: 55327
Project: 55327
Buggy source:
/** 
 * Default constructor for serialization/deserialization.
 */
public GateDeploymentDescriptor(){
  this.gateID=null;
  this.channelType=null;
  this.compressionLevel=null;
  this.channels=null;
}

Fixed version (ground truth):
/** 
 * Default constructor required by kryo.
 */
@SuppressWarnings("String_Node_Str") private GateDeploymentDescriptor(){
  this.gateID=null;
  this.channelType=null;
  this.compressionLevel=null;
  this.channels=null;
}
Program: 55329
Project: 55329
Buggy source:
@Override public int read(final byte[] b,final int off,final int len){
  if (this.read == this.len) {
    return -1;
  }
  final int r=Math.min(len,this.len - this.read);
  System.arraycopy(this.buf,this.read,b,off,r);
  this.read+=r;
  return r;
}

Fixed version (ground truth):
@Override public int read(final byte[] b,final int off,final int len){
  if (!moreDataAvailable()) {
    System.out.println("String_Node_Str");
    return -1;
  }
  final int r=Math.min(len,this.currentLength - this.read);
  System.arraycopy(this.currentBuffer,this.read,b,off,r);
  this.read+=r;
  return r;
}
Program: 55330
Project: 55330
Buggy source:
@Override public int available(){
  return (this.len - this.read);
}

Fixed version (ground truth):
@Override public int available(){
  System.out.println("String_Node_Str");
  if (!isComplete()) {
    return 0;
  }
  int available=this.currentLength - this.read;
  for (int i=this.nextPacketToRead; i < this.packets.length; ++i) {
    available+=this.packets[i].getLength() - RPCMessage.METADATA_SIZE;
  }
  return available;
}
Program: 55331
Project: 55331
Buggy source:
@Override public long skip(long n){
  final int dataLeftInBuffer=this.len - this.read;
  if (n > dataLeftInBuffer) {
    this.read=this.len;
    return dataLeftInBuffer;
  }
  this.read+=(int)n;
  return n;
}

Fixed version (ground truth):
@Override public long skip(long n){
  if (!moreDataAvailable()) {
    return 0L;
  }
  final int dataLeftInBuffer=this.currentLength - this.read;
  if (n > dataLeftInBuffer) {
    this.read=this.currentLength;
    return dataLeftInBuffer;
  }
  this.read+=(int)n;
  return n;
}
Program: 55332
Project: 55332
Buggy source:
@Override public void write(final byte[] b,final int off,final int len) throws IOException {
  if (this.totalLen + len > this.bufferSize) {
    throw new IOException("String_Node_Str");
  }
  int written=0;
  while (written < len) {
    if (this.lenInPacket == RPCMessage.MAXIMUM_MSG_SIZE) {
      this.lenInPacket=0;
      this.totalLen+=RPCMessage.METADATA_SIZE;
    }
    final int amountOfDataToWrite=Math.min((len - written),(RPCMessage.MAXIMUM_MSG_SIZE - this.lenInPacket));
    System.arraycopy(b,off,this.buf,this.totalLen,amountOfDataToWrite);
    this.lenInPacket+=amountOfDataToWrite;
    this.totalLen+=amountOfDataToWrite;
    written+=amountOfDataToWrite;
  }
}

Fixed version (ground truth):
@Override public void write(final byte[] b,final int off,final int len) throws IOException {
  if (this.totalLen + len > this.bufferSize) {
    throw new IOException("String_Node_Str");
  }
  int written=0;
  while (written < len) {
    if (this.lenInPacket == RPCMessage.MAXIMUM_MSG_SIZE) {
      this.lenInPacket=0;
      this.totalLen+=RPCMessage.METADATA_SIZE;
    }
    final int amountOfDataToWrite=Math.min((len - written),(RPCMessage.MAXIMUM_MSG_SIZE - this.lenInPacket));
    System.arraycopy(b,off + written,this.buf,this.totalLen,amountOfDataToWrite);
    this.lenInPacket+=amountOfDataToWrite;
    this.totalLen+=amountOfDataToWrite;
    written+=amountOfDataToWrite;
  }
}
Program: 55334
Project: 55334
Buggy source:
@Override public void run(){
  final Kryo kryo=RPCService.createKryoObject();
  final byte[] buf=new byte[SEND_BUFFER];
  final MultiPacketOutputStream mbos=new MultiPacketOutputStream(buf);
  while (!this.shutdownRequested) {
    SendingRequest sendingRequest=null;
    try {
      sendingRequest=this.msgQueue.take();
    }
 catch (    InterruptedException ie) {
      if (this.shutdownRequested) {
        return;
      }
 else {
        continue;
      }
    }
    mbos.reset();
    final Output output=new Output(mbos);
    kryo.writeObject(output,new RPCEnvelope(sendingRequest.rpcMessage));
    output.close();
    mbos.close();
    try {
      mbos.sendPackets(this.socket,sendingRequest.remoteSocketAddress,sendingRequest.rpcMessage.getRequestID());
    }
 catch (    IOException ioe) {
      Log.error("String_Node_Str",ioe);
      return;
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  final Kryo kryo=RPCService.createKryoObject();
  final byte[] buf=new byte[SEND_BUFFER];
  final MultiPacketOutputStream mbos=new MultiPacketOutputStream(buf);
  while (!this.shutdownRequested) {
    SendingRequest sendingRequest=null;
    try {
      sendingRequest=this.msgQueue.take();
    }
 catch (    InterruptedException ie) {
      if (this.shutdownRequested) {
        return;
      }
 else {
        continue;
      }
    }
    mbos.reset();
    final Output output=new Output(mbos);
    kryo.writeObject(output,new RPCEnvelope(sendingRequest.rpcMessage));
    output.close();
    mbos.close();
    final DatagramPacket[] packets=mbos.createPackets(sendingRequest.remoteSocketAddress,sendingRequest.rpcMessage.getRequestID());
    try {
      for (int i=0; i < packets.length; ++i) {
        this.socket.send(packets[i]);
      }
    }
 catch (    IOException ioe) {
      Log.error("String_Node_Str",ioe);
      return;
    }
  }
}
Program: 55335
Project: 55335
Buggy source:
/** 
 * Construct a Path from a scheme, an authority and a path string.
 * @param scheme the scheme string
 * @param authority the authority string
 * @param path the path string
 */
public Path(String scheme,String authority,String path){
  checkPathArg(path);
  initialize(scheme,authority,path);
}

Fixed version (ground truth):
/** 
 * Construct a Path from a scheme, an authority and a path string.
 * @param scheme the scheme string
 * @param authority the authority string
 * @param path the path string
 */
public Path(final String scheme,final String authority,final String path){
  checkPathArg(path);
  initialize(scheme,authority,path);
}
Program: 55336
Project: 55336
Buggy source:
public int compareTo(Object o){
  Path that=(Path)o;
  return this.uri.compareTo(that.uri);
}

Fixed version (ground truth):
public int compareTo(final Object o){
  final Path that=(Path)o;
  return this.uri.compareTo(that.uri);
}
Program: 55337
Project: 55337
Buggy source:
/** 
 * Adds a suffix to the final name in the path.
 * @param the suffix to be added
 * @return the new path including the suffix
 */
public Path suffix(String suffix){
  return new Path(getParent(),getName() + suffix);
}

Fixed version (ground truth):
/** 
 * Adds a suffix to the final name in the path.
 * @param the suffix to be added
 * @return the new path including the suffix
 */
public Path suffix(final String suffix){
  return new Path(getParent(),getName() + suffix);
}
Program: 55338
Project: 55338
Buggy source:
/** 
 * Checks if the provided path string contains a windows drive letter.
 * @param path the path to check
 * @param slashed <code>true</code> to indicate the first character of the string is a slash, <code>false</code> otherwise
 * @return <code>true</code> if the path string contains a windows drive letter, <code>false</code> otherwise
 */
private boolean hasWindowsDrive(String path,boolean slashed){
  if (!WINDOWS) {
    return false;
  }
  final int start=slashed ? 1 : 0;
  return path.length() >= start + 2 && (slashed ? path.charAt(0) == '/' : true) && path.charAt(start + 1) == ':' && ((path.charAt(start) >= 'A' && path.charAt(start) <= 'Z') || (path.charAt(start) >= 'a' && path.charAt(start) <= 'z'));
}

Fixed version (ground truth):
/** 
 * Checks if the provided path string contains a windows drive letter.
 * @param path the path to check
 * @param slashed <code>true</code> to indicate the first character of the string is a slash, <code>false</code> otherwise
 * @return <code>true</code> if the path string contains a windows drive letter, <code>false</code> otherwise
 */
private boolean hasWindowsDrive(final String path,final boolean slashed){
  if (!WINDOWS) {
    return false;
  }
  final int start=slashed ? 1 : 0;
  return path.length() >= start + 2 && (slashed ? path.charAt(0) == '/' : true) && path.charAt(start + 1) == ':' && ((path.charAt(start) >= 'A' && path.charAt(start) <= 'Z') || (path.charAt(start) >= 'a' && path.charAt(start) <= 'z'));
}
Program: 55339
Project: 55339
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public boolean equals(Object o){
  if (!(o instanceof Path)) {
    return false;
  }
  Path that=(Path)o;
  return this.uri.equals(that.uri);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public boolean equals(final Object o){
  if (!(o instanceof Path)) {
    return false;
  }
  final Path that=(Path)o;
  return this.uri.equals(that.uri);
}
Program: 55340
Project: 55340
Buggy source:
/** 
 * Returns a qualified path object.
 * @param fs the FileSystem that should be used to obtain the current working directory
 * @return the qualified path object
 */
public Path makeQualified(FileSystem fs){
  Path path=this;
  if (!isAbsolute()) {
    path=new Path(fs.getWorkingDirectory(),this);
  }
  final URI pathUri=path.toUri();
  final URI fsUri=fs.getUri();
  String scheme=pathUri.getScheme();
  String authority=pathUri.getAuthority();
  if (scheme != null && (authority != null || fsUri.getAuthority() == null))   return path;
  if (scheme == null) {
    scheme=fsUri.getScheme();
  }
  if (authority == null) {
    authority=fsUri.getAuthority();
    if (authority == null) {
      authority="String_Node_Str";
    }
  }
  return new Path(scheme + "String_Node_Str" + "String_Node_Str"+ authority+ pathUri.getPath());
}

Fixed version (ground truth):
/** 
 * Returns a qualified path object.
 * @param fs the FileSystem that should be used to obtain the current working directory
 * @return the qualified path object
 */
public Path makeQualified(final FileSystem fs){
  Path path=this;
  if (!isAbsolute()) {
    path=new Path(fs.getWorkingDirectory(),this);
  }
  final URI pathUri=path.toUri();
  final URI fsUri=fs.getUri();
  String scheme=pathUri.getScheme();
  String authority=pathUri.getAuthority();
  if (scheme != null && (authority != null || fsUri.getAuthority() == null))   return path;
  if (scheme == null) {
    scheme=fsUri.getScheme();
  }
  if (authority == null) {
    authority=fsUri.getAuthority();
    if (authority == null) {
      authority="String_Node_Str";
    }
  }
  return new Path(scheme + "String_Node_Str" + "String_Node_Str"+ authority+ pathUri.getPath());
}
Program: 55341
Project: 55341
Buggy source:
/** 
 * Initializes a path object given the scheme, authority and path string.
 * @param scheme the scheme string.
 * @param authority the authority string.
 * @param path the path string.
 */
private void initialize(String scheme,String authority,String path){
  try {
    this.uri=new URI(scheme,authority,normalizePath(path),null,null).normalize();
  }
 catch (  URISyntaxException e) {
    throw new IllegalArgumentException(e);
  }
}

Fixed version (ground truth):
/** 
 * Initializes a path object given the scheme, authority and path string.
 * @param scheme the scheme string.
 * @param authority the authority string.
 * @param path the path string.
 */
private void initialize(final String scheme,final String authority,final String path){
  try {
    this.uri=new URI(scheme,authority,normalizePath(path),null,null).normalize();
  }
 catch (  URISyntaxException e) {
    throw new IllegalArgumentException(e);
  }
}
Program: 55342
Project: 55342
Buggy source:
/** 
 * Checks if the provided path string is either null or has zero length and throws a   {@link IllegalArgumentException} if any of the two conditions apply.
 * @param path the path string to be checked
 */
private void checkPathArg(String path){
  if (path == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (path.length() == 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Checks if the provided path string is either null or has zero length and throws a   {@link IllegalArgumentException} if any of the two conditions apply.
 * @param path the path string to be checked
 */
private void checkPathArg(final String path){
  if (path == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (path.length() == 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
}