You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Registering such a class with Native Types results in an exception:
Exception in thread "main" java.lang.ExceptionInInitializerError
Caused by: java.lang.IllegalArgumentException: Unsupported type for property 'typeParameters' in class java.lang.Class
at dev.cel.extensions.CelNativeTypesExtensions$NativeTypeScanner.validateRegisteredClasses(CelNativeTypesExtensions.java:236)
at dev.cel.extensions.CelNativeTypesExtensions$NativeTypeScanner.scan(CelNativeTypesExtensions.java:221)
at dev.cel.extensions.CelNativeTypesExtensions$NativeTypeScanner.access$000(CelNativeTypesExtensions.java:154)
at dev.cel.extensions.CelNativeTypesExtensions.nativeTypes(CelNativeTypesExtensions.java:131)
at dev.cel.extensions.CelExtensions.nativeTypes(CelExtensions.java:362)
at CELTest.<clinit>(CELTest.java:40)
Caused by: java.lang.IllegalArgumentException: Unsupported interface type: java.lang.reflect.TypeVariable
at dev.cel.extensions.CelNativeTypesExtensions$NativeTypeScanner.mapJavaTypeToCelType(CelNativeTypesExtensions.java:302)
at dev.cel.extensions.CelNativeTypesExtensions$NativeTypeScanner.mapJavaTypeToCelType(CelNativeTypesExtensions.java:296)
at dev.cel.extensions.CelNativeTypesExtensions$NativeTypeScanner.getPropertyType(CelNativeTypesExtensions.java:276)
at dev.cel.extensions.CelNativeTypesExtensions$NativeTypeScanner.validateRegisteredClasses(CelNativeTypesExtensions.java:233)
... 5 more
This happens because CEL tries to introspect the implicit declaringClass property of the Java enum (which resolves to java.lang.Class, which has an interface-typed property typeParameters, which is not supported because of #1061). Perhaps we need to blacklist the standard java.lang.Enum methods the same way we do for java.lang.Object.
Imagine a class with an enum property:
Registering such a class with Native Types results in an exception:
This happens because CEL tries to introspect the implicit
declaringClassproperty of the Java enum (which resolves tojava.lang.Class, which has an interface-typed propertytypeParameters, which is not supported because of #1061). Perhaps we need to blacklist the standardjava.lang.Enummethods the same way we do forjava.lang.Object.