Program: 117079
Project: 117079
Buggy source:
/** 
 * Serializes an object and returns the Base64-encoded version of that serialized object. <p>As of v 2.3, if the object cannot be serialized or there is another error, the method will throw an java.io.IOException. <b>This is new to v2.3!</b> In earlier versions, it just returned a null value, but in retrospect that's a pretty poor way to handle it.</p> The object is not GZip-compressed before being encoded. <p> Example options:<pre> GZIP: gzip-compresses object before encoding it. DO_BREAK_LINES: break lines at 76 characters </pre> <p> Example: <code>encodeObject( myObj, Base64.GZIP )</code> or <p> Example: <code>encodeObject( myObj, Base64.GZIP | Base64.DO_BREAK_LINES )</code>
 * @param serializableObject The object to encode
 * @param options Specified options
 * @return The Base64-encoded object
 * @see Base64#GZIP
 * @see Base64#DO_BREAK_LINES
 * @throws java.io.IOException if there is an error
 * @since 2.0
 */
public static String encodeObject(java.io.Serializable serializableObject,int options) throws java.io.IOException {
  if (serializableObject == null) {
    throw new NullPointerException("String_Node_Str");
  }
  java.io.ByteArrayOutputStream baos=null;
  java.io.OutputStream b64os=null;
  java.io.ObjectOutputStream oos=null;
  try {
    baos=new java.io.ByteArrayOutputStream();
    b64os=new Base64.OutputStream(baos,ENCODE | options);
    oos=new java.io.ObjectOutputStream(b64os);
    oos.writeObject(serializableObject);
  }
 catch (  java.io.IOException e) {
    throw e;
  }
 finally {
    try {
      oos.close();
    }
 catch (    Exception e) {
    }
    try {
      b64os.close();
    }
 catch (    Exception e) {
    }
    try {
      baos.close();
    }
 catch (    Exception e) {
    }
  }
  try {
    return new String(baos.toByteArray(),PREFERRED_ENCODING);
  }
 catch (  java.io.UnsupportedEncodingException uue) {
    return new String(baos.toByteArray());
  }
}

Fixed version (ground truth):
/** 
 * Serializes an object and returns the Base64-encoded version of that serialized object. <p>As of v 2.3, if the object cannot be serialized or there is another error, the method will throw an java.io.IOException. <b>This is new to v2.3!</b> In earlier versions, it just returned a null value, but in retrospect that's a pretty poor way to handle it.</p> The object is not GZip-compressed before being encoded. <p> Example options:<pre> GZIP: gzip-compresses object before encoding it. DO_BREAK_LINES: break lines at 76 characters </pre> <p> Example: <code>encodeObject( myObj, Base64.GZIP )</code> or <p> Example: <code>encodeObject( myObj, Base64.GZIP | Base64.DO_BREAK_LINES )</code>
 * @param serializableObject The object to encode
 * @param options Specified options
 * @return The Base64-encoded object
 * @see Base64#GZIP
 * @see Base64#DO_BREAK_LINES
 * @throws java.io.IOException if there is an error
 * @since 2.0
 */
public static String encodeObject(java.io.Serializable serializableObject,int options) throws java.io.IOException {
  if (serializableObject == null) {
    throw new NullPointerException("String_Node_Str");
  }
  java.io.ByteArrayOutputStream baos=null;
  java.io.OutputStream b64os=null;
  java.io.ObjectOutputStream oos=null;
  try {
    baos=new java.io.ByteArrayOutputStream();
    b64os=new Base64.OutputStream(baos,ENCODE | options);
    oos=new java.io.ObjectOutputStream(b64os);
    oos.writeObject(serializableObject);
  }
  finally {
    try {
      if (oos != null) {
        oos.close();
      }
    }
 catch (    Exception ignored) {
    }
    try {
      if (b64os != null) {
        b64os.close();
      }
    }
 catch (    Exception ignored) {
    }
    try {
      if (baos != null) {
        baos.close();
      }
    }
 catch (    Exception ignored) {
    }
  }
  try {
    return new String(baos.toByteArray(),PREFERRED_ENCODING);
  }
 catch (  java.io.UnsupportedEncodingException uue) {
    return new String(baos.toByteArray());
  }
}