Skip to content

Fix #1523: expose Slider.setProgressInternal as protected#5118

Merged
shai-almog merged 1 commit into
masterfrom
fix-1523-slider-setprogress-protected
May 30, 2026
Merged

Fix #1523: expose Slider.setProgressInternal as protected#5118
shai-almog merged 1 commit into
masterfrom
fix-1523-slider-setprogress-protected

Conversation

@shai-almog
Copy link
Copy Markdown
Collaborator

Summary

Closes #1523. The 2015 reporter wanted to build a range slider on top of Slider but couldn't because setProgressInternal(int) was private. Every value-set path in the class — setProgress, pointerDragged (line 531), pointer-released (line 585), the keyboard repeat handlers (lines 646, 654, 662, 670) — funnels through this method, so a subclass that wants to intercept value changes has no clean hook.

Promote the method to protected and add a short javadoc explaining the contract. No behavioural change for existing callers; the access widening is source- and binary-compatible.

Test plan

  • New regression test SliderSetProgressInternalScopeTest defines a ProbeSlider subclass with @Override protected void setProgressInternal(int). If the method ever regresses back to private this class will fail to compile, and the assertions verify that the override is actually called when setProgress runs (1 call → seen, 3 calls → seen, final value reported correctly).
  • Full *Slider* test sweep — 27 tests across SliderSetProgressInternalScopeTest / ComboBoxTabsSliderTest / SliderBridgeTest — all green.
  • ASCII-only sources verified.
  • CI verification.

🤖 Generated with Claude Code

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 30, 2026

✅ 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.

@github-actions
Copy link
Copy Markdown
Contributor

Cloudflare Preview

@shai-almog
Copy link
Copy Markdown
Collaborator Author

shai-almog commented May 30, 2026

Compared 122 screenshots: 122 matched.

Native Android coverage

  • 📊 Line coverage: 12.83% (7470/58222 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 10.43% (37388/358465), branch 4.33% (1465/33850), complexity 5.43% (1765/32532), method 9.48% (1445/15249), class 15.57% (331/2126)
    • 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)
      • 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)
      • kotlinx.coroutines.kotlinx.coroutines.JobSupport – 0.00% (0/423 lines covered)

✅ Native Android screenshot tests passed.

Native Android coverage

  • 📊 Line coverage: 12.83% (7470/58222 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 10.43% (37388/358465), branch 4.33% (1465/33850), complexity 5.43% (1765/32532), method 9.48% (1445/15249), class 15.57% (331/2126)
    • 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)
      • 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)
      • kotlinx.coroutines.kotlinx.coroutines.JobSupport – 0.00% (0/423 lines covered)

Benchmark Results

Detailed Performance Metrics

Metric Duration
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 native encode 919.000 ms
Base64 CN1 encode 230.000 ms
Base64 encode ratio (CN1/native) 0.250x (75.0% faster)
Base64 native decode 678.000 ms
Base64 CN1 decode 258.000 ms
Base64 decode ratio (CN1/native) 0.381x (61.9% faster)
Image encode benchmark status skipped (SIMD unsupported)

The 2015 reporter wanted to build a range slider on top of Slider but
could not because setProgressInternal(int) was package-private private.
Every value-set path in the class (setProgress, pointerDragged,
keyboard repeat handlers, etc.) funnels through this method, so a
subclass that wants to intercept value changes has no clean hook.

Promote the method to protected and document the contract. No
behavioural change for existing callers (the access widening is
source/binary compatible), and an override picks up updates from
every input path uniformly.

Closes #1523.

Adds maven/core-unittests/.../SliderSetProgressInternalScopeTest.java
that defines a ProbeSlider subclass with an @OverRide on
setProgressInternal. If the method ever regresses back to private the
test will fail to compile, and the body assertions verify the override
is actually called when setProgress runs. Full Slider+SliderBridge
suite (27 tests) stays green.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@shai-almog shai-almog force-pushed the fix-1523-slider-setprogress-protected branch from 9b877e5 to 0d6eb4a Compare May 30, 2026 17:32
@shai-almog
Copy link
Copy Markdown
Collaborator Author

shai-almog commented May 30, 2026

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

