Source:
private Parser(String functionName, Method method, Optional<Constructor<?>> constructor) { this.functionName = requireNonNull(functionName, "functionName is null"); this.nullable = method.getAnnotation(SqlNullable.class) != null; checkArgument(nullable || !containsLegacyNullable(method.getAnnotations()), "Method [%s] is annotated with @Nullable but not @SqlNullable", method); Stream.of(method.getAnnotationsByType(TypeParameter.class)) .forEach(typeParameters::add); literalParameters = parseLiteralParameters(method); typeParameterNames = typeParameters.stream() .map(TypeParameter::value) .collect(toImmutableSet()); SqlType returnType = method.getAnnotation(SqlType.class); checkArgument(returnType != null, format("Method [%s] is missing @SqlType annotation", method)); this.returnType = parseTypeSignature(returnType.value(), literalParameters); Class<?> actualReturnType = method.getReturnType(); if (Primitives.isWrapperType(actualReturnType)) { checkArgument(nullable, "Method [%s] has wrapper return type %s but is missing @SqlNullable", method, actualReturnType.getSimpleName()); } else if (actualReturnType.isPrimitive()) { checkArgument(!nullable, "Method [%s] annotated with @SqlNullable has primitive return type %s", method, actualReturnType.getSimpleName()); } longVariableConstraints = parseLongVariableConstraints(method); this.specializedTypeParameters = getDeclaredSpecializedTypeParameters(method, typeParameters); for (TypeParameter typeParameter : typeParameters) { checkArgument( typeParameter.value().matches("[A-Z][A-Z0-9]*"), "Expected type parameter to only contain A-Z and 0-9 (starting with A-Z), but got %s on method [%s]", typeParameter.value(), method); } inferSpecialization(method, actualReturnType, returnType, nullable); parseArguments(method); this.constructorMethodHandle = getConstructor(method, constructor); this.methodHandle = getMethodHandle(method); ParametricScalarImplementationChoice choice = new ParametricScalarImplementationChoice(nullable, argumentProperties, methodHandle, constructorMethodHandle, specializedTypeParameters, argumentNativeContainerTypes); choices.add(choice); }

Target:
private Parser(String functionName, Method method, Optional<Constructor<?>> constructor) { this.functionName = requireNonNull(functionName, "functionName is null"); this.nullable = method.getAnnotation(SqlNullable.class) != null; checkArgument(nullable || !containsLegacyNullable(method.getAnnotations()), "Method [%s] is annotated with @Nullable but not @SqlNullable", method); typeParameters.addAll(Arrays.asList(method.getAnnotationsByType(TypeParameter.class))); literalParameters = parseLiteralParameters(method); typeParameterNames = typeParameters.stream() .map(TypeParameter::value) .collect(toImmutableSet()); SqlType returnType = method.getAnnotation(SqlType.class); checkArgument(returnType != null, format("Method [%s] is missing @SqlType annotation", method)); this.returnType = parseTypeSignature(returnType.value(), literalParameters); Class<?> actualReturnType = method.getReturnType(); this.returnNativeContainerType = Primitives.unwrap(actualReturnType); if (Primitives.isWrapperType(actualReturnType)) { checkArgument(nullable, "Method [%s] has wrapper return type %s but is missing @SqlNullable", method, actualReturnType.getSimpleName()); } else if (actualReturnType.isPrimitive()) { checkArgument(!nullable, "Method [%s] annotated with @SqlNullable has primitive return type %s", method, actualReturnType.getSimpleName()); } longVariableConstraints = parseLongVariableConstraints(method); this.specializedTypeParameters = getDeclaredSpecializedTypeParameters(method, typeParameters); for (TypeParameter typeParameter : typeParameters) { checkArgument( typeParameter.value().matches("[A-Z][A-Z0-9]*"), "Expected type parameter to only contain A-Z and 0-9 (starting with A-Z), but got %s on method [%s]", typeParameter.value(), method); } inferSpecialization(method, actualReturnType, returnType.value(), nullable); parseArguments(method); this.constructorMethodHandle = getConstructor(method, constructor); this.methodHandle = getMethodHandle(method); ParametricScalarImplementationChoice choice = new ParametricScalarImplementationChoice(nullable, argumentProperties, methodHandle, constructorMethodHandle, dependencies, constructorDependencies); choices.add(choice); }