nus-yam/ex-repair huggingface dataset:
Program: 117073
Project: 117073
Buggy source:
/** 
 * Convenience method for reading a binary file and base64-encoding it. <p>As of v 2.3, if there is a error, the method will throw an java.io.IOException. <b>This is new to v2.3!</b> In earlier versions, it just returned false, but in retrospect that's a pretty poor way to handle it.</p>
 * @param filename Filename for reading binary data
 * @return base64-encoded string
 * @throws java.io.IOException if there is an error
 * @since 2.1
 */
public static String encodeFromFile(String filename) throws java.io.IOException {
  String encodedData=null;
  Base64.InputStream bis=null;
  try {
    java.io.File file=new java.io.File(filename);
    byte[] buffer=new byte[Math.max((int)(file.length() * 1.4),40)];
    int length=0;
    int numBytes=0;
    bis=new Base64.InputStream(new java.io.BufferedInputStream(new java.io.FileInputStream(file)),Base64.ENCODE);
    while ((numBytes=bis.read(buffer,length,4096)) >= 0) {
      length+=numBytes;
    }
    encodedData=new String(buffer,0,length,Base64.PREFERRED_ENCODING);
  }
 catch (  java.io.IOException e) {
    throw e;
  }
 finally {
    try {
      bis.close();
    }
 catch (    Exception e) {
    }
  }
  return encodedData;
}

Fixed version (ground truth):
/** 
 * Convenience method for reading a binary file and base64-encoding it. <p>As of v 2.3, if there is a error, the method will throw an java.io.IOException. <b>This is new to v2.3!</b> In earlier versions, it just returned false, but in retrospect that's a pretty poor way to handle it.</p>
 * @param filename Filename for reading binary data
 * @return base64-encoded string
 * @throws java.io.IOException if there is an error
 * @since 2.1
 */
public static String encodeFromFile(String filename) throws java.io.IOException {
  String encodedData=null;
  Base64.InputStream bis=null;
  try {
    java.io.File file=new java.io.File(filename);
    byte[] buffer=new byte[Math.max((int)(file.length() * 1.4),40)];
    int length=0;
    int numBytes;
    bis=new Base64.InputStream(new java.io.BufferedInputStream(new java.io.FileInputStream(file)),Base64.ENCODE);
    while ((numBytes=bis.read(buffer,length,4096)) >= 0) {
      length+=numBytes;
    }
    encodedData=new String(buffer,0,length,Base64.PREFERRED_ENCODING);
  }
  finally {
    try {
      if (bis != null) {
        bis.close();
      }
    }
 catch (    Exception ignored) {
    }
  }
  return encodedData;
}
Program: 117075
Project: 117075
Buggy source:
/** 
 * Reads <tt>infile</tt> and decodes it to <tt>outfile</tt>.
 * @param infile Input file
 * @param outfile Output file
 * @throws java.io.IOException if there is an error
 * @since 2.2
 */
public static void decodeFileToFile(String infile,String outfile) throws java.io.IOException {
  byte[] decoded=Base64.decodeFromFile(infile);
  java.io.OutputStream out=null;
  try {
    out=new java.io.BufferedOutputStream(new java.io.FileOutputStream(outfile));
    out.write(decoded);
  }
 catch (  java.io.IOException e) {
    throw e;
  }
 finally {
    try {
      out.close();
    }
 catch (    Exception ex) {
    }
  }
}

Fixed version (ground truth):
/** 
 * Reads <tt>infile</tt> and decodes it to <tt>outfile</tt>.
 * @param infile Input file
 * @param outfile Output file
 * @throws java.io.IOException if there is an error
 * @since 2.2
 */
public static void decodeFileToFile(String infile,String outfile) throws java.io.IOException {
  byte[] decoded=Base64.decodeFromFile(infile);
  java.io.OutputStream out=null;
  try {
    out=new java.io.BufferedOutputStream(new java.io.FileOutputStream(outfile));
    out.write(decoded);
  }
  finally {
    try {
      if (out != null) {
        out.close();
      }
    }
 catch (    Exception ignored) {
    }
  }
}
Program: 117076
Project: 117076
Buggy source:
/** 
 * Returns one of the _SOMETHING_DECODABET byte arrays depending on the options specified. It's possible, though silly, to specify ORDERED and URL_SAFE in which case one of them will be picked, though there is no guarantee as to which one will be picked.
 */
private final static byte[] getDecodabet(int options){
  if ((options & URL_SAFE) == URL_SAFE) {
    return _URL_SAFE_DECODABET;
  }
 else   if ((options & ORDERED) == ORDERED) {
    return _ORDERED_DECODABET;
  }
 else {
    return _STANDARD_DECODABET;
  }
}

Fixed version (ground truth):
/** 
 * Returns one of the _SOMETHING_DECODABET byte arrays depending on the options specified. It's possible, though silly, to specify ORDERED and URL_SAFE in which case one of them will be picked, though there is no guarantee as to which one will be picked.
 */
private static byte[] getDecodabet(int options){
  if ((options & URL_SAFE) == URL_SAFE) {
    return _URL_SAFE_DECODABET;
  }
 else   if ((options & ORDERED) == ORDERED) {
    return _ORDERED_DECODABET;
  }
 else {
    return _STANDARD_DECODABET;
  }
}
Program: 117077
Project: 117077
Buggy source:
/** 
 * Convenience method for reading a base64-encoded file and decoding it. <p>As of v 2.3, if there is a error, the method will throw an java.io.IOException. <b>This is new to v2.3!</b> In earlier versions, it just returned false, but in retrospect that's a pretty poor way to handle it.</p>
 * @param filename Filename for reading encoded data
 * @return decoded byte array
 * @throws java.io.IOException if there is an error
 * @since 2.1
 */
public static byte[] decodeFromFile(String filename) throws java.io.IOException {
  byte[] decodedData=null;
  Base64.InputStream bis=null;
  try {
    java.io.File file=new java.io.File(filename);
    byte[] buffer=null;
    int length=0;
    int numBytes=0;
    if (file.length() > Integer.MAX_VALUE) {
      throw new java.io.IOException("String_Node_Str" + file.length() + "String_Node_Str");
    }
    buffer=new byte[(int)file.length()];
    bis=new Base64.InputStream(new java.io.BufferedInputStream(new java.io.FileInputStream(file)),Base64.DECODE);
    while ((numBytes=bis.read(buffer,length,4096)) >= 0) {
      length+=numBytes;
    }
    decodedData=new byte[length];
    System.arraycopy(buffer,0,decodedData,0,length);
  }
 catch (  java.io.IOException e) {
    throw e;
  }
 finally {
    try {
      bis.close();
    }
 catch (    Exception e) {
    }
  }
  return decodedData;
}

