Skip to content

Conversation

@shai-almog
Copy link
Collaborator

Motivation

  • Address multiple SpotBugs warnings across the codebase to remove fragile patterns and ensure correct semantics for edge cases.
  • Make a set of previously tolerated SpotBugs rules fail the quality check so regressions are caught by CI.
  • Keep the behavior and public APIs unchanged while removing unsafe or vacuous checks and improving correctness of equality/iteration contracts.

Description

  • Remove vacuous/incorrect integer underflow clamps in rectangle intersection helpers in CodenameOne/src/com/codename1/ui/geom/Rectangle.java so intersection math relies on meaningful bounds instead of impossible Integer.MIN_VALUE adjustments.
  • Avoid unnecessary toString() calls on String instances and make header keys/values non-null by using casts and Objects.requireNonNull in CodenameOne/src/com/codename1/io/MultipartRequest.java and CodenameOne/src/com/codename1/io/rest/RequestBuilder.java.
  • Strengthen object contracts by implementing proper hashCode/equals for PropertyXMLElement and UnitValue, and make iterators throw NoSuchElementException when exhausted in CodenameOne/src/com/codename1/properties/PropertyXMLElement.java and CodenameOne/src/com/codename1/properties/PropertyIndex.java.
  • Replace fragile oddness and float-loop patterns with safe integer/bitwise checks and integer loop counters in CodenameOne/src/com/codename1/ui/layouts/mig/ConstraintParser.java, CodenameOne/src/com/codename1/ui/plaf/RoundRectBorder.java, CodenameOne/src/com/codename1/charts/views/PieSegment.java, and CodenameOne/src/com/codename1/charts/views/RadarChart.java.
  • Add SpotBugs rule IDs (INT_VACUOUS_COMPARISON, DM_STRING_TOSTRING, HE_HASHCODE_USE_OBJECT_EQUALS, IM_BAD_CHECK_FOR_ODD, IT_NO_SUCH_ELEMENT, FL_FLOATS_AS_LOOP_COUNTERS) to the forbidden list in .github/scripts/generate-quality-report.py so these findings will fail the build.

Testing

  • No automated tests were executed as part of this change (no unit/integration/SpotBugs runs were performed in this rollout).

Codex Task

@github-actions
Copy link

github-actions bot commented Jan 14, 2026

✅ Continuous Quality Report

Test & Coverage

Static Analysis

Generated automatically by the PR CI workflow.

@shai-almog
Copy link
Collaborator Author

shai-almog commented Jan 14, 2026

iOS screenshot updates

Compared 30 screenshots: 23 matched, 6 updated, 1 missing reference.

  • BrowserComponent — updated screenshot. Screenshot differs (1206x2622 px, bit depth 8).

    BrowserComponent
    Preview info: Preview provided by instrumentation.
    Full-resolution PNG saved as BrowserComponent.png in workflow artifacts.

  • graphics-draw-arc — updated screenshot. Screenshot differs (1206x2622 px, bit depth 8).

    graphics-draw-arc
    Preview info: JPEG preview quality 20; JPEG preview quality 20; downscaled to 603x1311.
    Full-resolution PNG saved as graphics-draw-arc.png in workflow artifacts.

  • graphics-draw-gradient — updated screenshot. Screenshot differs (1206x2622 px, bit depth 8).

    graphics-draw-gradient
    Preview info: JPEG preview quality 10; JPEG preview quality 10; downscaled to 844x1835.
    Full-resolution PNG saved as graphics-draw-gradient.png in workflow artifacts.

  • graphics-draw-round-rect — missing reference. Reference screenshot missing at /Users/runner/work/CodenameOne/CodenameOne/scripts/ios/screenshots/graphics-draw-round-rect.png.

    graphics-draw-round-rect
    Preview info: JPEG preview quality 10; JPEG preview quality 10; downscaled to 844x1835.
    Full-resolution PNG saved as graphics-draw-round-rect.png in workflow artifacts.

  • graphics-draw-string — updated screenshot. Screenshot differs (1206x2622 px, bit depth 8).

    graphics-draw-string
    Preview info: JPEG preview quality 10; JPEG preview quality 10; downscaled to 422x918.
    Full-resolution PNG saved as graphics-draw-string.png in workflow artifacts.

  • graphics-draw-string-decorated — updated screenshot. Screenshot differs (1206x2622 px, bit depth 8).

    graphics-draw-string-decorated
    Preview info: JPEG preview quality 10; JPEG preview quality 10; downscaled to 603x1311.
    Full-resolution PNG saved as graphics-draw-string-decorated.png in workflow artifacts.

  • kotlin — updated screenshot. Screenshot differs (1206x2622 px, bit depth 8).

    kotlin
    Preview info: Preview provided by instrumentation.
    Full-resolution PNG saved as kotlin.png in workflow artifacts.

Benchmark Results

  • VM Translation Time: 382 seconds
  • Compilation Time: 132 seconds

Detailed Performance Metrics

Metric Duration
Build Time Statistics
Setup & Unzip 31929 ms
Extract Extensions 26 ms
Google Services Setup 1 ms
Scan Classes 1298 ms
Extract Libs 854 ms
Inject Build Hints 56 ms
Generate Unit Tests 3 ms
Generate Stubs 1246 ms
Compile Stubs 2663 ms
Generate Icons 1221 ms
Prepare ParparVM 209 ms
ParparVM Execution 225200 ms
Post-VM Setup 192 ms
CocoaPods 5759 ms
Finalize 31 ms
Total Time 270689 msMaven Overhead : 112000 ms
CocoaPods Install (Script) 1000 ms
Simulator Boot (Run) 66000 ms
App Install 20000 ms
App Launch 6000 ms
Test Execution 149000 ms

@shai-almog shai-almog force-pushed the codex/fix-spotbugs-warnings-in-codenameone branch from ce03c01 to fdcc6ab Compare January 14, 2026 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants