Skip to content

Conversation

@shai-almog
Copy link
Collaborator

Motivation

  • Eliminate SpotBugs findings for lazy static initialization, redundant null-checks, and ignored return values to improve thread-safety and correctness.
  • Ensure the CI quality report treats these SpotBugs rules as build failures so regressions are prevented.

Description

  • Make lazy static initialization thread-safe by applying double-checked locking for TextField.initInputModes(), Transform.IDENTITY(), CSSBorder.styleMap(), StyleParser.bgTypes(), and Validator default emblem initialization using synchronized blocks and guarded checks.
  • Fix redundant/null-dereference issues and ensure return values are consumed by updating WebServiceProxyCall.buildRequestBody() to use a local WSDefinition, CommonTransitions timeline/buffer handling and getComponentShiftMotion() null check, MapComponent to use the returned Mercator.inverseMercator() value, ChartComponent to return renderer booleans in isPanEnabled()/isZoomEnabled(), and CodenameOneImplementation.playBuiltinSound() to consume playUserSound() return.
  • Remove a redundant null-guard before showing the validation InteractionDialog and use a local reference when invoking showPopupDialog() in Validator to address the SpotBugs nullcheck warning.
  • Mark SpotBugs rules LI_LAZY_INIT_UPDATE_STATIC, RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE, and RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT as forbidden in .github/scripts/generate-quality-report.py so those findings fail the build.

Testing

  • No automated unit or integration tests were executed as part of this change.
  • The changes are limited to synchronization/defensive checks and small control-flow fixes to preserve existing behavior and API compatibility.
  • The quality-report script was updated to treat the new SpotBugs rules as failures, so CI will surface any regressions once executed.
  • Manual compilation and static-check expectations were considered (no runtime behavior changes intended).

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 13, 2026

Compared 30 screenshots: 30 matched.

Native Android coverage

  • 📊 Line coverage: 24.76% (2654/10717 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 24.41% (12335/50528), branch 15.35% (717/4672), complexity 17.52% (743/4241), method 32.97% (600/1820), class 34.65% (105/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.76% (2654/10717 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 24.41% (12335/50528), branch 15.35% (717/4672), complexity 17.52% (743/4241), method 32.97% (600/1820), class 34.65% (105/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 13, 2026

iOS screenshot updates

Compared 30 screenshots: 22 matched, 7 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.

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

    graphics-fill-arc
    Preview info: JPEG preview quality 10; JPEG preview quality 10; downscaled to 844x1835.
    Full-resolution PNG saved as graphics-fill-arc.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: 370 seconds
  • Compilation Time: 119 seconds

Detailed Performance Metrics

Metric Duration
Build Time Statistics
Setup & Unzip 33114 ms
Extract Extensions 18 ms
Google Services Setup 2 ms
Scan Classes 590 ms
Extract Libs 1118 ms
Inject Build Hints 31 ms
Generate Unit Tests 2 ms
Generate Stubs 1318 ms
Compile Stubs 2938 ms
Generate Icons 1316 ms
Prepare ParparVM 187 ms
ParparVM Execution 221834 ms
Post-VM Setup 128 ms
CocoaPods 6934 ms
Finalize 19 ms
Total Time 269549 msMaven Overhead : 101000 ms
CocoaPods Install (Script) 1000 ms
Simulator Boot (Run) 109000 ms
App Install 23000 ms
App Launch 9000 ms
Test Execution 174000 ms

@shai-almog shai-almog merged commit ab2f392 into master Jan 13, 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