Program: 42999
Project: 42999
Buggy source:
public GetField readFields() throws IOException, ClassNotFoundException {
  if (!state.compareAndSet(State.UNREAD_FIELDS,State.ON)) {
    throw new NotActiveException("String_Node_Str");
  }
  final SerializableField[] streamFields=serializableClassDescriptor.getFields();
  final int cnt=streamFields.length;
  final ReadField[] readFields=new ReadField[cnt];
  for (int i=0; i < cnt; i++) {
    SerializableField field=streamFields[i];
    try {
switch (field.getKind()) {
case BOOLEAN:
{
          readFields[i]=new BooleanReadField(field,unmarshaller.readBoolean());
          break;
        }
case BYTE:
{
        readFields[i]=new ByteReadField(field,unmarshaller.readByte());
        break;
      }
case CHAR:
{
      readFields[i]=new CharReadField(field,unmarshaller.readChar());
      break;
    }
case DOUBLE:
{
    readFields[i]=new DoubleReadField(field,unmarshaller.readDouble());
    break;
  }
case FLOAT:
{
  readFields[i]=new FloatReadField(field,unmarshaller.readFloat());
  break;
}
case INT:
{
readFields[i]=new IntReadField(field,unmarshaller.readInt());
break;
}
case LONG:
{
readFields[i]=new LongReadField(field,unmarshaller.readLong());
break;
}
case OBJECT:
{
readFields[i]=new ObjectReadField(field,unmarshaller.readObject());
break;
}
case SHORT:
{
readFields[i]=new ShortReadField(field,unmarshaller.readShort());
break;
}
default :
throw new IllegalStateException("String_Node_Str");
}
}
 catch (IOException e) {
TraceInformation.addFieldInformation(e,field.getName());
throw e;
}
catch (ClassNotFoundException e) {
TraceInformation.addFieldInformation(e,field.getName());
throw e;
}
catch (RuntimeException e) {
TraceInformation.addFieldInformation(e,field.getName());
throw e;
}
}
return new GetField(){
public ObjectStreamClass getObjectStreamClass(){
throw new UnsupportedOperationException("String_Node_Str");
}
private ReadField find(final String name){
if (name == null) {
throw new NullPointerException("String_Node_Str");
}
for (ReadField field : readFields) {
if (name.equals(field.getName())) {
return field;
}
}
throw new IllegalArgumentException("String_Node_Str" + name + "String_Node_Str");
}
public boolean defaulted(final String name) throws IOException {
return find(name).isDefaulted();
}
public boolean get(final String name,final boolean val) throws IOException {
final ReadField field=find(name);
return field.isDefaulted() ? val : field.getBoolean();
}
public byte get(final String name,final byte val) throws IOException {
final ReadField field=find(name);
return field.isDefaulted() ? val : field.getByte();
}
public char get(final String name,final char val) throws IOException {
final ReadField field=find(name);
return field.isDefaulted() ? val : field.getChar();
}
public short get(final String name,final short val) throws IOException {
final ReadField field=find(name);
return field.isDefaulted() ? val : field.getShort();
}
public int get(final String name,final int val) throws IOException {
final ReadField field=find(name);
return field.isDefaulted() ? val : field.getInt();
}
public long get(final String name,final long val) throws IOException {
final ReadField field=find(name);
return field.isDefaulted() ? val : field.getLong();
}
public float get(final String name,final float val) throws IOException {
final ReadField field=find(name);
return field.isDefaulted() ? val : field.getFloat();
}
public double get(final String name,final double val) throws IOException {
final ReadField field=find(name);
return field.isDefaulted() ? val : field.getDouble();
}
public Object get(final String name,final Object val) throws IOException {
final ReadField field=find(name);
return field.isDefaulted() ? val : field.getObject();
}
}
;
}

Fixed version (ground truth):
public GetField readFields() throws IOException, ClassNotFoundException {
  State old=state.getAndSet(State.ON);
switch (old) {
case UNREAD_FIELDS:
case UNREAD_FIELDS_EOB:
    break;
default :
  throw new NotActiveException("String_Node_Str");
}
final SerializableField[] streamFields=serializableClassDescriptor.getFields();
final int cnt=streamFields.length;
final ReadField[] readFields=new ReadField[cnt];
for (int i=0; i < cnt; i++) {
SerializableField field=streamFields[i];
try {
switch (field.getKind()) {
case BOOLEAN:
{
      readFields[i]=new BooleanReadField(field,unmarshaller.readBoolean());
      break;
    }
case BYTE:
{
    readFields[i]=new ByteReadField(field,unmarshaller.readByte());
    break;
  }
case CHAR:
{
  readFields[i]=new CharReadField(field,unmarshaller.readChar());
  break;
}
case DOUBLE:
{
readFields[i]=new DoubleReadField(field,unmarshaller.readDouble());
break;
}
case FLOAT:
{
readFields[i]=new FloatReadField(field,unmarshaller.readFloat());
break;
}
case INT:
{
readFields[i]=new IntReadField(field,unmarshaller.readInt());
break;
}
case LONG:
{
readFields[i]=new LongReadField(field,unmarshaller.readLong());
break;
}
case OBJECT:
{
readFields[i]=new ObjectReadField(field,unmarshaller.readObject());
break;
}
case SHORT:
{
readFields[i]=new ShortReadField(field,unmarshaller.readShort());
break;
}
default :
throw new IllegalStateException("String_Node_Str");
}
}
 catch (IOException e) {
TraceInformation.addFieldInformation(e,field.getName());
throw e;
}
catch (ClassNotFoundException e) {
TraceInformation.addFieldInformation(e,field.getName());
throw e;
}
catch (RuntimeException e) {
TraceInformation.addFieldInformation(e,field.getName());
throw e;
}
}
if (old == State.UNREAD_FIELDS_EOB) {
restoreIdx=blockUnmarshaller.tempEndOfStream();
}
return new GetField(){
public ObjectStreamClass getObjectStreamClass(){
throw new UnsupportedOperationException("String_Node_Str");
}
private ReadField find(final String name){
if (name == null) {
throw new NullPointerException("String_Node_Str");
}
for (ReadField field : readFields) {
if (name.equals(field.getName())) {
return field;
}
}
throw new IllegalArgumentException("String_Node_Str" + name + "String_Node_Str");
}
public boolean defaulted(final String name) throws IOException {
return find(name).isDefaulted();
}
public boolean get(final String name,final boolean val) throws IOException {
final ReadField field=find(name);
return field.isDefaulted() ? val : field.getBoolean();
}
public byte get(final String name,final byte val) throws IOException {
final ReadField field=find(name);
return field.isDefaulted() ? val : field.getByte();
}
public char get(final String name,final char val) throws IOException {
final ReadField field=find(name);
return field.isDefaulted() ? val : field.getChar();
}
public short get(final String name,final short val) throws IOException {
final ReadField field=find(name);
return field.isDefaulted() ? val : field.getShort();
}
public int get(final String name,final int val) throws IOException {
final ReadField field=find(name);
return field.isDefaulted() ? val : field.getInt();
}
public long get(final String name,final long val) throws IOException {
final ReadField field=find(name);
return field.isDefaulted() ? val : field.getLong();
}
public float get(final String name,final float val) throws IOException {
final ReadField field=find(name);
return field.isDefaulted() ? val : field.getFloat();
}
public double get(final String name,final double val) throws IOException {
final ReadField field=find(name);
return field.isDefaulted() ? val : field.getDouble();
}
public Object get(final String name,final Object val) throws IOException {
final ReadField field=find(name);
return field.isDefaulted() ? val : field.getObject();
}
}
;
}