Project: mule
Issue MULE-9290: Extensions fail to build if parameter has a wildcard generic
Consider an extension with a parameter like this: {code:java} @Parameter private ObjectStore timeObjectStore; {code} Building such a extension results on the following error: {code} [ERROR] diagnostic: error: Can't get qualifier for a null class java.lang.IllegalArgumentException: Can't get qualifier for a null class org.mule.extension.api.introspection.DataQualifierFactory.getQualifier(DataQualifierFactory.java:176) org.mule.extension.api.introspection.DataType.of(DataType.java:86) org.mule.extension.api.introspection.DataType.of(DataType.java:38) org.mule.extension.api.introspection.DataType.of(DataType.java:62) org.mule.module.extension.internal.util.IntrospectionUtils.toDataType(IntrospectionUtils.java:172) org.mule.module.extension.internal.util.IntrospectionUtils.getFieldDataType(IntrospectionUtils.java:118) org.mule.module.extension.internal.introspection.AnnotationsBasedDescriber.declareSingleParameters(AnnotationsBasedDescriber.java:223) org.mule.module.extension.internal.introspection.AnnotationsBasedDescriber.declareAnnotatedParameters(AnnotationsBasedDescriber.java:168) org.mule.module.extension.internal.introspection.AnnotationsBasedDescriber.declareConfiguration(AnnotationsBasedDescriber.java:163) org.mule.module.extension.internal.introspection.AnnotationsBasedDescriber.declareConfigurations(AnnotationsBasedDescriber.java:140) org.mule.module.extension.internal.introspection.AnnotationsBasedDescriber.describe(AnnotationsBasedDescriber.java:116) {code} The problem is that because the generic is a wildcard, the ResolveableType obtained by IntrospectionUtils.getFieldDataType() returns a null rawClass. As a result, the generated DataType points to a null class which in turn causes a NPE when an attempt is made to obtain a qualifier. The SDK should: * Ignore a type's generics one they contain at least one wildcard (consider cases like Map * Log a warning when it founds a wildcard generic * Also verify this behaviour for the case of operations in which the parameters are obtained from method arguments instead of fields
Story points: 5