in legacy/java/piranha/src/main/java/com/uber/piranha/config/MethodRecord.java [88:116]
static MethodRecord parseFromJSONPropertyEntryMap(
Map<String, Object> methodPropertyEntry, boolean isArgumentIndexOptional)
throws PiranhaConfigurationException {
String methodName = getValueStringFromMap(methodPropertyEntry, METHOD_NAME_KEY);
Integer argumentIndexInteger = getArgumentIndexFromMap(methodPropertyEntry, ARGUMENT_INDEX_KEY);
if (methodName == null) {
throw new PiranhaConfigurationException(
"methodProperty is missing mandatory methodName field. Check:\n" + methodPropertyEntry);
} else if (!isArgumentIndexOptional && argumentIndexInteger == null) {
throw new PiranhaConfigurationException(
"methodProperty did not have argumentIndex. By default, Piranha requires an argument index for flag "
+ "APIs, to which the flag name/symbol will be passed. This is to avoid over-deletion of all "
+ "occurrences of a flag API method. If you are sure you want to delete all instances of the "
+ "method below, consider using Piranha:ArgumentIndexOptional=true to override this behavior. "
+ "Check:\n"
+ methodPropertyEntry);
} else if (argumentIndexInteger != null && argumentIndexInteger < 0) {
throw new PiranhaConfigurationException(
"Invalid argumentIndex field. Arguments are zero indexed. Check:\n"
+ methodPropertyEntry);
}
return new MethodRecord(
methodName,
argumentIndexInteger,
getValueStringFromMap(methodPropertyEntry, RECEIVER_TYPE_STRING),
getValueStringFromMap(methodPropertyEntry, RETURN_TYPE_STRING),
getValueBooleanFromMap(methodPropertyEntry, METHOD_IS_STATIC));
}