private MethodHandler processAutomaticSubtypeMethod(Method m)
throws JsonProtocolModelParseException {
MethodHandler methodHandler;
if (m.getReturnType() == Void.TYPE) {
if (autoAlgCasesData.hasDefaultCase) {
throw new JsonProtocolModelParseException("Duplicate default case method: " + m);
}
autoAlgCasesData.hasDefaultCase = true;
methodHandler = RETURN_NULL_METHOD_HANDLER;
} else {
Class<?> methodType = m.getReturnType();
RefToType<?> ref = getTypeRef(methodType);
if (ref == null) {
throw new JsonProtocolModelParseException("Unknown return type in " + m);
}
if (autoAlgCasesData.variantCodeFieldPos == -1) {
autoAlgCasesData.variantCodeFieldPos = allocateFieldInArray();
autoAlgCasesData.variantValueFieldPos = allocateFieldInArray();
}