Skip to content

fix(java): avoid Integer unboxing in resource health merge#406

Merged
pratyush618 merged 1 commit into
masterfrom
fix/ops-handlers-integer-unboxing
Jul 11, 2026
Merged

fix(java): avoid Integer unboxing in resource health merge#406
pratyush618 merged 1 commit into
masterfrom
fix/ops-handlers-integer-unboxing

Conversation

@pratyush618

@pratyush618 pratyush618 commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

Map<String,Integer>.merge wants a BiFunction<Integer,Integer,Integer>; Math::max is (int,int) -> int, so both parameters went through an unchecked Integer -> int unboxing conversion — flagged twice by JDT null analysis in OpsHandlers.resources(). BinaryOperator.maxBy(Comparator.naturalOrder()) keeps the merge on boxed Integers.

Test plan

  • ./gradlew compileJava green

Summary by CodeRabbit

  • Bug Fixes
    • Improved resource health aggregation to consistently preserve the most severe health status when combining results.
    • Prevented potential issues caused by handling health severity values as boxed numbers.

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 14 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 01d2d6e4-9b19-41d6-bcde-2a26461e6584

📥 Commits

Reviewing files that changed from the base of the PR and between d7e5fe3 and b93c176.

📒 Files selected for processing (1)
  • sdks/java/src/main/java/org/byteveda/taskito/dashboard/api/OpsHandlers.java
📝 Walkthrough

Walkthrough

OpsHandlers.resources() now aggregates resource health severities with BinaryOperator.maxBy(Comparator.naturalOrder()) for boxed Integer values, replacing Math::max. Imports and explanatory comments were updated.

Changes

Resource severity aggregation

Layer / File(s) Summary
Boxed severity merge
sdks/java/.../OpsHandlers.java
Adds the required comparator imports and updates resources() to select the highest boxed severity during merging, with comments explaining the change.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: avoiding Integer unboxing in the resource health merge logic.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ops-handlers-integer-unboxing

Comment @coderabbitai help to get the list of available commands.

@pratyush618
pratyush618 force-pushed the fix/ops-handlers-integer-unboxing branch from d7e5fe3 to b93c176 Compare July 11, 2026 04:28
@pratyush618
pratyush618 merged commit 72a581c into master Jul 11, 2026
18 checks passed
@pratyush618
pratyush618 deleted the fix/ops-handlers-integer-unboxing branch July 11, 2026 04:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant