Program: 92179
Project: 92179
Buggy source:
private IDeclaration parseFloat(CommonTree floatingPoint) throws ParseException {
  assert(floatingPoint.getType() == CTFParser.INTEGER);
  List<CommonTree> children=floatingPoint.getChildren();
  if (children == null) {
    throw new ParseException("String_Node_Str");
  }
  FloatDeclaration floatDeclaration=null;
  ByteOrder byteOrder=trace.getByteOrder();
  long alignment=0;
  int exponent=8;
  int mantissa=24;
  for (  CommonTree child : children) {
switch (child.getType()) {
case CTFParser.CTF_EXPRESSION_VAL:
      assert(child.getChildCount() == 2);
    CommonTree leftNode=(CommonTree)child.getChild(0);
  assert(leftNode.getType() == CTFParser.CTF_LEFT);
CommonTree rightNode=(CommonTree)child.getChild(1);
assert(rightNode.getType() == CTFParser.CTF_RIGHT);
List<CommonTree> leftStrings=leftNode.getChildren();
assert(leftStrings != null);
if (!isUnaryString(leftStrings.get(0))) {
throw new ParseException("String_Node_Str");
}
String left=concatenateUnaryStrings(leftStrings);
if (left.equals(CTFStrings.EXP_DIG)) {
exponent=(int)parseUnaryInteger((CommonTree)rightNode.getChild(0));
}
 else if (left.equals(CTFStrings.BYTE_ORDER)) {
byteOrder=getByteOrder(rightNode);
}
 else if (left.equals(CTFStrings.MANT_DIG)) {
mantissa=(int)parseUnaryInteger((CommonTree)rightNode.getChild(0));
}
 else if (left.equals(CTFStrings.ALIGN)) {
alignment=getAlignment(rightNode);
}
 else {
throw new ParseException("String_Node_Str" + left);
}
break;
default :
childTypeError(child);
break;
}
}
int size=mantissa + exponent;
if (size == 0) {
throw new ParseException("String_Node_Str");
}
if (alignment == 0) {
if ((size % 8) == 0) {
alignment=1;
}
 else {
alignment=8;
}
}
floatDeclaration=new FloatDeclaration(exponent,mantissa,byteOrder,alignment);
assert(floatDeclaration != null);
return floatDeclaration;
}

Fixed version (ground truth):
private IDeclaration parseFloat(CommonTree floatingPoint) throws ParseException {
  List<CommonTree> children=floatingPoint.getChildren();
  if (children == null) {
    throw new ParseException("String_Node_Str");
  }
  FloatDeclaration floatDeclaration=null;
  ByteOrder byteOrder=trace.getByteOrder();
  long alignment=0;
  int exponent=8;
  int mantissa=24;
  for (  CommonTree child : children) {
switch (child.getType()) {
case CTFParser.CTF_EXPRESSION_VAL:
      CommonTree leftNode=(CommonTree)child.getChild(0);
    CommonTree rightNode=(CommonTree)child.getChild(1);
  List<CommonTree> leftStrings=leftNode.getChildren();
if (!isUnaryString(leftStrings.get(0))) {
  throw new ParseException("String_Node_Str");
}
String left=concatenateUnaryStrings(leftStrings);
if (left.equals(CTFStrings.EXP_DIG)) {
exponent=(int)parseUnaryInteger((CommonTree)rightNode.getChild(0));
}
 else if (left.equals(CTFStrings.BYTE_ORDER)) {
byteOrder=getByteOrder(rightNode);
}
 else if (left.equals(CTFStrings.MANT_DIG)) {
mantissa=(int)parseUnaryInteger((CommonTree)rightNode.getChild(0));
}
 else if (left.equals(CTFStrings.ALIGN)) {
alignment=getAlignment(rightNode);
}
 else {
throw new ParseException("String_Node_Str" + left);
}
break;
default :
childTypeError(child);
break;
}
}
int size=mantissa + exponent;
if (size == 0) {
throw new ParseException("String_Node_Str");
}
if (alignment == 0) {
if ((size % 8) == 0) {
alignment=1;
}
 else {
alignment=8;
}
}
floatDeclaration=new FloatDeclaration(exponent,mantissa,byteOrder,alignment);
assert(floatDeclaration != null);
return floatDeclaration;
}