Title: Support for Java enums in Native Types · Issue #1077 · cel-expr/cel-java · GitHub
Open Graph Title: Support for Java enums in Native Types · Issue #1077 · cel-expr/cel-java
X Title: Support for Java enums in Native Types · Issue #1077 · cel-expr/cel-java
Description: Imagine a class with an enum property: public class Foo { private Bar bar; public Bar getBar() { return bar; } public void setBar(Bar bar) { this.bar = bar; } } public enum Bar { FOO, BAR } Registering such a class with Native Types resu...
Open Graph Description: Imagine a class with an enum property: public class Foo { private Bar bar; public Bar getBar() { return bar; } public void setBar(Bar bar) { this.bar = bar; } } public enum Bar { FOO, BAR } Registe...
X Description: Imagine a class with an enum property: public class Foo { private Bar bar; public Bar getBar() { return bar; } public void setBar(Bar bar) { this.bar = bar; } } public enum Bar { FOO, BAR } Registe...
Opengraph URL: https://github.com/cel-expr/cel-java/issues/1077
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Support for Java enums in Native Types","articleBody":"Imagine a class with an enum property:\n\n```java\npublic class Foo {\n\n private Bar bar;\n\n public Bar getBar() {\n return bar;\n }\n\n public void setBar(Bar bar) {\n this.bar = bar;\n }\n\n}\n\npublic enum Bar {\n FOO,\n BAR\n}\n```\n\nRegistering such a class with Native Types results in an exception:\n```\nException in thread \"main\" java.lang.ExceptionInInitializerError\nCaused by: java.lang.IllegalArgumentException: Unsupported type for property 'typeParameters' in class java.lang.Class\n\tat dev.cel.extensions.CelNativeTypesExtensions$NativeTypeScanner.validateRegisteredClasses(CelNativeTypesExtensions.java:236)\n\tat dev.cel.extensions.CelNativeTypesExtensions$NativeTypeScanner.scan(CelNativeTypesExtensions.java:221)\n\tat dev.cel.extensions.CelNativeTypesExtensions$NativeTypeScanner.access$000(CelNativeTypesExtensions.java:154)\n\tat dev.cel.extensions.CelNativeTypesExtensions.nativeTypes(CelNativeTypesExtensions.java:131)\n\tat dev.cel.extensions.CelExtensions.nativeTypes(CelExtensions.java:362)\n\tat CELTest.\u003cclinit\u003e(CELTest.java:40)\nCaused by: java.lang.IllegalArgumentException: Unsupported interface type: java.lang.reflect.TypeVariable\n\tat dev.cel.extensions.CelNativeTypesExtensions$NativeTypeScanner.mapJavaTypeToCelType(CelNativeTypesExtensions.java:302)\n\tat dev.cel.extensions.CelNativeTypesExtensions$NativeTypeScanner.mapJavaTypeToCelType(CelNativeTypesExtensions.java:296)\n\tat dev.cel.extensions.CelNativeTypesExtensions$NativeTypeScanner.getPropertyType(CelNativeTypesExtensions.java:276)\n\tat dev.cel.extensions.CelNativeTypesExtensions$NativeTypeScanner.validateRegisteredClasses(CelNativeTypesExtensions.java:233)\n\t... 5 more\n```\n\nThis 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](https://github.com/google/cel-java/blob/7452e0d71bf0c8ddaf806df36cae5423e794745d/extensions/src/main/java/dev/cel/extensions/CelNativeTypesExtensions.java#L606) for `java.lang.Object`.","author":{"url":"https://github.com/dteleguin","@type":"Person","name":"dteleguin"},"datePublished":"2026-06-03T22:10:25.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/1077/cel-java/issues/1077"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e930fa99-c455-f133-c3ae-a6f2bbb774bb |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CC0C:3410C8:18BE:21FC:6A4E1DB7 |
| html-safe-nonce | 107dea5cd016a3739cdf0030a6cdd1c8cebf3896303391ef829cb439f03d78d2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQzBDOjM0MTBDODoxOEJFOjIxRkM6NkE0RTFEQjciLCJ2aXNpdG9yX2lkIjoiNzQ3ODMwODE4MTgyMDQ0ODE4NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b4bfd7dfcd3b30d48ec1da1d2c7bcf87ed5f7c0ebc904e425e01d6aa822034da |
| hovercard-subject-tag | issue:4584037654 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/cel-expr/cel-java/1077/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ecb890357a1fd6338f29222684ba2b6763f0930cac6f608d574746111140324e/cel-expr/cel-java/issues/1077 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ecb890357a1fd6338f29222684ba2b6763f0930cac6f608d574746111140324e/cel-expr/cel-java/issues/1077 |
| og:image:alt | Imagine a class with an enum property: public class Foo { private Bar bar; public Bar getBar() { return bar; } public void setBar(Bar bar) { this.bar = bar; } } public enum Bar { FOO, BAR } Registe... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dteleguin |
| hostname | github.com |
| expected-hostname | github.com |
| None | 030096ee0db095447bfe77409d33bfac127ca7128299c58deef27c52eaa1b1f0 |
| turbo-cache-control | no-preview |
| go-import | github.com/cel-expr/cel-java git https://github.com/cel-expr/cel-java.git |
| octolytics-dimension-user_id | 186625994 |
| octolytics-dimension-user_login | cel-expr |
| octolytics-dimension-repository_id | 587078119 |
| octolytics-dimension-repository_nwo | cel-expr/cel-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 587078119 |
| octolytics-dimension-repository_network_root_nwo | cel-expr/cel-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 5fe497b4815fcce3df76c0e246faa739a82c3124 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width