Fixed version (ground truth):
/** 
 * Convenience method for reading a base64-encoded file and decoding it. <p>As of v 2.3, if there is a error, the method will throw an java.io.IOException. <b>This is new to v2.3!</b> In earlier versions, it just returned false, but in retrospect that's a pretty poor way to handle it.</p>
 * @param filename Filename for reading encoded data
 * @return decoded byte array
 * @throws java.io.IOException if there is an error
 * @since 2.1
 */
public static byte[] decodeFromFile(String filename) throws java.io.IOException {
  byte[] decodedData=null;
  Base64.InputStream bis=null;
  try {
    java.io.File file=new java.io.File(filename);
    byte[] buffer;
    int length=0;
    int numBytes;
    if (file.length() > Integer.MAX_VALUE) {
      throw new java.io.IOException("String_Node_Str" + file.length() + "String_Node_Str");
    }
    buffer=new byte[(int)file.length()];
    bis=new Base64.InputStream(new java.io.BufferedInputStream(new java.io.FileInputStream(file)),Base64.DECODE);
    while ((numBytes=bis.read(buffer,length,4096)) >= 0) {
      length+=numBytes;
    }
    decodedData=new byte[length];
    System.arraycopy(buffer,0,decodedData,0,length);
  }
  finally {
    try {
      if (bis != null) {
        bis.close();
      }
    }
 catch (    Exception ignored) {
    }
  }
  return decodedData;
}
Program: 117078
Project: 117078
Buggy source:
/** 
 * Attempts to decode Base64 data and deserialize a Java Object within. Returns <tt>null</tt> if there was an error.
 * @param encodedObject The Base64 data to decode
 * @return The decoded and deserialized object
 * @throws NullPointerException if encodedObject is null
 * @throws java.io.IOException if there is a general error
 * @throws ClassNotFoundException if the decoded object is of a class that cannot be found by the JVM
 * @since 1.5
 */
public static Object decodeToObject(String encodedObject) throws java.io.IOException, java.lang.ClassNotFoundException {
  byte[] objBytes=decode(encodedObject);
  java.io.ByteArrayInputStream bais=null;
  java.io.ObjectInputStream ois=null;
  Object obj=null;
  try {
    bais=new java.io.ByteArrayInputStream(objBytes);
    ois=new java.io.ObjectInputStream(bais);
    obj=ois.readObject();
  }
 catch (  java.io.IOException e) {
    throw e;
  }
catch (  java.lang.ClassNotFoundException e) {
    throw e;
  }
 finally {
    try {
      bais.close();
    }
 catch (    Exception e) {
    }
    try {
      ois.close();
    }
 catch (    Exception e) {
    }
  }
  return obj;
}

Fixed version (ground truth):
/** 
 * Attempts to decode Base64 data and deserialize a Java Object within. Returns <tt>null</tt> if there was an error.
 * @param encodedObject The Base64 data to decode
 * @return The decoded and deserialized object
 * @throws NullPointerException if encodedObject is null
 * @throws java.io.IOException if there is a general error
 * @throws ClassNotFoundException if the decoded object is of a class that cannot be found by the JVM
 * @since 1.5
 */
public static Object decodeToObject(String encodedObject) throws java.io.IOException, java.lang.ClassNotFoundException {
  byte[] objBytes=decode(encodedObject);
  java.io.ByteArrayInputStream bais=null;
  java.io.ObjectInputStream ois=null;
  Object obj=null;
  try {
    bais=new java.io.ByteArrayInputStream(objBytes);
    ois=new java.io.ObjectInputStream(bais);
    obj=ois.readObject();
  }
  finally {
    try {
      if (bais != null) {
        bais.close();
      }
    }
 catch (    Exception ignored) {
    }
    try {
      if (ois != null) {
        ois.close();
      }
    }
 catch (    Exception ignored) {
    }
  }
  return obj;
}
Program: 117081
Project: 117081
Buggy source:
/** 
 * Convenience method for decoding data to a file. <p>As of v 2.3, if there is a error, the method will throw an java.io.IOException. <b>This is new to v2.3!</b> In earlier versions, it just returned false, but in retrospect that's a pretty poor way to handle it.</p>
 * @param dataToDecode Base64-encoded data as a string
 * @param filename Filename for saving decoded data
 * @throws java.io.IOException if there is an error
 * @since 2.1
 */
public static void decodeToFile(String dataToDecode,String filename) throws java.io.IOException {
  Base64.OutputStream bos=null;
  try {
    bos=new Base64.OutputStream(new java.io.FileOutputStream(filename),Base64.DECODE);
    bos.write(dataToDecode.getBytes(PREFERRED_ENCODING));
  }
 catch (  java.io.IOException e) {
    throw e;
  }
 finally {
    try {
      bos.close();
    }
 catch (    Exception e) {
    }
  }
}

Fixed version (ground truth):
/** 
 * Convenience method for decoding data to a file. <p>As of v 2.3, if there is a error, the method will throw an java.io.IOException. <b>This is new to v2.3!</b> In earlier versions, it just returned false, but in retrospect that's a pretty poor way to handle it.</p>
 * @param dataToDecode Base64-encoded data as a string
 * @param filename Filename for saving decoded data
 * @throws java.io.IOException if there is an error
 * @since 2.1
 */
public static void decodeToFile(String dataToDecode,String filename) throws java.io.IOException {
  Base64.OutputStream bos=null;
  try {
    bos=new Base64.OutputStream(new java.io.FileOutputStream(filename),Base64.DECODE);
    bos.write(dataToDecode.getBytes(PREFERRED_ENCODING));
  }
  finally {
    try {
      if (bos != null) {
        bos.close();
      }
    }
 catch (    Exception ignored) {
    }
  }
}
Program: 117082
Project: 117082
Buggy source:
/** 
 * Returns one of the _SOMETHING_ALPHABET byte arrays depending on the options specified. It's possible, though silly, to specify ORDERED <b>and</b> URLSAFE in which case one of them will be picked, though there is no guarantee as to which one will be picked.
 */
private final static byte[] getAlphabet(int options){
  if ((options & URL_SAFE) == URL_SAFE) {
    return _URL_SAFE_ALPHABET;
  }
 else   if ((options & ORDERED) == ORDERED) {
    return _ORDERED_ALPHABET;
  }
 else {
    return _STANDARD_ALPHABET;
  }
}

