Skip to content

Conversation

@shai-almog
Copy link
Collaborator

Motivation

  • Silence SpotBugs "Useless control flow" (UCF) findings by removing no-op branches that do nothing but trigger UCF warnings.
  • Keep behavior and semantics unchanged while removing empty or redundant branches across compression, service, and UI code.
  • Also ensure the repository quality gate treats UCF findings as build failures so regressions are caught in CI.

Description

  • Removed empty/no-op control-flow branches in several files including CodenameOne/src/com/codename1/io/gzip/Deflater.java, CodenameOne/src/com/codename1/io/gzip/Inflater.java, CodenameOne/src/com/codename1/io/gzip/ZStream.java, and CodenameOne/src/com/codename1/io/gzip/InfBlocks.java to eliminate UCF warnings.
  • Cleaned up empty branches and redundant checks in UI and service code such as CodenameOne/src/com/codename1/io/services/TwitterRESTService.java, CodenameOne/src/com/codename1/ui/BrowserComponent.java, CodenameOne/src/com/codename1/ui/Label.java, CodenameOne/src/com/codename1/ui/LeadUtil.java, CodenameOne/src/com/codename1/ui/TextField.java, CodenameOne/src/com/codename1/ui/Toolbar.java, CodenameOne/src/com/codename1/ui/html/HTMLComponent.java, CodenameOne/src/com/codename1/ui/layouts/mig/CodenameOneMiGContainerWrapper.java, CodenameOne/src/com/codename1/ui/plaf/CSSBorder.java, and CodenameOne/src/com/codename1/ui/spinner/DateTimeSpinner3D.java to remove no-op branches flagged by SpotBugs.
  • Updated the quality gate script .github/scripts/generate-quality-report.py to add the SpotBugs rule "UCF_USELESS_CONTROL_FLOW" to the set of forbidden rules so such findings will fail the PR CI.

Testing

  • No automated unit or integration tests were executed as part of this change (no mvn or test runs were performed).
  • Changes are limited to removal of no-op branches and one rule addition in the quality-report script, intended to be semantically neutral.
  • The CI quality gate will now fail if SpotBugs emits UCF_USELESS_CONTROL_FLOW findings for modified or other files.
  • Manual compilation or CI validation is recommended to confirm there are no regressions in SpotBugs/compilation in the CI environment.

Codex Task

@shai-almog
Copy link
Collaborator Author

shai-almog commented Jan 12, 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: 411 seconds
  • Compilation Time: 97 seconds

Detailed Performance Metrics

Metric Duration
Build Time Statistics
Setup & Unzip 44283 ms
Extract Extensions 47 ms
Google Services Setup 6 ms
Scan Classes 1627 ms
Extract Libs 2215 ms
Inject Build Hints 113 ms
Generate Unit Tests 8 ms
Generate Stubs 1836 ms
Compile Stubs 3484 ms
Generate Icons 1629 ms
Prepare ParparVM 257 ms
ParparVM Execution 233442 ms
Post-VM Setup 300 ms
CocoaPods 7320 ms
Finalize 50 ms
Total Time 296621 msMaven Overhead : 115000 ms
CocoaPods Install (Script) 2000 ms
Simulator Boot (Run) 70000 ms
App Install 16000 ms
App Launch 9000 ms
Test Execution 204000 ms

@github-actions
Copy link

✅ Continuous Quality Report

Test & Coverage

Static Analysis

Generated automatically by the PR CI workflow.

@shai-almog
Copy link
Collaborator Author

shai-almog commented Jan 12, 2026

Compared 30 screenshots: 30 matched.

Native Android coverage

  • 📊 Line coverage: 24.56% (2632/10717 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 24.11% (12182/50528), branch 14.96% (699/4672), complexity 17.26% (732/4241), method 32.53% (592/1820), class 33.66% (102/303)
    • Lowest covered classes
      • com.codename1.impl.android.com.codename1.impl.android.AndroidContactsManager – 0.00% (0/400 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidImplementation$Video – 0.00% (0/168 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.IntentIntegrator – 0.00% (0/139 lines covered)
      • com.codename1.impl.android.util.com.codename1.impl.android.util.Base64 – 0.00% (0/117 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidImplementation$SocketImpl – 0.00% (0/77 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidTextureView – 0.00% (0/76 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidSurfaceView – 0.00% (0/73 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.LocalNotificationPublisher – 0.00% (0/65 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.FridaDetectionUtil – 0.00% (0/64 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.PushNotificationService – 0.00% (0/59 lines covered)

✅ Native Android screenshot tests passed.

Native Android coverage

  • 📊 Line coverage: 24.56% (2632/10717 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 24.11% (12182/50528), branch 14.96% (699/4672), complexity 17.26% (732/4241), method 32.53% (592/1820), class 33.66% (102/303)
    • Lowest covered classes
      • com.codename1.impl.android.com.codename1.impl.android.AndroidContactsManager – 0.00% (0/400 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidImplementation$Video – 0.00% (0/168 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.IntentIntegrator – 0.00% (0/139 lines covered)
      • com.codename1.impl.android.util.com.codename1.impl.android.util.Base64 – 0.00% (0/117 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidImplementation$SocketImpl – 0.00% (0/77 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidTextureView – 0.00% (0/76 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidSurfaceView – 0.00% (0/73 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.LocalNotificationPublisher – 0.00% (0/65 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.FridaDetectionUtil – 0.00% (0/64 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.PushNotificationService – 0.00% (0/59 lines covered)

@shai-almog shai-almog merged commit 40e8099 into master Jan 12, 2026
15 of 16 checks passed
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