Program: 79605
Project: 79605
Buggy source:
public static <T>Function<JsonElement,T> cast(final Class<T> expected){
  return new Function<JsonElement,T>(){
    @Override public T apply(    JsonElement input){
      if (input == null) {
        return (T)null;
      }
 else       if (input.isJsonNull()) {
        return (T)null;
      }
 else       if (expected == boolean.class || expected == Boolean.class) {
        return (T)(Boolean)input.getAsBoolean();
      }
 else       if (expected == char.class || expected == Character.class) {
        return (T)(Character)input.getAsCharacter();
      }
 else       if (expected == byte.class || expected == Byte.class) {
        return (T)(Byte)input.getAsByte();
      }
 else       if (expected == short.class || expected == Short.class) {
        return (T)(Short)input.getAsShort();
      }
 else       if (expected == int.class || expected == Integer.class) {
        return (T)(Integer)input.getAsInt();
      }
 else       if (expected == long.class || expected == Long.class) {
        return (T)(Long)input.getAsLong();
      }
 else       if (expected == float.class || expected == Float.class) {
        return (T)(Float)input.getAsFloat();
      }
 else       if (expected == double.class || expected == Double.class) {
        return (T)(Double)input.getAsDouble();
      }
 else       if (expected == BigDecimal.class) {
        return (T)input.getAsBigDecimal();
      }
 else       if (expected == BigInteger.class) {
        return (T)input.getAsBigInteger();
      }
 else       if (Number.class.isAssignableFrom(expected)) {
        return (T)input.getAsNumber();
      }
 else       if (expected == String.class) {
        return (T)input.getAsString();
      }
 else       if (expected.isArray()) {
        JsonArray array=input.getAsJsonArray();
        Class<?> componentType=expected.getComponentType();
        if (JsonElement.class.isAssignableFrom(componentType)) {
          JsonElement[] result=new JsonElement[array.size()];
          for (int i=0; i < array.size(); i++) {
            result[i]=array.get(i);
          }
          return (T)result;
        }
 else {
          Object[] result=(Object[])Array.newInstance(componentType,array.size());
          for (int i=0; i < array.size(); i++) {
            result[i]=cast(componentType).apply(array.get(i));
          }
          return (T)result;
        }
      }
 else {
        throw new IllegalArgumentException("String_Node_Str" + expected);
      }
    }
  }
;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public static <T>Function<JsonElement,T> cast(final Class<T> expected){
  return new Function<JsonElement,T>(){
    @Override public T apply(    JsonElement input){
      if (input == null) {
        return (T)null;
      }
 else       if (input.isJsonNull()) {
        return (T)null;
      }
 else       if (expected == boolean.class || expected == Boolean.class) {
        return (T)(Boolean)input.getAsBoolean();
      }
 else       if (expected == char.class || expected == Character.class) {
        return (T)(Character)input.getAsCharacter();
      }
 else       if (expected == byte.class || expected == Byte.class) {
        return (T)(Byte)input.getAsByte();
      }
 else       if (expected == short.class || expected == Short.class) {
        return (T)(Short)input.getAsShort();
      }
 else       if (expected == int.class || expected == Integer.class) {
        return (T)(Integer)input.getAsInt();
      }
 else       if (expected == long.class || expected == Long.class) {
        return (T)(Long)input.getAsLong();
      }
 else       if (expected == float.class || expected == Float.class) {
        return (T)(Float)input.getAsFloat();
      }
 else       if (expected == double.class || expected == Double.class) {
        return (T)(Double)input.getAsDouble();
      }
 else       if (expected == BigDecimal.class) {
        return (T)input.getAsBigDecimal();
      }
 else       if (expected == BigInteger.class) {
        return (T)input.getAsBigInteger();
      }
 else       if (Number.class.isAssignableFrom(expected)) {
        return (T)input.getAsNumber();
      }
 else       if (expected == String.class) {
        return (T)input.getAsString();
      }
 else       if (expected.isArray()) {
        JsonArray array=input.getAsJsonArray();
        Class<?> componentType=expected.getComponentType();
        if (JsonElement.class.isAssignableFrom(componentType)) {
          JsonElement[] result=new JsonElement[array.size()];
          for (int i=0; i < array.size(); i++) {
            result[i]=array.get(i);
          }
          return (T)result;
        }
 else {
          Object[] result=(Object[])Array.newInstance(componentType,array.size());
          for (int i=0; i < array.size(); i++) {
            result[i]=cast(componentType).apply(array.get(i));
          }
          return (T)result;
        }
      }
 else {
        throw new IllegalArgumentException("String_Node_Str" + expected);
      }
    }
  }
;
}