Title: Field use triggers RuntimeException · Issue #238 · liquid-java/liquidjava · GitHub
Open Graph Title: Field use triggers RuntimeException · Issue #238 · liquid-java/liquidjava
X Title: Field use triggers RuntimeException · Issue #238 · liquid-java/liquidjava
Description: Description Runtime exception in the next case. Minimal reproducer Client: public class ByteBufTest { public static final int TEST_BUFFER_SIZE = 128; private ByteBuffer mDirectBuffer; public ByteBufTest() { mDirectBuffer = ByteBuffer.all...
Open Graph Description: Description Runtime exception in the next case. Minimal reproducer Client: public class ByteBufTest { public static final int TEST_BUFFER_SIZE = 128; private ByteBuffer mDirectBuffer; public ByteBu...
X Description: Description Runtime exception in the next case. Minimal reproducer Client: public class ByteBufTest { public static final int TEST_BUFFER_SIZE = 128; private ByteBuffer mDirectBuffer; public ByteBu...
Opengraph URL: https://github.com/liquid-java/liquidjava/issues/238
X: @github
Domain: Github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Field use triggers RuntimeException","articleBody":"**Description**\nRuntime exception in the next case.\n\n**Minimal reproducer**\nClient:\n```java\npublic class ByteBufTest {\n\n public static final int TEST_BUFFER_SIZE = 128;\n\n private ByteBuffer mDirectBuffer;\n\n public ByteBufTest() {\n mDirectBuffer = ByteBuffer.allocateDirect(TEST_BUFFER_SIZE);\n byte[] buf = mDirectBuffer.array();\n }\n}\n```\nRefinements:\n```java\n@Ghost(\"boolean arrayBacked\")\n@ExternalRefinementsFor(\"java.nio.ByteBuffer\")\npublic interface ByteBufferRefinements {\n\n // ---- Backing array access ----\n\n @StateRefinement(to=\"_ ? arrayBacked() : !arrayBacked()\")\n boolean hasArray();\n\n @StateRefinement(from=\"arrayBacked()\")\n byte[] array();\n\n @StateRefinement(from=\"arrayBacked()\")\n int arrayOffset();\n}\n```\n\n**Expected behavior**\nNot RuntimeException. Also within the method we shuold be able to know the state of the object even if it is a field if that state is introduced in this scope.\n\n**Actual behavior**\nStackTrace:\n```\njava.lang.RuntimeException: \nError while checking CtConstructorImpl\n on ByteBufTest() { \n at /Users/cgamboa/git/task-examples/liquidjava-tasks/src/main/java/com/example/so_clients/bytebuffer48582520/ByteBufTest.java:14\n with \nError while checking CtBlockImpl\n on { \n at /Users/cgamboa/git/task-examples/liquidjava-tasks/src/main/java/com/example/so_clients/bytebuffer48582520/ByteBufTest.java:14\n with \nError while checking CtLocalVariableImpl\n on buf = mDirectBuffer.array(); \n at /Users/cgamboa/git/task-examples/liquidjava-tasks/src/main/java/com/example/so_clients/bytebuffer48582520/ByteBufTest.java:20\n with \nError while checking CtInvocationImpl\n on mDirectBuffer.array(); \n at /Users/cgamboa/git/task-examples/liquidjava-tasks/src/main/java/com/example/so_clients/bytebuffer48582520/ByteBufTest.java:20\n with Cannot invoke \"liquidjava.processor.context.RefinedVariable.getType()\" because \"var\" is null\n at liquidjava.processor.refinement_checker.TypeChecker.scan (TypeChecker.java:78)\n at spoon.reflect.visitor.CtScanner.scan (CtScanner.java:184)\n\n```\n\n**Environment**\n- LiquidJava version / commit: verifier 0.0.26, #237 \n- Java version (`java -version`):\n- OS:\n","author":{"url":"https://github.com/CatarinaGamboa","@type":"Person","name":"CatarinaGamboa"},"datePublished":"2026-06-02T10:13:51.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/238/liquidjava/issues/238"}
| 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:a7091d95-d81e-5c6e-edff-5713c2028a99 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9AF0:2A8290:6EFC3D:91C49B:6A62A2C2 |
| html-safe-nonce | bdd6b9959e1ed662b6c7f4464feeb134763650bf42d5ea8e771ad6eecb4c118d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QUYwOjJBODI5MDo2RUZDM0Q6OTFDNDlCOjZBNjJBMkMyIiwidmlzaXRvcl9pZCI6IjU0NDQxMzk4OTI5NDI3NDIyMTAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f5845b06ff0068ff5c18edb605de644e4e3c38d6f57467c928000e38d117be4c |
| hovercard-subject-tag | issue:4570510085 |
| 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/liquid-java/liquidjava/238/issue_layout |
| twitter:image | https://opengraph.githubassets.com/961d65d0619640447e377d5de4009ae768edf6e173fd5e380b642419597fbeb4/liquid-java/liquidjava/issues/238 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/961d65d0619640447e377d5de4009ae768edf6e173fd5e380b642419597fbeb4/liquid-java/liquidjava/issues/238 |
| og:image:alt | Description Runtime exception in the next case. Minimal reproducer Client: public class ByteBufTest { public static final int TEST_BUFFER_SIZE = 128; private ByteBuffer mDirectBuffer; public ByteBu... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | CatarinaGamboa |
| hostname | github.com |
| expected-hostname | github.com |
| None | a6443033349a18134b517627f043d4a59a5110337b879810c7229c2c7e28eda0 |
| turbo-cache-control | no-preview |
| go-import | github.com/liquid-java/liquidjava git https://github.com/liquid-java/liquidjava.git |
| octolytics-dimension-user_id | 242831829 |
| octolytics-dimension-user_login | liquid-java |
| octolytics-dimension-repository_id | 258218369 |
| octolytics-dimension-repository_nwo | liquid-java/liquidjava |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 258218369 |
| octolytics-dimension-repository_network_root_nwo | liquid-java/liquidjava |
| 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 | d6c6cacbe32d3ddfd1796fbd1a39b8fb47b87daf |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width