Fixed version (ground truth):
/** 
 * Returns one of the _SOMETHING_ALPHABET byte arrays depending on the options specified. It's possible, though silly, to specify ORDERED <b>and</b> URLSAFE in which case one of them will be picked, though there is no guarantee as to which one will be picked.
 */
private static byte[] getAlphabet(int options){
  if ((options & URL_SAFE) == URL_SAFE) {
    return _URL_SAFE_ALPHABET;
  }
 else   if ((options & ORDERED) == ORDERED) {
    return _ORDERED_ALPHABET;
  }
 else {
    return _STANDARD_ALPHABET;
  }
}
Program: 117083
Project: 117083
Buggy source:
/** 
 * Reads <tt>infile</tt> and encodes it to <tt>outfile</tt>.
 * @param infile Input file
 * @param outfile Output file
 * @throws java.io.IOException if there is an error
 * @since 2.2
 */
public static void encodeFileToFile(String infile,String outfile) throws java.io.IOException {
  String encoded=Base64.encodeFromFile(infile);
  java.io.OutputStream out=null;
  try {
    out=new java.io.BufferedOutputStream(new java.io.FileOutputStream(outfile));
    out.write(encoded.getBytes("String_Node_Str"));
  }
 catch (  java.io.IOException e) {
    throw e;
  }
 finally {
    try {
      out.close();
    }
 catch (    Exception ex) {
    }
  }
}

Fixed version (ground truth):
/** 
 * Reads <tt>infile</tt> and encodes it to <tt>outfile</tt>.
 * @param infile Input file
 * @param outfile Output file
 * @throws java.io.IOException if there is an error
 * @since 2.2
 */
public static void encodeFileToFile(String infile,String outfile) throws java.io.IOException {
  String encoded=Base64.encodeFromFile(infile);
  java.io.OutputStream out=null;
  try {
    out=new java.io.BufferedOutputStream(new java.io.FileOutputStream(outfile));
    out.write(encoded.getBytes("String_Node_Str"));
  }
  finally {
    try {
      if (out != null) {
        out.close();
      }
    }
 catch (    Exception ignored) {
    }
  }
}
Program: 117085
Project: 117085
Buggy source:
/** 
 * Returns a CSV format of printer names, convenient for JavaScript
 * @return
 */
public static String getPrinterListing(){
  return printerListing;
}

Fixed version (ground truth):
/** 
 * Returns a CSV format of printer names, convenient for JavaScript
 * @return CSV listing of printer names
 */
public static String getPrinterListing(){
  return printerListing;
}
Program: 117086
Project: 117086
Buggy source:
/** 
 * Convenience method for append(byte[]) combined with a String of specified charset
 * @param s
 * @param c
 * @return
 * @throws UnsupportedEncodingException 
 */
public final ByteArrayBuilder append(StringBuilder s,Charset c) throws UnsupportedEncodingException {
  return append(s.toString(),c);
}

Fixed version (ground truth):
/** 
 * Convenience method for append(byte[]) combined with a String of specified charset
 * @param stringBuilder the StringBuilder to append
 * @param charset the Charset of the StringBuilder
 * @return this <code>ByteArrayBuilder</code>
 * @throws UnsupportedEncodingException 
 */
public final ByteArrayBuilder append(StringBuilder stringBuilder,Charset charset) throws UnsupportedEncodingException {
  return append(stringBuilder.toString(),charset);
}
Program: 117087
Project: 117087
Buggy source:
/** 
 * Convenience method for encoding data to a file. <p>As of v 2.3, if there is a error, the method will throw an java.io.IOException. <b>This is new to v2.3!</b> In earlier versions, it just returned false, but in retrospect that's a pretty poor way to handle it.</p>
 * @param dataToEncode byte array of data to encode in base64 form
 * @param filename Filename for saving encoded data
 * @throws java.io.IOException if there is an error
 * @throws NullPointerException if dataToEncode is null
 * @since 2.1
 */
public static void encodeToFile(byte[] dataToEncode,String filename) throws java.io.IOException {
  if (dataToEncode == null) {
    throw new NullPointerException("String_Node_Str");
  }
  Base64.OutputStream bos=null;
  try {
    bos=new Base64.OutputStream(new java.io.FileOutputStream(filename),Base64.ENCODE);
    bos.write(dataToEncode);
  }
 catch (  java.io.IOException e) {
    throw e;
  }
 finally {
    try {
      bos.close();
    }
 catch (    Exception e) {
    }
  }
}

Fixed version (ground truth):
/** 
 * Convenience method for encoding data to a file. <p>As of v 2.3, if there is a error, the method will throw an java.io.IOException. <b>This is new to v2.3!</b> In earlier versions, it just returned false, but in retrospect that's a pretty poor way to handle it.</p>
 * @param dataToEncode byte array of data to encode in base64 form
 * @param filename Filename for saving encoded data
 * @throws java.io.IOException if there is an error
 * @throws NullPointerException if dataToEncode is null
 * @since 2.1
 */
public static void encodeToFile(byte[] dataToEncode,String filename) throws java.io.IOException {
  if (dataToEncode == null) {
    throw new NullPointerException("String_Node_Str");
  }
  Base64.OutputStream bos=null;
  try {
    bos=new Base64.OutputStream(new java.io.FileOutputStream(filename),Base64.ENCODE);
    bos.write(dataToEncode);
  }
  finally {
    try {
      if (bos != null) {
        bos.close();
      }
    }
 catch (    Exception ignored) {
    }
  }
}
Program: 117088
Project: 117088
Buggy source:
/** 
 * Convenience method for reading a binary file and base64-encoding it. <p>As of v 2.3, if there is a error, the method will throw an java.io.IOException. <b>This is new to v2.3!</b> In earlier versions, it just returned false, but in retrospect that's a pretty poor way to handle it.</p>
 * @param filename Filename for reading binary data
 * @return base64-encoded string
 * @throws java.io.IOException if there is an error
 * @since 2.1
 */
public static String encodeFromFile(String filename) throws java.io.IOException {
  String encodedData=null;
  Base64.InputStream bis=null;
  try {
    java.io.File file=new java.io.File(filename);
    byte[] buffer=new byte[Math.max((int)(file.length() * 1.4),40)];
    int length=0;
    int numBytes=0;
    bis=new Base64.InputStream(new java.io.BufferedInputStream(new java.io.FileInputStream(file)),Base64.ENCODE);
    while ((numBytes=bis.read(buffer,length,4096)) >= 0) {
      length+=numBytes;
    }
    encodedData=new String(buffer,0,length,Base64.PREFERRED_ENCODING);
  }
 catch (  java.io.IOException e) {
    throw e;
  }
 finally {
    try {
      bis.close();
    }
 catch (    Exception e) {
    }
  }
  return encodedData;
}

