Program: 9318
Project: 9318
Buggy source:
private TypeBinding makeTypeBinding1(TypeX typeX){
  if (typeX.isPrimitive()) {
    if (typeX == ResolvedTypeX.BOOLEAN)     return BaseTypes.BooleanBinding;
    if (typeX == ResolvedTypeX.BYTE)     return BaseTypes.ByteBinding;
    if (typeX == ResolvedTypeX.CHAR)     return BaseTypes.CharBinding;
    if (typeX == ResolvedTypeX.DOUBLE)     return BaseTypes.DoubleBinding;
    if (typeX == ResolvedTypeX.FLOAT)     return BaseTypes.FloatBinding;
    if (typeX == ResolvedTypeX.INT)     return BaseTypes.IntBinding;
    if (typeX == ResolvedTypeX.LONG)     return BaseTypes.LongBinding;
    if (typeX == ResolvedTypeX.SHORT)     return BaseTypes.ShortBinding;
    if (typeX == ResolvedTypeX.VOID)     return BaseTypes.VoidBinding;
    throw new RuntimeException("String_Node_Str" + typeX);
  }
 else   if (typeX.isArray()) {
    int dim=0;
    while (typeX.isArray()) {
      dim++;
      typeX=typeX.getComponentType();
    }
    return lookupEnvironment.createArrayType(makeTypeBinding(typeX),dim);
  }
 else   if (typeX.isParameterized()) {
    if (typeX.isRawType()) {
      ReferenceBinding baseTypeBinding=lookupBinding(typeX.getBaseName());
      RawTypeBinding rtb=lookupEnvironment.createRawType(baseTypeBinding,baseTypeBinding.enclosingType());
      return rtb;
    }
 else {
      TypeX[] typeParameters=typeX.getTypeParameters();
      ReferenceBinding baseTypeBinding=lookupBinding(typeX.getBaseName());
      ReferenceBinding[] argumentBindings=new ReferenceBinding[typeParameters.length];
      for (int i=0; i < argumentBindings.length; i++) {
        argumentBindings[i]=lookupBinding(typeParameters[i].getName());
      }
      ParameterizedTypeBinding ptb=lookupEnvironment.createParameterizedType(baseTypeBinding,argumentBindings,baseTypeBinding.enclosingType());
      return ptb;
    }
  }
 else {
    return lookupBinding(typeX.getName());
  }
}

Fixed version (ground truth):
private TypeBinding makeTypeBinding1(TypeX typeX){
  if (typeX.isPrimitive()) {
    if (typeX == ResolvedTypeX.BOOLEAN)     return BaseTypes.BooleanBinding;
    if (typeX == ResolvedTypeX.BYTE)     return BaseTypes.ByteBinding;
    if (typeX == ResolvedTypeX.CHAR)     return BaseTypes.CharBinding;
    if (typeX == ResolvedTypeX.DOUBLE)     return BaseTypes.DoubleBinding;
    if (typeX == ResolvedTypeX.FLOAT)     return BaseTypes.FloatBinding;
    if (typeX == ResolvedTypeX.INT)     return BaseTypes.IntBinding;
    if (typeX == ResolvedTypeX.LONG)     return BaseTypes.LongBinding;
    if (typeX == ResolvedTypeX.SHORT)     return BaseTypes.ShortBinding;
    if (typeX == ResolvedTypeX.VOID)     return BaseTypes.VoidBinding;
    throw new RuntimeException("String_Node_Str" + typeX);
  }
 else   if (typeX.isArray()) {
    int dim=0;
    while (typeX.isArray()) {
      dim++;
      typeX=typeX.getComponentType();
    }
    return lookupEnvironment.createArrayType(makeTypeBinding(typeX),dim);
  }
 else   if (typeX.isParameterized()) {
    if (typeX.isRawType()) {
      ReferenceBinding baseTypeBinding=lookupBinding(typeX.getBaseName());
      RawTypeBinding rtb=lookupEnvironment.createRawType(baseTypeBinding,baseTypeBinding.enclosingType());
      return rtb;
    }
 else {
      TypeX[] typeParameters=typeX.getTypeParameters();
      ReferenceBinding baseTypeBinding=lookupBinding(typeX.getBaseName());
      TypeBinding[] argumentBindings=new TypeBinding[typeParameters.length];
      for (int i=0; i < argumentBindings.length; i++) {
        argumentBindings[i]=makeTypeBinding(typeParameters[i]);
      }
      ParameterizedTypeBinding ptb=lookupEnvironment.createParameterizedType(baseTypeBinding,argumentBindings,baseTypeBinding.enclosingType());
      return ptb;
    }
  }
 else {
    return lookupBinding(typeX.getName());
  }
}