Fix crash on unsolved argument to JDK constructor - #469
Conversation
This reverts commit 005b147506a219eb88e74c67fe50f0af094b5e92.
|
Warning Review limit reached
Next review available in: 51 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/main/java/org/checkerframework/specimin/unsolved/UnsolvedSymbolGenerator.java (1)
3869-3888: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winKeep the Javadocs attached to the methods they describe.
The new helper was inserted between the existing
getFQNsForUnsolvableConstructorJavadoc and its method, leaving that comment orphaned and creating duplicate documentation. Move or remove the original block, and fix the"constuctor"typo in the replacement comment.Also applies to: 3889-3897
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/main/java/org/checkerframework/specimin/unsolved/UnsolvedSymbolGenerator.java` around lines 3869 - 3888, Move the existing Javadoc for getFQNsForUnsolvableConstructor so it remains directly above that method, removing any orphaned or duplicate documentation. Keep the new isKnownConstructorDeclaringType Javadoc attached to its helper and correct “constuctor” to “constructor” in the replacement comment.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In
`@src/main/java/org/checkerframework/specimin/unsolved/UnsolvedSymbolGenerator.java`:
- Around line 3869-3888: Move the existing Javadoc for
getFQNsForUnsolvableConstructor so it remains directly above that method,
removing any orphaned or duplicate documentation. Keep the new
isKnownConstructorDeclaringType Javadoc attached to its helper and correct
“constuctor” to “constructor” in the replacement comment.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 317a79e9-8b32-44a3-be0e-1392393cd936
📒 Files selected for processing (2)
src/main/java/org/checkerframework/specimin/JavaParserUtil.javasrc/main/java/org/checkerframework/specimin/unsolved/UnsolvedSymbolGenerator.java
Fixes the crash in #405. The actual test case for #405 still doesn't compile, but I think that's a separate problem. I've manually confirmed that the test case fails with the appropriate crash without the fix commit.
This PR is a further experiment in AI-assisted software engineering. All of the code in this PR was initially authored by Claude, but I've reviewed it and it seems reasonable to me. Here is its change summary:
In UnsolvedSymbolGenerator.java, a constructor call to a fully-known class (e.g. a JDK type like IllegalStateException) whose argument type was unsolvable was being routed down the "synthetic constructor" path. That path assumes the constructor's declaring type is one of Specimin's synthetic symbols, so it looked up a scope that doesn't exist and crashed with Scope not created when it should've been.
Two guards were added in the unresolvable-args branch:
The new test (JdkCtorUnsolvedArgTest + jdkctorunsolvedarg/)
A minimal reproduction distilled from the real crash: a target method that throws new IllegalStateException("bad value: " + field) where field has an unsolvable type. This exercises exactly the fixed path.