Fixed version (ground truth):
/** 
 * Convenience method for reading a binary file and base64-encoding it. <p>As of v 2.3, if there is a error, the method will throw an java.io.IOException. <b>This is new to v2.3!</b> In earlier versions, it just returned false, but in retrospect that's a pretty poor way to handle it.</p>
 * @param filename Filename for reading binary data
 * @return base64-encoded string
 * @throws java.io.IOException if there is an error
 * @since 2.1
 */
public static String encodeFromFile(String filename) throws java.io.IOException {
  String encodedData=null;
  Base64.InputStream bis=null;
  try {
    java.io.File file=new java.io.File(filename);
    byte[] buffer=new byte[Math.max((int)(file.length() * 1.4),40)];
    int length=0;
    int numBytes;
    bis=new Base64.InputStream(new java.io.BufferedInputStream(new java.io.FileInputStream(file)),Base64.ENCODE);
    while ((numBytes=bis.read(buffer,length,4096)) >= 0) {
      length+=numBytes;
    }
    encodedData=new String(buffer,0,length,Base64.PREFERRED_ENCODING);
  }
  finally {
    try {
      if (bis != null) {
        bis.close();
      }
    }
 catch (    Exception ignored) {
    }
  }
  return encodedData;
}
Program: 117090
Project: 117090
Buggy source:
/** 
 * Reads <tt>infile</tt> and decodes it to <tt>outfile</tt>.
 * @param infile Input file
 * @param outfile Output file
 * @throws java.io.IOException if there is an error
 * @since 2.2
 */
public static void decodeFileToFile(String infile,String outfile) throws java.io.IOException {
  byte[] decoded=Base64.decodeFromFile(infile);
  java.io.OutputStream out=null;
  try {
    out=new java.io.BufferedOutputStream(new java.io.FileOutputStream(outfile));
    out.write(decoded);
  }
 catch (  java.io.IOException e) {
    throw e;
  }
 finally {
    try {
      out.close();
    }
 catch (    Exception ex) {
    }
  }
}

Fixed version (ground truth):
/** 
 * Reads <tt>infile</tt> and decodes it to <tt>outfile</tt>.
 * @param infile Input file
 * @param outfile Output file
 * @throws java.io.IOException if there is an error
 * @since 2.2
 */
public static void decodeFileToFile(String infile,String outfile) throws java.io.IOException {
  byte[] decoded=Base64.decodeFromFile(infile);
  java.io.OutputStream out=null;
  try {
    out=new java.io.BufferedOutputStream(new java.io.FileOutputStream(outfile));
    out.write(decoded);
  }
  finally {
    try {
      if (out != null) {
        out.close();
      }
    }
 catch (    Exception ignored) {
    }
  }
}
Program: 117091
Project: 117091
Buggy source:
/** 
 * Returns one of the _SOMETHING_DECODABET byte arrays depending on the options specified. It's possible, though silly, to specify ORDERED and URL_SAFE in which case one of them will be picked, though there is no guarantee as to which one will be picked.
 */
private final static byte[] getDecodabet(int options){
  if ((options & URL_SAFE) == URL_SAFE) {
    return _URL_SAFE_DECODABET;
  }
 else   if ((options & ORDERED) == ORDERED) {
    return _ORDERED_DECODABET;
  }
 else {
    return _STANDARD_DECODABET;
  }
}

Fixed version (ground truth):
/** 
 * Returns one of the _SOMETHING_DECODABET byte arrays depending on the options specified. It's possible, though silly, to specify ORDERED and URL_SAFE in which case one of them will be picked, though there is no guarantee as to which one will be picked.
 */
private static byte[] getDecodabet(int options){
  if ((options & URL_SAFE) == URL_SAFE) {
    return _URL_SAFE_DECODABET;
  }
 else   if ((options & ORDERED) == ORDERED) {
    return _ORDERED_DECODABET;
  }
 else {
    return _STANDARD_DECODABET;
  }
}
Program: 117092
Project: 117092
Buggy source:
/** 
 * Convenience method for reading a base64-encoded file and decoding it. <p>As of v 2.3, if there is a error, the method will throw an java.io.IOException. <b>This is new to v2.3!</b> In earlier versions, it just returned false, but in retrospect that's a pretty poor way to handle it.</p>
 * @param filename Filename for reading encoded data
 * @return decoded byte array
 * @throws java.io.IOException if there is an error
 * @since 2.1
 */
public static byte[] decodeFromFile(String filename) throws java.io.IOException {
  byte[] decodedData=null;
  Base64.InputStream bis=null;
  try {
    java.io.File file=new java.io.File(filename);
    byte[] buffer=null;
    int length=0;
    int numBytes=0;
    if (file.length() > Integer.MAX_VALUE) {
      throw new java.io.IOException("String_Node_Str" + file.length() + "String_Node_Str");
    }
    buffer=new byte[(int)file.length()];
    bis=new Base64.InputStream(new java.io.BufferedInputStream(new java.io.FileInputStream(file)),Base64.DECODE);
    while ((numBytes=bis.read(buffer,length,4096)) >= 0) {
      length+=numBytes;
    }
    decodedData=new byte[length];
    System.arraycopy(buffer,0,decodedData,0,length);
  }
 catch (  java.io.IOException e) {
    throw e;
  }
 finally {
    try {
      bis.close();
    }
 catch (    Exception e) {
    }
  }
  return decodedData;
}

Fixed version (ground truth):
/** 
 * Convenience method for reading a base64-encoded file and decoding it. <p>As of v 2.3, if there is a error, the method will throw an java.io.IOException. <b>This is new to v2.3!</b> In earlier versions, it just returned false, but in retrospect that's a pretty poor way to handle it.</p>
 * @param filename Filename for reading encoded data
 * @return decoded byte array
 * @throws java.io.IOException if there is an error
 * @since 2.1
 */