Benchmark Results

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

Build and Run Timing

Metric Duration
Simulator Boot 88000 ms
Simulator Boot (Run) 2000 ms
App Install 15000 ms
App Launch 6000 ms
Test Execution 404000 ms

Detailed Performance Metrics

Metric Duration
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 native encode 893.000 ms
Base64 CN1 encode 5562.000 ms
Base64 encode ratio (CN1/native) 6.228x (522.8% slower)
Base64 native decode 4306.000 ms
Base64 CN1 decode 9187.000 ms
Base64 decode ratio (CN1/native) 2.134x (113.4% slower)
Base64 SIMD encode 3727.000 ms
Base64 encode ratio (SIMD/native) 4.174x (317.4% slower)
Base64 encode ratio (SIMD/CN1) 0.670x (33.0% faster)
Base64 SIMD decode 2340.000 ms
Base64 decode ratio (SIMD/native) 0.543x (45.7% faster)
Base64 decode ratio (SIMD/CN1) 0.255x (74.5% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 333.000 ms
Image createMask (SIMD on) 47.000 ms
Image createMask ratio (SIMD on/off) 0.141x (85.9% faster)
Image applyMask (SIMD off) 954.000 ms
Image applyMask (SIMD on) 402.000 ms
Image applyMask ratio (SIMD on/off) 0.421x (57.9% faster)
Image modifyAlpha (SIMD off) 1081.000 ms
Image modifyAlpha (SIMD on) 251.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.232x (76.8% faster)
Image modifyAlpha removeColor (SIMD off) 1040.000 ms
Image modifyAlpha removeColor (SIMD on) 391.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.376x (62.4% faster)
Image PNG encode (SIMD off) 2155.000 ms
Image PNG encode (SIMD on) 1499.000 ms
Image PNG encode ratio (SIMD on/off) 0.696x (30.4% faster)
Image JPEG encode 1292.000 ms

@shai-almog shai-almog merged commit ea5d6d3 into master May 30, 2026
22 checks passed
@shai-almog shai-almog deleted the fix-1523-slider-setprogress-protected branch May 30, 2026 19:15
@shai-almog
Copy link
Copy Markdown
Collaborator Author

shai-almog commented May 30, 2026

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

Benchmark Results

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

Build and Run Timing

Metric Duration
Simulator Boot 103000 ms
Simulator Boot (Run) 0 ms
App Install 19000 ms
App Launch 10000 ms
Test Execution 358000 ms

Detailed Performance Metrics

Metric Duration
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 native encode 2426.000 ms
Base64 CN1 encode 4992.000 ms
Base64 encode ratio (CN1/native) 2.058x (105.8% slower)
Base64 native decode 762.000 ms
Base64 CN1 decode 1399.000 ms
Base64 decode ratio (CN1/native) 1.836x (83.6% slower)
Base64 SIMD encode 637.000 ms
Base64 encode ratio (SIMD/native) 0.263x (73.7% faster)
Base64 encode ratio (SIMD/CN1) 0.128x (87.2% faster)
Base64 SIMD decode 652.000 ms
Base64 decode ratio (SIMD/native) 0.856x (14.4% faster)
Base64 decode ratio (SIMD/CN1) 0.466x (53.4% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 64.000 ms
Image createMask (SIMD on) 13.000 ms
Image createMask ratio (SIMD on/off) 0.203x (79.7% faster)
Image applyMask (SIMD off) 154.000 ms
Image applyMask (SIMD on) 116.000 ms
Image applyMask ratio (SIMD on/off) 0.753x (24.7% faster)
Image modifyAlpha (SIMD off) 433.000 ms
Image modifyAlpha (SIMD on) 137.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.316x (68.4% faster)
Image modifyAlpha removeColor (SIMD off) 212.000 ms
Image modifyAlpha removeColor (SIMD on) 82.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.387x (61.3% faster)
Image PNG encode (SIMD off) 1438.000 ms
Image PNG encode (SIMD on) 1149.000 ms
Image PNG encode ratio (SIMD on/off) 0.799x (20.1% faster)
Image JPEG encode 833.000 ms

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.

To change scope for function in Slider

1 participant