Add test and fix type inspection for scanned functions
Fixes gh-73
This commit is contained in:
@@ -409,8 +409,18 @@ public class ContextFunctionCatalogAutoConfiguration {
|
||||
}
|
||||
else if (source instanceof FileSystemResource) {
|
||||
try {
|
||||
Type type = ClassUtils.forName(definition.getBeanClassName(), null);
|
||||
param = extractType(type, paramType, index);
|
||||
Class<?> beanType = ClassUtils.forName(definition.getBeanClassName(),
|
||||
null);
|
||||
for (Type type : beanType.getGenericInterfaces()) {
|
||||
if (type.getTypeName().startsWith("java.util.function")) {
|
||||
param = extractType(type, paramType, index);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (param == null) {
|
||||
// Last chance
|
||||
param = beanType;
|
||||
}
|
||||
}
|
||||
catch (ClassNotFoundException e) {
|
||||
throw new IllegalStateException(
|
||||
|
||||
Reference in New Issue
Block a user