public static byte[] decodeFromFile(String filename) throws java.io.IOException {
  byte[] decodedData=null;
  Base64.InputStream bis=null;
  try {
    java.io.File file=new java.io.File(filename);
    byte[] buffer;
    int length=0;
    int numBytes;
    if (file.length() > Integer.MAX_VALUE) {
      throw new java.io.IOException("String_Node_Str" + file.length() + "String_Node_Str");
    }
    buffer=new byte[(int)file.length()];
    bis=new Base64.InputStream(new java.io.BufferedInputStream(new java.io.FileInputStream(file)),Base64.DECODE);
    while ((numBytes=bis.read(buffer,length,4096)) >= 0) {
      length+=numBytes;
    }
    decodedData=new byte[length];
    System.arraycopy(buffer,0,decodedData,0,length);
  }
  finally {
    try {
      if (bis != null) {
        bis.close();
      }
    }
 catch (    Exception ignored) {
    }
  }
  return decodedData;
}
Program: 117093
Project: 117093
Buggy source:
/** 
 * Attempts to decode Base64 data and deserialize a Java Object within. Returns <tt>null</tt> if there was an error.
 * @param encodedObject The Base64 data to decode
 * @return The decoded and deserialized object
 * @throws NullPointerException if encodedObject is null
 * @throws java.io.IOException if there is a general error
 * @throws ClassNotFoundException if the decoded object is of a class that cannot be found by the JVM
 * @since 1.5
 */
public static Object decodeToObject(String encodedObject) throws java.io.IOException, java.lang.ClassNotFoundException {
  byte[] objBytes=decode(encodedObject);
  java.io.ByteArrayInputStream bais=null;
  java.io.ObjectInputStream ois=null;
  Object obj=null;
  try {
    bais=new java.io.ByteArrayInputStream(objBytes);
    ois=new java.io.ObjectInputStream(bais);
    obj=ois.readObject();
  }
 catch (  java.io.IOException e) {
    throw e;
  }
catch (  java.lang.ClassNotFoundException e) {
    throw e;
  }
 finally {
    try {
      bais.close();
    }
 catch (    Exception e) {
    }
    try {
      ois.close();
    }
 catch (    Exception e) {
    }
  }
  return obj;
}

Fixed version (ground truth):
/** 
 * Attempts to decode Base64 data and deserialize a Java Object within. Returns <tt>null</tt> if there was an error.
 * @param encodedObject The Base64 data to decode
 * @return The decoded and deserialized object
 * @throws NullPointerException if encodedObject is null
 * @throws java.io.IOException if there is a general error
 * @throws ClassNotFoundException if the decoded object is of a class that cannot be found by the JVM
 * @since 1.5
 */
public static Object decodeToObject(String encodedObject) throws java.io.IOException, java.lang.ClassNotFoundException {
  byte[] objBytes=decode(encodedObject);
  java.io.ByteArrayInputStream bais=null;
  java.io.ObjectInputStream ois=null;
  Object obj=null;
  try {
    bais=new java.io.ByteArrayInputStream(objBytes);
    ois=new java.io.ObjectInputStream(bais);
    obj=ois.readObject();
  }
  finally {
    try {
      if (bais != null) {
        bais.close();
      }
    }
 catch (    Exception ignored) {
    }
    try {
      if (ois != null) {
        ois.close();
      }
    }
 catch (    Exception ignored) {
    }
  }
  return obj;
}
Program: 117096
Project: 117096
Buggy source:
/** 
 * Convenience method for decoding data to a file. <p>As of v 2.3, if there is a error, the method will throw an java.io.IOException. <b>This is new to v2.3!</b> In earlier versions, it just returned false, but in retrospect that's a pretty poor way to handle it.</p>
 * @param dataToDecode Base64-encoded data as a string
 * @param filename Filename for saving decoded data
 * @throws java.io.IOException if there is an error
 * @since 2.1
 */
public static void decodeToFile(String dataToDecode,String filename) throws java.io.IOException {
  Base64.OutputStream bos=null;
  try {
    bos=new Base64.OutputStream(new java.io.FileOutputStream(filename),Base64.DECODE);
    bos.write(dataToDecode.getBytes(PREFERRED_ENCODING));
  }
 catch (  java.io.IOException e) {
    throw e;
  }
 finally {
    try {
      bos.close();
    }
 catch (    Exception e) {
    }
  }
}

Fixed version (ground truth):
/** 
 * Convenience method for decoding data to a file. <p>As of v 2.3, if there is a error, the method will throw an java.io.IOException. <b>This is new to v2.3!</b> In earlier versions, it just returned false, but in retrospect that's a pretty poor way to handle it.</p>
 * @param dataToDecode Base64-encoded data as a string
 * @param filename Filename for saving decoded data
 * @throws java.io.IOException if there is an error
 * @since 2.1
 */
public static void decodeToFile(String dataToDecode,String filename) throws java.io.IOException {
  Base64.OutputStream bos=null;
  try {
    bos=new Base64.OutputStream(new java.io.FileOutputStream(filename),Base64.DECODE);
    bos.write(dataToDecode.getBytes(PREFERRED_ENCODING));
  }
  finally {
    try {
      if (bos != null) {
        bos.close();
      }
    }
 catch (    Exception ignored) {
    }
  }
}
Program: 117097
Project: 117097
Buggy source:
/** 
 * Returns one of the _SOMETHING_ALPHABET byte arrays depending on the options specified. It's possible, though silly, to specify ORDERED <b>and</b> URLSAFE in which case one of them will be picked, though there is no guarantee as to which one will be picked.
 */
private final static byte[] getAlphabet(int options){
  if ((options & URL_SAFE) == URL_SAFE) {
    return _URL_SAFE_ALPHABET;
  }
 else   if ((options & ORDERED) == ORDERED) {
    return _ORDERED_ALPHABET;
  }
 else {
    return _STANDARD_ALPHABET;
  }
}

Fixed version (ground truth):
/** 
 * Returns one of the _SOMETHING_ALPHABET byte arrays depending on the options specified. It's possible, though silly, to specify ORDERED <b>and</b> URLSAFE in which case one of them will be picked, though there is no guarantee as to which one will be picked.
 */
private static byte[] getAlphabet(int options){
  if ((options & URL_SAFE) == URL_SAFE) {
    return _URL_SAFE_ALPHABET;
  }
 else   if ((options & ORDERED) == ORDERED) {
    return _ORDERED_ALPHABET;
  }
 else {
    return _STANDARD_ALPHABET;
  }
}
Program: 117098
Project: 117098
Buggy source:
/** 
 * Reads <tt>infile</tt> and encodes it to <tt>outfile</tt>.
 * @param infile Input file
 * @param outfile Output file
 * @throws java.io.IOException if there is an error
 * @since 2.2
 */
