Update Jtreg tests - #7941
Conversation
…into type-inference-8-review
… into type-inference-8-review-2-16
… into type-inference-8-review-2-16
… into type-inference-8-review-2-16
… into type-inference-8-review-2-16
… into type-inference-8-review-2-16
… into type-inference-8-review-2-16
… into type-inference-8-review-2-16
… into type-inference-8-review-2-16
…ker-framework into type-inference-8-review-2-16
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThe jtreg nullness persistence tests now target JDK 24 or later and use the Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 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.
Actionable comments posted: 2
🤖 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.
Inline comments:
In `@checker/jtreg/nullness/defaultsPersist/Fields.java`:
- Around line 5-9: Resolve the stale `@ignore` in the jtreg header for
Fields.java: verify whether Issue 2816 still reproduces on JDK 24, then remove
`@ignore` if fixed or update its reason to describe the current JDK 24 failure.
Keep the jdk.version.major requirement unchanged.
In `@checker/jtreg/nullness/defaultsPersist/ReferenceInfoUtil.java`:
- Around line 104-119: Remove the unconditional System.out.println debug
statement from findAnnotation, leaving the annotation matching and isAtPosition
logic unchanged.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: bf493e6a-3737-4a29-9edd-d014caedf277
📒 Files selected for processing (14)
build.gradlechecker/jtreg/nullness/PersistUtil.javachecker/jtreg/nullness/defaultsPersist/Classes.javachecker/jtreg/nullness/defaultsPersist/Constructors.javachecker/jtreg/nullness/defaultsPersist/Driver.javachecker/jtreg/nullness/defaultsPersist/Fields.javachecker/jtreg/nullness/defaultsPersist/Methods.javachecker/jtreg/nullness/defaultsPersist/ReferenceInfoUtil.javachecker/jtreg/nullness/inheritDeclAnnoPersist/Driver.javachecker/jtreg/nullness/inheritDeclAnnoPersist/Extends.javachecker/jtreg/nullness/inheritDeclAnnoPersist/Implements.javachecker/jtreg/nullness/inheritDeclAnnoPersist/ReferenceInfoUtil.javachecker/jtreg/tainting/ComplementaryBoundProvenance.goalchecker/jtreg/tainting/ComplementaryBoundProvenance.java
| private static TypeAnnotation findAnnotation( | ||
| String name, TypeAnnotation.Position expected, List<TypeAnnotation> annotations, ClassFile cf) | ||
| throws InvalidIndex, UnexpectedEntry { | ||
| String name, Position expected, List<TypeAnnotation> annotations) { | ||
| String properName = "L" + name + ";"; | ||
| for (TypeAnnotation anno : annotations) { | ||
| String actualName = cf.constant_pool.getUTF8Value(anno.annotation.type_index); | ||
| String actualName = anno.annotation().className().stringValue(); | ||
|
|
||
| if (properName.equals(actualName)) { | ||
| System.out.println("For Anno: " + actualName); | ||
| } | ||
|
|
||
| if (properName.equals(actualName) && areEquals(expected, anno.position)) { | ||
| if (properName.equals(actualName) && isAtPosition(expected, anno)) { | ||
| return anno; | ||
| } | ||
| } | ||
| return null; | ||
| } |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win
Remove the leftover debug print.
Lines 110-112 print "For Anno: " + actualName whenever the name matches. The print duplicates the condition on line 114 and adds unconditional output to every test run. Noisy stdout hides the real comparison diagnostics that ComparisonException produces.
♻️ Proposed cleanup
String properName = "L" + name + ";";
for (TypeAnnotation anno : annotations) {
String actualName = anno.annotation().className().stringValue();
-
- if (properName.equals(actualName)) {
- System.out.println("For Anno: " + actualName);
- }
-
if (properName.equals(actualName) && isAtPosition(expected, anno)) {
return anno;
}
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| private static TypeAnnotation findAnnotation( | |
| String name, TypeAnnotation.Position expected, List<TypeAnnotation> annotations, ClassFile cf) | |
| throws InvalidIndex, UnexpectedEntry { | |
| String name, Position expected, List<TypeAnnotation> annotations) { | |
| String properName = "L" + name + ";"; | |
| for (TypeAnnotation anno : annotations) { | |
| String actualName = cf.constant_pool.getUTF8Value(anno.annotation.type_index); | |
| String actualName = anno.annotation().className().stringValue(); | |
| if (properName.equals(actualName)) { | |
| System.out.println("For Anno: " + actualName); | |
| } | |
| if (properName.equals(actualName) && areEquals(expected, anno.position)) { | |
| if (properName.equals(actualName) && isAtPosition(expected, anno)) { | |
| return anno; | |
| } | |
| } | |
| return null; | |
| } | |
| private static TypeAnnotation findAnnotation( | |
| String name, Position expected, List<TypeAnnotation> annotations) { | |
| String properName = "L" + name + ";"; | |
| for (TypeAnnotation anno : annotations) { | |
| String actualName = anno.annotation().className().stringValue(); | |
| if (properName.equals(actualName) && isAtPosition(expected, anno)) { | |
| return anno; | |
| } | |
| } | |
| return null; | |
| } |
🤖 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 `@checker/jtreg/nullness/defaultsPersist/ReferenceInfoUtil.java` around lines
104 - 119, Remove the unconditional System.out.println debug statement from
findAnnotation, leaving the annotation matching and isAtPosition logic
unchanged.
These changes were pulled from #7912.
Fixes #2816.