Skip to content

Enforce Android SpotBugs and default to API 36#5451

Open
shai-almog wants to merge 6 commits into
masterfrom
fix-android-spotbugs-calendar-branch
Open

Enforce Android SpotBugs and default to API 36#5451
shai-almog wants to merge 6 commits into
masterfrom
fix-android-spotbugs-calendar-branch

Conversation

@shai-almog

@shai-almog shai-almog commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • remove the redundant Android calendar column branch reported by SpotBugs
  • make the Android Maven verification fail on every non-whitelisted SpotBugs finding
  • retain XML report generation for the CI quality summary
  • raise the Gradle 8 Android compile and target SDK floor from API 33 to API 36
  • update the developer guide to describe the API 36 default

SpotBugs fix

Events.CALENDAR_ID and Instances.CALENDAR_ID resolve to the same Android Calendar Provider column name, so selecting between them produced identical bytecode branches and triggered DB_DUPLICATE_BRANCHES.

The Android module generated SpotBugs reports but did not run the plugin's check goal, so findings outside the exclusion filter did not fail Maven verification. The configuration also makes SpotBugs execution and analysis errors fail the build instead of silently producing an incomplete report.

Android API 36

The open-source Gradle 8 builder selects the highest installed Android platform but previously allowed API 33 as its minimum. It now requires API 36 as the default floor while continuing to honor explicit android.targetSDKVersion overrides. Generated projects also guarantee that compileSdk is never lower than targetSdk, independently of the selected Build Tools package.

Cloud builds receive the matching default in codenameone/BuildDaemon#157.

Validation

  • Java 8 Android Maven verify with the compile-android profile
  • SpotBugs: BugInstance size is 0
  • SpotBugs: Error size is 0
  • AndroidGradleBuilderSdkVersionTest: 3 tests passed
  • Maven: BUILD SUCCESS

Copilot AI review requested due to automatic review settings July 24, 2026 13:34
@shai-almog shai-almog changed the title Fix Android SpotBugs calendar warning Enforce Android SpotBugs and default to API 36 Jul 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Updates the Android build and QA pipeline to eliminate a SpotBugs duplicate-branch warning in calendar queries and ensure SpotBugs findings fail Maven verification while still emitting CI-consumable XML reports.

Changes:

  • Simplifies Android Calendar Provider filtering to remove a redundant column-selection branch flagged by SpotBugs.
  • Tightens SpotBugs enforcement in the Android Maven module by failing verification on non-excluded findings.
  • Raises the Android SDK floor used by the Gradle-based Android builder and aligns the developer documentation.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
maven/codenameone-maven-plugin/src/main/java/com/codename1/builders/AndroidGradleBuilder.java Raises the minimum Android platform API used by the builder.
maven/android/pom.xml Makes SpotBugs failures block mvn verify and adds the check goal while keeping XML output.
docs/developer-guide/Advanced-Topics-Under-The-Hood.asciidoc Updates docs to reflect the new Android SDK floor.
Ports/Android/src/com/codename1/impl/android/AndroidCalendarSource.java Removes SpotBugs-triggering duplicate branches by using a single calendar id column constant.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread maven/android/pom.xml
Comment thread maven/android/pom.xml
Comment thread Ports/Android/src/com/codename1/impl/android/AndroidCalendarSource.java Outdated
Copilot AI review requested due to automatic review settings July 24, 2026 13:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment thread docs/developer-guide/Advanced-Topics-Under-The-Hood.asciidoc Outdated
@shai-almog

shai-almog commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator Author

Compared 151 screenshots: 151 matched.