public static void encodeFileToFile(String infile,String outfile) throws java.io.IOException {
  String encoded=Base64.encodeFromFile(infile);
  java.io.OutputStream out=null;
  try {
    out=new java.io.BufferedOutputStream(new java.io.FileOutputStream(outfile));
    out.write(encoded.getBytes("String_Node_Str"));
  }
 catch (  java.io.IOException e) {
    throw e;
  }
 finally {
    try {
      out.close();
    }
 catch (    Exception ex) {
    }
  }
}

Fixed version (ground truth):
/** 
 * Reads <tt>infile</tt> and encodes it to <tt>outfile</tt>.
 * @param infile Input file
 * @param outfile Output file
 * @throws java.io.IOException if there is an error
 * @since 2.2
 */
public static void encodeFileToFile(String infile,String outfile) throws java.io.IOException {
  String encoded=Base64.encodeFromFile(infile);
  java.io.OutputStream out=null;
  try {
    out=new java.io.BufferedOutputStream(new java.io.FileOutputStream(outfile));
    out.write(encoded.getBytes("String_Node_Str"));
  }
  finally {
    try {
      if (out != null) {
        out.close();
      }
    }
 catch (    Exception ignored) {
    }
  }
}
Program: 117100
Project: 117100
Buggy source:
/** 
 * Returns a CSV format of printer names, convenient for JavaScript
 * @return
 */
public static String getPrinterListing(){
  return printerListing;
}

Fixed version (ground truth):
/** 
 * Returns a CSV format of printer names, convenient for JavaScript
 * @return CSV listing of printer names
 */
public static String getPrinterListing(){
  return printerListing;
}
Program: 117101
Project: 117101
Buggy source:
/** 
 * Returns the cached version of the found serial ports on the system. i.e. ["COM1","COM2","COM3"] or ["/dev/tty0","/dev/tty1"]
 * @return 
 */
public String getSerialPorts(){
  return this.serialPorts;
}

Fixed version (ground truth):
/** 
 * Returns the cached version of the found serial ports on the system. i.e. ["COM1","COM2","COM3"] or ["/dev/tty0","/dev/tty1"]
 * @return Cached version of serial ports
 */
public String getSerialPorts(){
  return this.serialPorts;
}
Program: 117102
Project: 117102
Buggy source:
/** 
 * Timeout in milliseconds for the port.readBytes() function. Default is 1200 (1.2 seconds)
 * @param timeout 
 */
public final void setTimeout(int timeout){
  this.timeout=timeout;
}

Fixed version (ground truth):
/** 
 * Timeout in milliseconds for the port.readBytes() function. Default is 1200 (1.2 seconds)
 * @param timeout the timeout
 */
public final void setTimeout(int timeout){
  this.timeout=timeout;
}
Program: 117103
Project: 117103
Buggy source:
/** 
 * Return whether or not the serial port is open
 * @return 
 */
public boolean isOpen(){
  return port == null ? false : port.isOpened();
}

Fixed version (ground truth):
/** 
 * Return whether or not the serial port is open
 * @return boolean indicating if port is open
 */
public boolean isOpen(){
  return port != null && port.isOpened();
}
Program: 117104
Project: 117104
Buggy source:
/** 
 * Timeout in milliseconds for the port.readBytes() function.
 * @return 
 */
public int getTimeout(){
  return this.timeout;
}

Fixed version (ground truth):
/** 
 * Timeout in milliseconds for the port.readBytes() function.
 * @return the timeout
 */
public int getTimeout(){
  return this.timeout;
}
Program: 117105
Project: 117105
Buggy source:
/** 
 * Caches a comma delimited list of ports found on this system.  Also caches the array so that it can be referenced by index when opening the port later.
 * @return 
 */
public String fetchSerialPorts(){
  StringBuilder sb=new StringBuilder();
  this.portArray=SerialPortList.getPortNames();
  for (int i=0; i < this.portArray.length; i++) {
    sb.append(this.portArray[i]).append(i < this.portArray.length - 1 ? "String_Node_Str" : "String_Node_Str");
  }
  return (this.serialPorts=sb.toString());
}

Fixed version (ground truth):
/** 
 * Caches a comma delimited list of ports found on this system.  Also caches the array so that it can be referenced by index when opening the port later.
 * @return List of ports
 */
public String fetchSerialPorts(){
  StringBuilder sb=new StringBuilder();
  this.portArray=SerialPortList.getPortNames();
  for (int i=0; i < this.portArray.length; i++) {
    sb.append(this.portArray[i]).append(i < this.portArray.length - 1 ? "String_Node_Str" : "String_Node_Str");
  }
  return (this.serialPorts=sb.toString());
}
Program: 117106
Project: 117106
Buggy source:
/** 
 * Closes the open serial port, if open.  If not, displays a warning message in the console and  continues quietly.  If the port cannot close, a  <code>SerialPortExcpetion</code> will be thrown.
 * @return
 * @throws SerialPortException 
 */
public boolean close() throws SerialPortException {
  if (port == null || !port.isOpened()) {
    LogIt.log(Level.WARNING,"String_Node_Str" + portName + "String_Node_Str");
    return false;
  }
  boolean closed=port.closePort();
  if (!closed) {
    LogIt.log(Level.WARNING,"String_Node_Str" + portName + "String_Node_Str");
  }
 else {
    LogIt.log("String_Node_Str" + portName + "String_Node_Str");
  }
  port=null;
  portName=null;
  return closed;
}

Fixed version (ground truth):
/** 
 * Closes the open serial port, if open.  If not, displays a warning message in the console and  continues quietly.  If the port cannot close, a  <code>SerialPortExcpetion</code> will be thrown.
 * @return boolean indicating success
 * @throws SerialPortException 
 */
public boolean close() throws SerialPortException {
  if (port == null || !port.isOpened()) {
    LogIt.log(Level.WARNING,"String_Node_Str" + portName + "String_Node_Str");
    return false;
  }
  boolean closed=port.closePort();
  if (!closed) {
    LogIt.log(Level.WARNING,"String_Node_Str" + portName + "String_Node_Str");
  }
 else {
    LogIt.log("String_Node_Str" + portName + "String_Node_Str");
  }
  port=null;
  portName=null;
  return closed;
}
Program: 117107
Project: 117107
Buggy source:
/** 
 * Allow a port to be selected from array of returned ports.
 * @param portID
 * @return
 * @throws SerialPortException
 * @throws SerialException 
 */
