Program: 29371
Project: 29371
Buggy source:
/** 
 * Outputs bytecode that unboxes the current top element of the stack as   {@code asType}. Top of stack must not be null. <p>Always prefer using   {@link SoyExpression#unboxAs} over this method, whenever possible.<p>Guarantees: * Bytecode output will not change stack height * Output will only change the top element, and nothing below that
 * @return the type of the result of the unbox operation
 */
static Type unboxUnchecked(CodeBuilder cb,SoyRuntimeType soyType,Class<?> asType){
  checkArgument(soyType.isBoxed(),"String_Node_Str",soyType);
  Type fromType=soyType.runtimeType();
  checkArgument(!SoyValue.class.isAssignableFrom(asType),"String_Node_Str",fromType,asType);
  if (isDefinitelyAssignableFrom(Type.getType(asType),fromType)) {
    return fromType;
  }
  if (asType.equals(boolean.class)) {
    MethodRef.SOY_VALUE_BOOLEAN_VALUE.invokeUnchecked(cb);
    return Type.BOOLEAN_TYPE;
  }
  if (asType.equals(long.class)) {
    MethodRef.SOY_VALUE_LONG_VALUE.invokeUnchecked(cb);
    return Type.LONG_TYPE;
  }
  if (asType.equals(double.class)) {
    MethodRef.SOY_VALUE_FLOAT_VALUE.invokeUnchecked(cb);
    return Type.DOUBLE_TYPE;
  }
  if (asType.equals(String.class)) {
    MethodRef.SOY_VALUE_STRING_VALUE.invokeUnchecked(cb);
    return STRING_TYPE;
  }
  if (asType.equals(List.class)) {
    cb.checkCast(SOY_LIST_TYPE);
    MethodRef.SOY_LIST_AS_JAVA_LIST.invokeUnchecked(cb);
    return LIST_TYPE;
  }
  if (asType.equals(Message.class)) {
    if (!isDefinitelyAssignableFrom(SOY_PROTO_VALUE_TYPE,fromType)) {
      cb.checkCast(SOY_PROTO_VALUE_TYPE);
    }
    MethodRef.SOY_PROTO_VALUE_GET_PROTO.invokeUnchecked(cb);
    return MESSAGE_TYPE;
  }
  throw new UnsupportedOperationException("String_Node_Str" + fromType + "String_Node_Str"+ asType);
}

Fixed version (ground truth):
/** 
 * Outputs bytecode that unboxes the current top element of the stack as   {@code asType}. Top of stack must not be null. <p>Always prefer using   {@link SoyExpression#unboxAs} over this method, whenever possible.<p>Guarantees: * Bytecode output will not change stack height * Output will only change the top element, and nothing below that
 * @return the type of the result of the unbox operation
 */
static Type unboxUnchecked(CodeBuilder cb,SoyRuntimeType soyType,Class<?> asType){
  checkArgument(soyType.isBoxed(),"String_Node_Str",soyType);
  Type fromType=soyType.runtimeType();
  checkArgument(!SoyValue.class.isAssignableFrom(asType),"String_Node_Str",fromType,asType);
  if (isDefinitelyAssignableFrom(Type.getType(asType),fromType)) {
    return fromType;
  }
  if (asType.equals(boolean.class)) {
    MethodRef.SOY_VALUE_BOOLEAN_VALUE.invokeUnchecked(cb);
    return Type.BOOLEAN_TYPE;
  }
  if (asType.equals(long.class)) {
    MethodRef.SOY_VALUE_LONG_VALUE.invokeUnchecked(cb);
    return Type.LONG_TYPE;
  }
  if (asType.equals(double.class)) {
    MethodRef.SOY_VALUE_FLOAT_VALUE.invokeUnchecked(cb);
    return Type.DOUBLE_TYPE;
  }
  if (asType.equals(String.class)) {
    MethodRef.SOY_VALUE_STRING_VALUE.invokeUnchecked(cb);
    return STRING_TYPE;
  }
  if (asType.equals(List.class)) {
    cb.checkCast(SOY_LIST_TYPE);
    MethodRef.SOY_LIST_AS_JAVA_LIST.invokeUnchecked(cb);
    return LIST_TYPE;
  }
  if (asType.equals(Message.class)) {
    if (!isDefinitelyAssignableFrom(SOY_PROTO_VALUE_IMPL_TYPE,fromType)) {
      cb.checkCast(SOY_PROTO_VALUE_IMPL_TYPE);
    }
    MethodRef.SOY_PROTO_VALUE_GET_PROTO.invokeUnchecked(cb);
    return MESSAGE_TYPE;
  }
  throw new UnsupportedOperationException("String_Node_Str" + fromType + "String_Node_Str"+ asType);
}