Native Android coverage

  • 📊 Line coverage: 11.37% (12198/107277 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 10.24% (60552/591483), branch 5.31% (2884/54275), complexity 5.03% (2846/56573), method 7.53% (2181/28950), class 11.89% (492/4138)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6327 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.ClassReader – 0.00% (0/1519 lines covered)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1148 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.MethodWriter – 0.00% (0/923 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/730 lines covered)
      • com.google.common.cache.com.google.common.cache.LocalCache$Segment – 0.00% (0/726 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/623 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.Frame – 0.00% (0/564 lines covered)
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysJvmKt – 0.00% (0/495 lines covered)

✅ Native Android screenshot tests passed.

Native Android coverage

  • 📊 Line coverage: 11.37% (12198/107277 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 10.24% (60552/591483), branch 5.31% (2884/54275), complexity 5.03% (2846/56573), method 7.53% (2181/28950), class 11.89% (492/4138)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6327 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.ClassReader – 0.00% (0/1519 lines covered)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1148 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.MethodWriter – 0.00% (0/923 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/730 lines covered)
      • com.google.common.cache.com.google.common.cache.LocalCache$Segment – 0.00% (0/726 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/623 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.Frame – 0.00% (0/564 lines covered)
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysJvmKt – 0.00% (0/495 lines covered)

Benchmark Results

Detailed Performance Metrics

Metric Duration
SIMD kernel backend scalar fallback (no native SIMD)
SIMD int-add (64K x300) java 385ms / native 180ms = 2.1x speedup
SIMD float-mul (64K x300) java 147ms / native 179ms = 0.8x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path gated to scalar (CPU autovectorizes scalar; explicit SIMD not beneficial here)
Base64 CN1 encode 80.000 ms
Base64 CN1 decode 86.000 ms
Base64 native encode 338.000 ms
Base64 encode ratio (CN1/native) 0.237x (76.3% faster)
Base64 native decode 271.000 ms
Base64 decode ratio (CN1/native) 0.317x (68.3% faster)
Image encode benchmark status skipped (SIMD unsupported)

@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Developer Guide build artifacts are available for download from this workflow run:

Developer Guide quality checks:

  • AsciiDoc linter: No issues found (report)
  • Vale: No alerts found (report)
  • Paragraph capitalization: No paragraph capitalization issues (report)
  • LanguageTool: No grammar matches (report)
  • Image references: No unused images detected (report)

Copilot AI review requested due to automatic review settings July 24, 2026 14:13
@github-actions

Copy link
Copy Markdown
Contributor

Cloudflare Preview

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Comment thread docs/developer-guide/Advanced-Topics-Under-The-Hood.asciidoc Outdated
@shai-almog

shai-almog commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator Author

Compared 181 screenshots: 181 matched.
✅ JavaScript-port screenshot tests passed.

@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

✅ Continuous Quality Report

Test & Coverage

Static Analysis

  • SpotBugs [Report archive]
    • ByteCodeTranslator: 0 findings (no issues)
    • android: 0 findings (no issues)
    • codenameone-maven-plugin: 0 findings (no issues)
    • core-unittests: 0 findings (no issues)
    • ios: 0 findings (no issues)
  • PMD: 0 findings (no issues) [Report archive]
  • Checkstyle: 0 findings (no issues) [Report archive]

Generated automatically by the PR CI workflow.

Copilot AI review requested due to automatic review settings July 24, 2026 15:18
@shai-almog

shai-almog commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator Author

Compared 149 screenshots: 149 matched.
✅ Native iOS Metal screenshot tests passed.

Benchmark Results

  • VM Translation Time: 0 seconds
  • Compilation Time: 611 seconds

Build and Run Timing

Metric Duration
Simulator Boot 96000 ms
Simulator Boot (Run) 0 ms
App Install 19000 ms
App Launch 33000 ms
Test Execution 1071000 ms

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 78ms / native 5ms = 15.6x speedup
SIMD float-mul (64K x300) java 70ms / native 2ms = 35.0x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path active (NEON-accelerated)
Base64 CN1 encode 171.000 ms
Base64 CN1 decode 171.000 ms
Base64 native encode 327.000 ms
Base64 encode ratio (CN1/native) 0.523x (47.7% faster)
Base64 native decode 488.000 ms
Base64 decode ratio (CN1/native) 0.350x (65.0% faster)
Base64 SIMD encode 91.000 ms
Base64 encode ratio (SIMD/CN1) 0.532x (46.8% faster)
Base64 SIMD decode 68.000 ms
Base64 decode ratio (SIMD/CN1) 0.398x (60.2% faster)
Base64 encode ratio (SIMD/native) 0.278x (72.2% faster)
Base64 decode ratio (SIMD/native) 0.139x (86.1% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 18.000 ms
Image createMask (SIMD on) 1.000 ms
Image createMask ratio (SIMD on/off) 0.056x (94.4% faster)
Image applyMask (SIMD off) 44.000 ms
Image applyMask (SIMD on) 32.000 ms
Image applyMask ratio (SIMD on/off) 0.727x (27.3% faster)
Image modifyAlpha (SIMD off) 33.000 ms
Image modifyAlpha (SIMD on) 30.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.909x (9.1% faster)
Image modifyAlpha removeColor (SIMD off) 53.000 ms
Image modifyAlpha removeColor (SIMD on) 31.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.585x (41.5% faster)

@shai-almog

shai-almog commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator Author

Compared 144 screenshots: 144 matched.
✅ Native Apple TV (tvOS, Metal) screenshot tests passed.

@shai-almog

shai-almog commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator Author

Compared 143 screenshots: 143 matched.
✅ Native iOS screenshot tests passed.

Benchmark Results

  • VM Translation Time: 0 seconds
  • Compilation Time: 264 seconds

Build and Run Timing

Metric Duration
Simulator Boot 60000 ms
Simulator Boot (Run) 0 ms
App Install 12000 ms
App Launch 1000 ms
Test Execution 732000 ms

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 81ms / native 3ms = 27.0x speedup
SIMD float-mul (64K x300) java 67ms / native 4ms = 16.7x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path active (NEON-accelerated)
Base64 CN1 encode 161.000 ms
Base64 CN1 decode 142.000 ms
Base64 native encode 458.000 ms
Base64 encode ratio (CN1/native) 0.352x (64.8% faster)
Base64 native decode 215.000 ms
Base64 decode ratio (CN1/native) 0.660x (34.0% faster)
Base64 SIMD encode 48.000 ms
Base64 encode ratio (SIMD/CN1) 0.298x (70.2% faster)
Base64 SIMD decode 45.000 ms
Base64 decode ratio (SIMD/CN1) 0.317x (68.3% faster)
Base64 encode ratio (SIMD/native) 0.105x (89.5% faster)
Base64 decode ratio (SIMD/native) 0.209x (79.1% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 6.000 ms
Image createMask (SIMD on) 2.000 ms
Image createMask ratio (SIMD on/off) 0.333x (66.7% faster)
Image applyMask (SIMD off) 46.000 ms
Image applyMask (SIMD on) 39.000 ms
Image applyMask ratio (SIMD on/off) 0.848x (15.2% faster)
Image modifyAlpha (SIMD off) 33.000 ms
Image modifyAlpha (SIMD on) 34.000 ms
Image modifyAlpha ratio (SIMD on/off) 1.030x (3.0% slower)
Image modifyAlpha removeColor (SIMD off) 34.000 ms
Image modifyAlpha removeColor (SIMD on) 31.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.912x (8.8% faster)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Comment thread maven/android/pom.xml
Comment thread maven/android/pom.xml
Copilot AI review requested due to automatic review settings July 24, 2026 15:44
@shai-almog

shai-almog commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator Author

Compared 148 screenshots: 148 matched.
✅ Native Mac screenshot tests passed.

Benchmark Results

  • VM Translation Time: 0 seconds
  • Compilation Time: 250 seconds

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 57ms / native 3ms = 19.0x speedup
SIMD float-mul (64K x300) java 55ms / native 3ms = 18.3x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path active (NEON-accelerated)
Base64 CN1 encode 170.000 ms
Base64 CN1 decode 149.000 ms
Base64 native encode 664.000 ms
Base64 encode ratio (CN1/native) 0.256x (74.4% faster)
Base64 native decode 410.000 ms
Base64 decode ratio (CN1/native) 0.363x (63.7% faster)
Base64 SIMD encode 57.000 ms
Base64 encode ratio (SIMD/CN1) 0.335x (66.5% faster)
Base64 SIMD decode 52.000 ms
Base64 decode ratio (SIMD/CN1) 0.349x (65.1% faster)
Base64 encode ratio (SIMD/native) 0.086x (91.4% faster)
Base64 decode ratio (SIMD/native) 0.127x (87.3% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 8.000 ms
Image createMask (SIMD on) 1.000 ms
Image createMask ratio (SIMD on/off) 0.125x (87.5% faster)
Image applyMask (SIMD off) 95.000 ms
Image applyMask (SIMD on) 62.000 ms
Image applyMask ratio (SIMD on/off) 0.653x (34.7% faster)
Image modifyAlpha (SIMD off) 52.000 ms
Image modifyAlpha (SIMD on) 46.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.885x (11.5% faster)
Image modifyAlpha removeColor (SIMD off) 56.000 ms
Image modifyAlpha removeColor (SIMD on) 57.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 1.018x (1.8% slower)

@shai-almog

shai-almog commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator Author

Compared 217 screenshots: 217 matched.
✅ Native Apple Watch (watchOS, Core Graphics) screenshot tests passed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI review requested due to automatic review settings July 24, 2026 17:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

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.

2 participants