public boolean open(int portID) throws SerialPortException, SerialException {
  if (this.serialPorts == null) {
    this.getSerialPorts();
  }
  if (this.serialPorts.equals("String_Node_Str")) {
    throw new SerialException("String_Node_Str");
  }
  if (portID > -1 && this.portArray.length > 0 && this.portArray.length > portID) {
    return open(portArray[portID]);
  }
 else {
    throw new SerialException("String_Node_Str" + portID + "String_Node_Str"+ "String_Node_Str"+ serialPorts);
  }
}

Fixed version (ground truth):
/** 
 * Allow a port to be selected from array of returned ports.
 * @param portID the port ID to select
 * @return boolean indicting success
 * @throws SerialPortException
 * @throws SerialException 
 */
public boolean open(int portID) throws SerialPortException, SerialException {
  if (this.serialPorts == null) {
    this.getSerialPorts();
  }
  if ("String_Node_Str".equals(this.serialPorts)) {
    throw new SerialException("String_Node_Str");
  }
  if (portID > -1 && this.portArray.length > 0 && this.portArray.length > portID) {
    return open(portArray[portID]);
  }
 else {
    throw new SerialException("String_Node_Str" + portID + "String_Node_Str"+ "String_Node_Str"+ serialPorts);
  }
}
Program: 117108
Project: 117108
Buggy source:
private void generateIntArray(){
  LogIt.log("String_Node_Str");
  imageAsIntArray=new int[(int)(imageAsBooleanArray.length / 8)];
  for (int i=0; i < imageAsIntArray.length; i++) {
    for (int k=0; k < 8; k++) {
      imageAsIntArray[i]+=(imageAsBooleanArray[8 * i + k] ? 1 : 0) << 7 - k;
    }
  }
}

Fixed version (ground truth):
private void generateIntArray(){
  LogIt.log("String_Node_Str");
  imageAsIntArray=new int[imageAsBooleanArray.length / 8];
  for (int i=0; i < imageAsIntArray.length; i++) {
    for (int k=0; k < 8; k++) {
      imageAsIntArray[i]+=(imageAsBooleanArray[8 * i + k] ? 1 : 0) << 7 - k;
    }
  }
}
Program: 117109
Project: 117109
Buggy source:
/** 
 * Initializes the ImageWrapper. This populates the internal structures with the data created from the original image. It is normally called by the constructor, but if for any reason you change the image contents (for example, if you resize the image), it must be initialized again prior to calling getImageCommand()
 */
private final void init(){
  LogIt.log("String_Node_Str");
  generateBlackPixels();
  generateIntArray();
}

Fixed version (ground truth):
/** 
 * Initializes the ImageWrapper. This populates the internal structures with the data created from the original image. It is normally called by the constructor, but if for any reason you change the image contents (for example, if you resize the image), it must be initialized again prior to calling getImageCommand()
 */
private void init(){
  LogIt.log("String_Node_Str");
  generateBlackPixels();
  generateIntArray();
}
Program: 117111
Project: 117111
Buggy source:
/** 
 * http://android-essential-devtopics.blogspot.com/2013/02/sending-bit-image-to-epson-printer.html
 * @author Oleg Morozov 02/21/2013 (via public domain)
 * @author Tres Finocchiaro 10/01/2013
 * @param b 
 */
private void appendEpsonSlices(ByteArrayBuilder builder){
  builder.append(new byte[]{0x1B,0x33,24});
  int offset=0;
  while (offset < getHeight()) {
    byte nL=(byte)((int)(getWidth() % 256));
    byte nH=(byte)((int)(getWidth() / 256));
    builder.append(new byte[]{0x1B,0x2A,(byte)dotDensity,nL,nH});
    for (int x=0; x < getWidth(); ++x) {
      for (int k=0; k < 3; ++k) {
        byte slice=0;
        for (int b=0; b < 8; ++b) {
          int y=(((offset / 8) + k) * 8) + b;
          int i=(y * getWidth()) + x;
          boolean v=false;
          if (i < getImageAsBooleanArray().length) {
            v=getImageAsBooleanArray()[i];
          }
          slice|=(byte)((v ? 1 : 0) << (7 - b));
        }
        builder.append(new byte[]{slice});
      }
    }
    offset+=24;
    builder.append(new byte[]{10});
  }
  builder.append(new byte[]{0x1B,0x33,30});
}

Fixed version (ground truth):
/** 
 * http://android-essential-devtopics.blogspot.com/2013/02/sending-bit-image-to-epson-printer.html
 * @param builder the ByteArrayBuilder to use
 * @author Oleg Morozov 02/21/2013 (via public domain)
 * @author Tres Finocchiaro 10/01/2013
 */
private void appendEpsonSlices(ByteArrayBuilder builder){
  builder.append(new byte[]{0x1B,0x33,24});
  int offset=0;
  while (offset < getHeight()) {
    byte nL=(byte)((int)(getWidth() % 256));
    byte nH=(byte)((int)(getWidth() / 256));
    builder.append(new byte[]{0x1B,0x2A,(byte)dotDensity,nL,nH});
    for (int x=0; x < getWidth(); ++x) {
      for (int k=0; k < 3; ++k) {
        byte slice=0;
        for (int b=0; b < 8; ++b) {
          int y=(((offset / 8) + k) * 8) + b;
          int i=(y * getWidth()) + x;
          boolean v=false;
          if (i < getImageAsBooleanArray().length) {
            v=getImageAsBooleanArray()[i];
          }
          slice|=(byte)((v ? 1 : 0) << (7 - b));
        }
        builder.append(new byte[]{slice});
      }
    }
    offset+=24;
    builder.append(new byte[]{10});
  }
  builder.append(new byte[]{0x1B,0x33,30});
}
Program: 117112
Project: 117112
Buggy source:
public void setCopies(int copies){
  this.copies=Integer.valueOf(copies);
}

Fixed version (ground truth):
public void setCopies(int copies){
  this.copies=copies;
}
Program: 117113
Project: 117113
Buggy source:
/** 
 * Converts typed Hex (<code>String</code> base 16) to <code>byte[]</code>. This is expecially useful for special characters that are appended via JavaScript, specifically the "\0" or <code>NUL</code> character, which will early terminate a JavaScript <code>String</code>.
 * @param s
 * @return
 * @throws NumberFormatException
 */
