Program: 117515
Project: 117515
Buggy source:
@Override public Tuple apply(final Tuple t){
  if (LOG.isDebugEnabled())   LOG.debug("String_Node_Str" + t);
  Result result;
  try {
    PigNullableWritable key=new PigNullableWritable(){
      public Object getValueAsPigType(){
        try {
          Object keyTuple=t.get(0);
          return keyTuple;
        }
 catch (        ExecException e) {
          throw new RuntimeException(e);
        }
      }
    }
;
    final Iterator<Tuple> bagIterator=(Iterator<Tuple>)t.get(1);
    Iterator<NullableTuple> iterator=new Iterator<NullableTuple>(){
      public boolean hasNext(){
        return bagIterator.hasNext();
      }
      public NullableTuple next(){
        try {
          Tuple next=bagIterator.next();
          NullableTuple nullableTuple=new NullableTuple((Tuple)next.get(2));
          nullableTuple.setIndex(((Number)next.get(0)).byteValue());
          return nullableTuple;
        }
 catch (        ExecException e) {
          throw new RuntimeException(e);
        }
      }
      public void remove(){
        throw new UnsupportedOperationException();
      }
    }
;
    physicalOperator.setInputs(null);
    physicalOperator.attachInput(key,iterator);
    result=physicalOperator.getNextTuple();
  }
 catch (  ExecException e) {
    throw new RuntimeException("String_Node_Str" + t,e);
  }
  if (result == null) {
    throw new RuntimeException("String_Node_Str" + t);
  }
  Tuple out;
switch (result.returnStatus) {
case POStatus.STATUS_OK:
    if (LOG.isDebugEnabled())     LOG.debug("String_Node_Str" + result.result);
  out=(Tuple)result.result;
break;
case POStatus.STATUS_NULL:
out=null;
break;
default :
throw new RuntimeException("String_Node_Str" + physicalOperator + "String_Node_Str"+ result+ "String_Node_Str"+ result.returnStatus);
}
if (LOG.isDebugEnabled()) LOG.debug("String_Node_Str" + out);
return out;
}

Fixed version (ground truth):
@Override public Tuple apply(final Tuple t){
  Result result;
  try {
    PigNullableWritable key=new PigNullableWritable(){
      public Object getValueAsPigType(){
        try {
          Object keyTuple=t.get(0);
          return keyTuple;
        }
 catch (        ExecException e) {
          throw new RuntimeException(e);
        }
      }
    }
;
    final Iterator<Tuple> bagIterator=(Iterator<Tuple>)t.get(1);
    Iterator<NullableTuple> iterator=new Iterator<NullableTuple>(){
      public boolean hasNext(){
        return bagIterator.hasNext();
      }
      public NullableTuple next(){
        try {
          Tuple next=bagIterator.next();
          NullableTuple nullableTuple=new NullableTuple((Tuple)next.get(2));
          nullableTuple.setIndex(((Number)next.get(0)).byteValue());
          return nullableTuple;
        }
 catch (        ExecException e) {
          throw new RuntimeException(e);
        }
      }
      public void remove(){
        throw new UnsupportedOperationException();
      }
    }
;
    physicalOperator.setInputs(null);
    physicalOperator.attachInput(key,iterator);
    result=physicalOperator.getNextTuple();
  }
 catch (  ExecException e) {
    throw new RuntimeException("String_Node_Str" + t,e);
  }
  if (result == null) {
    throw new RuntimeException("String_Node_Str" + t);
  }
  Tuple out;
switch (result.returnStatus) {
case POStatus.STATUS_OK:
    out=(Tuple)result.result;
  break;
case POStatus.STATUS_NULL:
out=null;
break;
default :
throw new RuntimeException("String_Node_Str" + physicalOperator + "String_Node_Str"+ result+ "String_Node_Str"+ result.returnStatus);
}
return out;
}