Program: 46861
Project: 46861
Buggy source:
/** 
 * writes an concrete type
 * @param out
 * @param target
 * @param eid
 * @throws IOException
 * @throws IllegalArgumentException
 * @throws IllegalAccessException
 */
private void write(final DataOutputStream out,final Object target,final byte eid) throws IOException, IllegalArgumentException, IllegalAccessException {
switch (eid) {
case nullEid:
case boolTrueEid:
case boolFalseEid:
case pBoolTrueEid:
case pBoolFalseEid:
    break;
case byteEid:
case pByteEid:
  out.writeByte(((Byte)target).byteValue());
break;
case shortEid:
case pShortEid:
out.writeShort(((Short)target).shortValue());
break;
case intEid:
case pIntEid:
out.writeInt(((Integer)target).intValue());
break;
case longEid:
case pLongEid:
out.writeLong(((Long)target).longValue());
break;
case floatEid:
case pFloatEid:
out.writeFloat(((Float)target).floatValue());
break;
case doubleEid:
case pDoubleEid:
out.writeDouble(((Double)target).doubleValue());
break;
case stringEid:
out.writeUTF((String)target);
break;
case pCharEid:
case charEid:
out.writeUTF(String.valueOf(target));
break;
case objEid:
break;
case arrayEid:
final Class<?> compClass=target.getClass().getComponentType();
final byte aeid=getClassEid(compClass);
if (aeid < 0) throw new UnserializableException(target);
out.writeByte(aeid);
writeArray(out,target,aeid,compClass);
break;
default :
final Class<?> tcl=target.getClass();
if (tcl.isEnum()) out.writeByte(((Enum<?>)target).ordinal());
 else {
final List<Field> fields=getFields(tcl);
for (final Field field : fields) if (!Modifier.isStatic(field.getModifiers()) && !Modifier.isTransient(field.getModifiers())) {
field.setAccessible(true);
try {
write(out,field.get(target));
}
 catch (final UnserializableException ex) {
ex.addTarget(target);
throw ex;
}
}
}
}
}

Fixed version (ground truth):
/** 
 * writes an concrete type
 * @param out
 * @param target
 * @param eid
 * @throws IOException
 * @throws IllegalArgumentException
 * @throws IllegalAccessException
 */
private void write(final DataOutputStream out,final Object target,final byte eid) throws IOException, IllegalArgumentException, IllegalAccessException {
switch (eid) {
case nullEid:
case boolTrueEid:
case boolFalseEid:
case pBoolTrueEid:
case pBoolFalseEid:
    break;
case byteEid:
case pByteEid:
  out.writeByte(((Byte)target).byteValue());
break;
case shortEid:
case pShortEid:
out.writeShort(((Short)target).shortValue());
break;
case intEid:
case pIntEid:
out.writeInt(((Integer)target).intValue());
break;
case longEid:
case pLongEid:
out.writeLong(((Long)target).longValue());
break;
case floatEid:
case pFloatEid:
out.writeFloat(((Float)target).floatValue());
break;
case doubleEid:
case pDoubleEid:
out.writeDouble(((Double)target).doubleValue());
break;
case stringEid:
out.writeUTF((String)target);
break;
case pCharEid:
case charEid:
out.writeUTF(String.valueOf(target));
break;
case objEid:
break;
case arrayEid:
final Class<?> compClass=target.getClass().getComponentType();
final byte aeid=getClassEid(compClass);
out.writeByte(aeid);
writeArray(out,target,aeid,compClass);
break;
default :
final Class<?> tcl=target.getClass();
if (tcl.isEnum()) out.writeByte(((Enum<?>)target).ordinal());
 else {
final List<Field> fields=getFields(tcl);
for (final Field field : fields) if (!Modifier.isStatic(field.getModifiers()) && !Modifier.isTransient(field.getModifiers())) {
field.setAccessible(true);
try {
write(out,field.get(target));
}
 catch (final UnserializableException ex) {
ex.addTarget(target);
throw ex;
}
}
}
}
}