public static byte[] hexStringToByteArray(String s) throws NumberFormatException {
  byte[] data=new byte[0];
  if (s != null && s.length() > 0) {
    String[] split;
    if (s.length() > 2) {
      if (s.length() >= 3 && s.contains("String_Node_Str")) {
        s=s.startsWith("String_Node_Str") ? s.substring(1) : s;
        s=s.endsWith("String_Node_Str") ? s.substring(0,s.length() - 1) : s;
        split=s.split("String_Node_Str");
      }
 else {
        split=s.split("String_Node_Str");
      }
      data=new byte[split.length];
      for (int i=0; i < split.length; i++) {
        data[i]=Byte.parseByte(split[i],16);
      }
    }
 else     if (s.length() == 2) {
      data=new byte[]{Byte.parseByte(s)};
    }
  }
  return data;
}

Fixed version (ground truth):
/** 
 * Converts typed Hex (<code>String</code> base 16) to <code>byte[]</code>. This is expecially useful for special characters that are appended via JavaScript, specifically the "\0" or <code>NUL</code> character, which will early terminate a JavaScript <code>String</code>.
 * @param s
 * @return
 * @throws NumberFormatException
 */
public static byte[] hexStringToByteArray(String s) throws NumberFormatException {
  byte[] data=new byte[0];
  if (s != null && s.length() > 0) {
    String[] split;
    if (s.length() > 2) {
      if (s.length() >= 3 && s.contains("String_Node_Str")) {
        s=s.startsWith("String_Node_Str") ? s.substring(1) : s;
        s=s.endsWith("String_Node_Str") ? s.substring(0,s.length() - 1) : s;
        split=s.split("String_Node_Str");
      }
 else {
        split=s.split("String_Node_Str");
      }
      data=new byte[split.length];
      for (int i=0; i < split.length; i++) {
        Integer signedByte=Integer.parseInt(split[i],16);
        data[i]=(byte)(signedByte & 0xFF);
      }
    }
 else     if (s.length() == 2) {
      data=new byte[]{Byte.parseByte(s)};
    }
  }
  return data;
}
Program: 117114
Project: 117114
Buggy source:
/** 
 * Checks if the stored   {@code Collection} does not contain the provided item.<p>This method throws an  {@code AssertionError} if<ul> <li>the stored  {@code Collection} does contain the passed {@code item}</li> <li>the given   {@code Collection} is {@code null}</li> </ul> </p>
 * @param item the {@code Object} which the {@code Collection} should not contain.
 */
public void toNotContain(final Object item){
  expectNotNull(this.getValue(),"String_Node_Str",item);
  expectTrue(!this.getValue().contains(item),"String_Node_Str",this.getValue(),item);
}

Fixed version (ground truth):
/** 
 * Checks if the stored   {@code Collection} does not contain the provided item.<p>This method throws an  {@code AssertionError} if<ul> <li>the stored  {@code Collection} does contain the passed {@code item}</li> <li>the given   {@code Collection} is {@code null}</li> </ul>
 * @param item the {@code Object} which the {@code Collection} should not contain.
 */
public void toNotContain(final Object item){
  expectNotNull(this.getValue(),"String_Node_Str",item);
  expectTrue(!this.getValue().contains(item),"String_Node_Str",this.getValue(),item);
}
Program: 117115
Project: 117115
Buggy source:
/** 
 * Checks if the given   {@code Collection} has the expected size<p>This method throws an  {@code AssertionError} if<ul> <li>the stored  {@code Collection} has a different size than the passed value</li><li>the stored  {@code Collection} is {@code null}</li> </ul> </p>
 * @param size The expected size of the collection
 */
public void toHaveSize(final int size){
  expectNotNull(this.getValue(),"String_Node_Str",size);
  expectTrue(this.getValue().size() == size,"String_Node_Str" + "String_Node_Str",this.getValue(),size,this.getValue().size());
}

Fixed version (ground truth):
/** 
 * Checks if the given   {@code Collection} has the expected size<p>This method throws an  {@code AssertionError} if<ul> <li>the stored  {@code Collection} has a different size than the passed value</li><li>the stored  {@code Collection} is {@code null}</li> </ul>
 * @param size The expected size of the collection
 */
public void toHaveSize(final int size){
  expectNotNull(this.getValue(),"String_Node_Str",size);
  expectTrue(this.getValue().size() == size,"String_Node_Str" + "String_Node_Str",this.getValue(),size,this.getValue().size());
}
Program: 117116
Project: 117116
Buggy source:
/** 
 * Checks if the stored   {@code Collection} contains the provided item.<p>This method throws an  {@code AssertionError} if<ul> <li>the stored  {@code Collection} does not contain the passed {@code item}</li> <li>the given   {@code Collection} is {@code null}</li> </ul> </p>
 * @param item the {@code Object} which the {@code Collection} should contain.
 */
public void toContain(final Object item){
  expectNotNull(this.getValue(),"String_Node_Str",item);
  expectTrue(this.getValue().contains(item),"String_Node_Str",this.getValue(),item);
}

Fixed version (ground truth):
/** 
 * Checks if the stored   {@code Collection} contains the provided item.<p>This method throws an  {@code AssertionError} if<ul> <li>the stored  {@code Collection} does not contain the passed {@code item}</li> <li>the given   {@code Collection} is {@code null}</li> </ul>
 * @param item the {@code Object} which the {@code Collection} should contain.
 */
public void toContain(final Object item){
  expectNotNull(this.getValue(),"String_Node_Str",item);
  expectTrue(this.getValue().contains(item),"String_Node_Str",this.getValue(),item);
}
Program: 117117
Project: 117117
Buggy source:
/** 
 * Checks if the stored   {@code Map} does not contain the given {@code key}. <p>This method throws an   {@code AssertionError} if<ul> <li>the stored  {@code Map} contains the given {@code key}</li> <li>the stored   {@code Map} is {@code null}</li> </ul>
 */
public void toNotContainKey(final K key){
  expectNotNull(this.getValue(),"String_Node_Str",key);
  expectTrue(!this.getValue().containsKey(key),"String_Node_Str",this.getValue(),key);
}

Fixed version (ground truth):
/** 
 * Checks if the stored   {@code Map} does not contain the given {@code key}. <p>This method throws an   {@code AssertionError} if<ul> <li>the stored  {@code Map} contains the given {@code key}</li> <li>the stored   {@code Map} is {@code null}</li> </ul>
 * @param key the expected key
 */
public void toNotContainKey(final K key){
  expectNotNull(this.getValue(),"String_Node_Str",key);
  expectTrue(!this.getValue().containsKey(key),"String_Node_Str",this.getValue(),key);
}