Skip to content

Conversation

@shai-almog
Copy link
Collaborator

Motivation

  • Silence several SpotBugs findings (null param deref, non-short-circuit logic, Boolean reference comparisons, instance locking on shared static data, dead local store) while keeping existing behavior intact.
  • Make the CI quality gate stricter by failing the build on the identified SpotBugs rules so regressions are caught early.

Description

  • Guard FacebookRESTService.keyValue against a null key and normalize null values to an empty string before calling put (keyValue).
  • Validate fontKey in HTMLComponent.addFont by throwing IllegalArgumentException for null keys and perform toLowerCase() before inserting into fonts.
  • Replace non-short-circuit bitwise checks with logical short-circuit operators in DeflaterOutputStream.write (use ||) and TBigInteger.modPow (use || / &&) to avoid evaluation surprises.
  • Replace Boolean reference comparisons with Boolean.TRUE.equals(...) in InstantUI.isExcludedProperty and BrowserComponent.isDebugMode to avoid reference-comparison pitfalls.
  • Introduce a dedicated static lock LISTENER_LOCK and synchronize on it in LocationManager.setLocationListener and setBackgroundLocationListener to avoid using instance-level locks when modifying static listener fields.
  • Remove a dead local store assignment to baseStyle in UIManager.createStyle to eliminate a dead-store warning.
  • Extend the SpotBugs quality gate in .github/scripts/generate-quality-report.py to treat the rules NP_NULL_PARAM_DEREF, NS_NON_SHORT_CIRCUIT, SSD_DO_NOT_USE_INSTANCE_LOCK_ON_SHARED_STATIC_DATA, DLS_DEAD_LOCAL_STORE_OF_NULL, and RC_REF_COMPARISON_BAD_PRACTICE_BOOLEAN as build-breaking violations.

Testing

  • No automated tests were executed as part of this change (no mvn or unit test runs were performed).

Codex Task

@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 14, 2026

Compared 30 screenshots: 30 matched.

Native Android coverage

  • 📊 Line coverage: 24.85% (2663/10717 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 24.47% (12362/50528), branch 15.33% (716/4672), complexity 17.52% (743/4241), method 33.08% (602/1820), class 34.98% (106/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.85% (2663/10717 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 24.47% (12362/50528), branch 15.33% (716/4672), complexity 17.52% (743/4241), method 33.08% (602/1820), class 34.98% (106/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
Copy link
Collaborator Author

shai-almog commented Jan 15, 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: 300 seconds
  • Compilation Time: 77 seconds

Detailed Performance Metrics

Metric Duration
Build Time Statistics
Setup & Unzip 25013 ms
Extract Extensions 11 ms
Google Services Setup 1 ms
Scan Classes 863 ms
Extract Libs 638 ms
Inject Build Hints 30 ms
Generate Unit Tests 2 ms
Generate Stubs 852 ms
Compile Stubs 1830 ms
Generate Icons 932 ms
Prepare ParparVM 157 ms
ParparVM Execution 185660 ms
Post-VM Setup 97 ms
CocoaPods 4426 ms
Finalize 10 ms
Total Time 220522 msMaven Overhead : 80000 ms
CocoaPods Install (Script) 1000 ms
Simulator Boot (Run) 44000 ms
App Install 11000 ms
App Launch 6000 ms
Test Execution 135000 ms

@shai-almog shai-almog merged commit 4897803 into master Jan 15, 2026
13 of 14 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