Skip to content

Fix legacy cn1lib installation in Settings - #6038

Merged
shai-almog merged 5 commits into
masterfrom
fix-settings-legacy-install
Oct 17, 2026
Merged

shai-almog merged 5 commits into
masterfrom
fix-settings-legacy-install

Conversation

@shai-almog

@shai-almog shai-almog commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

Settings currently downloads legacy cn1libs and marks them installed without creating a Maven wrapper or adding a dependency. This reproduces the JSON/BouncyCastle failures in discussion #5978, while FileChooser's direct Maven path works.

Run the existing cn1:install-cn1lib goal off the EDT, using the launching Maven distribution, settings files, profiles, offline and snapshot-update flags, local repository and user properties, and logging its output to settings.log. Only report success after the wrapper exists, its parent registers the module, and common/pom.xml references it. Incomplete wrappers produce an actionable error without overwriting their contents. Restore the original common POM if conversion or wrapper validation fails, after terminating and reaping the converter process. Reuse existing wrappers on reinstall, remove the actual dependency on uninstall, and prevent concurrent dependency edits during installation. Handle projects without the old dependency-injection comment; edit only direct project dependencies while preserving plugin/profile/managed dependencies and comments. Keep forwarded Maven properties in an owner-only binding on POSIX, and delete the single-use binding after Settings closes its input stream. Preserve legal DOCTYPE declarations in the common, wrapper and aggregator POMs without resolving external resources. Give each screenshot scenario a fresh single-use binding.

The collapsed compatibility dialog is already fixed on master by #6019. Local Ubuntu/Xvfb verification confirmed that it now opens 466 pixels wide instead of the 3-pixel window reproduced with 7.0.276; this PR does not duplicate that core fix.

Validation:

  • 33 installer/POM-editor/binding-I/O JUnit tests passed, including interrupted conversion/retry, Maven options with whitespace, wrapper reuse, compact-POM removal, and 24 combinations of unrelated dependency scopes and project dependency forms. Regression coverage also includes binding cleanup on success and read failure, DOCTYPE preservation in existing/generated wrappers and aggregators, blocked external subsets/entities, and byte-for-byte common-POM rollback after conversion failure or interruption. Each review regression was verified to fail before its fix.
  • All 24 OpenSettingsMojoTest tests passed under Java 8, including session-option forwarding, binding permissions, snapshot-update suppression, and absent default settings files.
  • Ran the actual Settings installation flow on Ubuntu for JSON and BouncyCastle using the published 7.0.276 Maven converter. Both downloaded, generated wrappers, and added their Maven dependencies; both generated reactors passed mvn validate under Java 8.
  • Repeated the actual Ubuntu JSON installation with alternate user/global settings, offline mode, a custom local repository and an explicit profile/property selecting the plugin version. Repeated again with a DOCTYPE POM and snapshot-update suppression, confirming the temporary binding was deleted after loading. Confirmed the application dependency and module registration, then passed mvn validate under Java 8.
  • The copyright-header check passes across the full PR diff.
  • Compiled the updated Settings app with Java 17. The normal Settings Maven lifecycle under Java 8 failed when bytecode-compliance attempted to load Java 17 app classes; the plugin Maven test invocation also encountered an unavailable local codenameone-dart-transpiler:8.0-SNAPSHOT. The focused suites were compiled and run directly with their dependency classpaths instead.

CI follow-up: Windows screenshots showed “No Maven Project” after the first scenario consumed their shared binding. Both screenshot scripts now create a binding per launch; the actual Linux theme-gallery script passed four consecutive light/dark captures with project fields populated. Hosted Windows CI subsequently passed all nine Settings scenarios. Its next step exposed a shared project-path variable removed by the runner refactor; that variable is restored, and a full-script control-flow test with consuming binding stubs passes all nine Settings, five Certificate Wizard and two simulator scenarios. The macOS job failed before its screenshot server started because Maven Central DNS resolution and an artifact download timed out.

@shai-almog

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-17T09:39:54.551293Z b66632a Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 26831492bc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@shai-almog

shai-almog commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator Author

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

@shai-almog

shai-almog commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 170 screenshots: 170 matched.

Native Android coverage

  • 📊 Line coverage: 16.01% (26006/162390 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 14.37% (122186/850229), branch 9.91% (8470/85441), complexity 7.82% (6529/83503), method 11.60% (4650/40094), class 19.80% (961/4853)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6367 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.ClassReader – 0.00% (0/1524 lines covered)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.MethodWriter – 0.00% (0/922 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/736 lines covered)
      • com.google.common.cache.com.google.common.cache.LocalCache$Segment – 0.00% (0/726 lines covered)
      • okio.okio.Buffer – 0.00% (0/687 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/625 lines covered)
      • com.codename1.androidcompat.rt.com.codename1.androidcompat.rt.TextXmlPullParser – 0.00% (0/623 lines covered)
      • com.codename1.androidcompat.androidx.constraintlayout.core.widgets.com.codename1.androidcompat.androidx.constraintlayout.core.widgets.Flow – 0.00% (0/576 lines covered)

✅ Native Android screenshot tests passed.

Native Android coverage

  • 📊 Line coverage: 16.01% (26006/162390 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 14.37% (122186/850229), branch 9.91% (8470/85441), complexity 7.82% (6529/83503), method 11.60% (4650/40094), class 19.80% (961/4853)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6367 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.ClassReader – 0.00% (0/1524 lines covered)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.MethodWriter – 0.00% (0/922 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/736 lines covered)
      • com.google.common.cache.com.google.common.cache.LocalCache$Segment – 0.00% (0/726 lines covered)
      • okio.okio.Buffer – 0.00% (0/687 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/625 lines covered)
      • com.codename1.androidcompat.rt.com.codename1.androidcompat.rt.TextXmlPullParser – 0.00% (0/623 lines covered)
      • com.codename1.androidcompat.androidx.constraintlayout.core.widgets.com.codename1.androidcompat.androidx.constraintlayout.core.widgets.Flow – 0.00% (0/576 lines covered)

Benchmark Results

Detailed Performance Metrics

Metric Duration
SIMD kernel backend scalar fallback (no native SIMD)
SIMD int-add (64K x300) java 213ms / native 90ms = 2.3x speedup
SIMD float-mul (64K x300) java 196ms / native 116ms = 1.6x 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 81.000 ms
Base64 CN1 decode 84.000 ms
Base64 native encode 402.000 ms
Base64 encode ratio (CN1/native) 0.201x (79.9% faster)
Base64 native decode 266.000 ms
Base64 decode ratio (CN1/native) 0.316x (68.4% faster)
Image encode benchmark status skipped (SIMD unsupported)

@github-actions

github-actions Bot commented Oct 17, 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)
    • ✅ android-compat: 0 findings (no issues)
    • ✅ android-res-compiler: 0 findings (no issues)
    • ✅ backend: 0 findings (no issues)
    • ✅ backend-test: 0 findings (no issues)
    • ✅ build-engine: 0 findings (no issues)
    • ✅ build-hint-catalog: 0 findings (no issues)
    • ✅ build-hint-tools: 0 findings (no issues)
    • ✅ codenameone-gradle-plugin: 0 findings (no issues)
    • ✅ codenameone-maven-plugin: 0 findings (no issues)
    • ✅ core-unittests: 0 findings (no issues)
    • ✅ ios: 0 findings (no issues)
    • ✅ javac: 0 findings (no issues)
    • ✅ project-model: 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

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

✅ ByteCodeTranslator Quality Report

Test & Coverage

  • ✅ Tests: 832 total, 0 failed, 57 skipped

Benchmark Results

  • Execution Time: 5430 ms

  • Hotspots (Top 20 sampled methods):

    • 12.00% com.codename1.tools.translator.IteratorEscape.mangle (107 samples)
    • 7.96% java.util.ArrayList.indexOf (71 samples)
    • 4.37% com.codename1.tools.translator.BytecodeMethod.equals (39 samples)
    • 4.15% java.lang.Object.hashCode (37 samples)
    • 3.92% java.lang.System.identityHashCode (35 samples)
    • 3.36% com.codename1.tools.translator.IteratorEscape.walk (30 samples)
    • 2.47% java.lang.StringBuilder.append (22 samples)
    • 2.13% com.codename1.tools.translator.BytecodeMethod.optimize (19 samples)
    • 1.91% com.codename1.tools.translator.bytecodes.Invoke.resolveDirectTarget (17 samples)
    • 1.91% com.codename1.tools.translator.Parser.cullMethods (17 samples)
    • 1.91% java.lang.String.equals (17 samples)
    • 1.91% java.util.HashMap.hash (17 samples)
    • 1.57% com.codename1.tools.translator.IteratorEscape.ctorOnlyStoresParamsIntoThis (14 samples)
    • 1.57% java.util.AbstractCollection.containsAll (14 samples)
    • 1.57% com.codename1.tools.translator.classfile.analysis.Frame.execute (14 samples)
    • 1.46% com.codename1.tools.translator.BytecodeMethod.addToConstantPool (13 samples)
    • 1.35% java.util.TreeMap.getEntry (12 samples)
    • 1.35% com.codename1.tools.translator.bytecodes.Invoke.findMethodUp (12 samples)
    • 1.23% java.io.FileOutputStream.writeBytes (11 samples)
    • 1.12% com.codename1.tools.translator.BytecodeMethod.updateInlinableFieldDependencies (10 samples)
  • ⚠️ Coverage report not generated.

Static Analysis

  • ✅ SpotBugs: no findings (report was not generated by the build).
  • ⚠️ PMD report not generated.
  • ⚠️ Checkstyle report not generated.

Generated automatically by the PR CI workflow.

@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Flutter vs Codename One

Same application, built both ways: Flutter's AOT compile of the gallery, and the identical Dart source transpiled to Java on Codename One. Lower is better for every metric, so a ratio above 1.00x means Codename One is ahead by that factor.

android

9 interleaved rounds; host load 0.46, 1.85, 1.52

Metric Codename One Flutter Ratio Winner
Installed size 78.2 MB 95.8 MB 1.23x Codename One
Executable code 4.6 MB 20.6 MB 4.43x Codename One
Download size (zipped) 78.2 MB 95.8 MB 1.23x Codename One
Cold start to first frame on screen 343 ms 1348 ms 3.75x Codename One
Memory at rest 45.9 MB 80.2 MB 1.75x Codename One

Start-up and memory at rest are judged round by round: the ratio is the median of the per-round ratios, each from two launches made back to back, and the times and sizes shown are each side's median, so the ratio need not equal their quotient. Codename One was ahead in 8 of 9 rounds on cold start to first frame on screen; 9 of 9 rounds on memory at rest.

Compute -- the VM workloads (vm/benchmarks), run inside each app; time is the best of the app's own repetitions, higher ratio means Codename One is faster.

Workload Codename One Flutter Ratio
intArithmetic 79 ms 165 ms 2.09x
longArithmetic 56 ms 52 ms 0.93x
mathTranscendental 214 ms 282 ms 1.32x
arraySequential 23 ms 31 ms 1.35x
arrayRandom 204 ms 240 ms 1.18x
objectAllocation 64 ms 36 ms 0.56x
valueEscape 7 ms 6 ms 0.86x
hashMapChurn 123 ms 247 ms 2.01x
stringBuilding 78 ms 99 ms 1.27x
recursion 68 ms 233 ms 3.43x
quicksortBench 113 ms 131 ms 1.16x
Geometric mean 1.31x

Gate: within tolerance against scripts/flutter-bench/baseline.

Android sizes are for the arm64-v8a slice a phone is delivered, on both sides; Flutter's release apk carries three ABIs and would otherwise count its engine about three times.
Android start-up and memory come from an x86_64 emulator with a software GPU. They compare the two runtimes on one machine; they are not phone timings, and a renderer that leans on the GPU is penalised more there.
This platform's adapter has not been exercised end to end before; treat the first published run as the thing under review.

javascript

9 interleaved rounds; host load 2.08, 1.1, 0.45

Metric Codename One Flutter Ratio Winner
Installed size 103.8 MB 122.5 MB 1.18x Codename One
Executable code 12.7 MB 25.2 MB 1.99x Codename One
Download size (zipped) 76.3 MB 84.1 MB 1.10x Codename One
Cold start to first frame on screen -- -- -- not measured
Memory at rest -- -- -- not measured

Compute -- the VM workloads (vm/benchmarks), run inside each app; time is the best of the app's own repetitions, higher ratio means Codename One is faster.

Workload Codename One Flutter Ratio
intArithmetic 492 ms wrong result Flutter: wrong result
longArithmetic 2819 ms did not run Flutter: did not run
mathTranscendental 252 ms did not run Flutter: did not run
arraySequential 128 ms 59 ms 0.46x
arrayRandom 653 ms wrong result Flutter: wrong result
objectAllocation 21 ms 16 ms 0.76x
valueEscape 80 ms 5 ms 0.06x
hashMapChurn 537 ms 157 ms 0.29x
stringBuilding 264 ms 66 ms 0.25x
recursion 272 ms 259 ms 0.95x
quicksortBench 263 ms wrong result Flutter: wrong result
Geometric mean 0.34x

Gate: within tolerance against scripts/flutter-bench/baseline; BEHIND FLUTTER on Compute (geomean of the VM workloads) (reported, not gated: a loss to Flutter on the web is currently accepted).

the JavaScript adapter needs a Chrome DevTools driver; sizes are reported and timings are not
This platform's adapter has not been exercised end to end before; treat the first published run as the thing under review.

linux

9 interleaved rounds; host load 0.16, 2.76, 2.32

Metric Codename One Flutter Ratio Winner
Installed size 110.9 MB 143.8 MB 1.30x Codename One
Executable code 13.8 MB 16.1 MB 1.17x Codename One
Download size (zipped) 80.7 MB 92.9 MB 1.15x Codename One
Cold start to first frame on screen 153 ms 230 ms 1.50x Codename One
Memory at rest 84.8 MB 225.7 MB 2.70x Codename One

Start-up and memory at rest are judged round by round: the ratio is the median of the per-round ratios, each from two launches made back to back, and the times and sizes shown are each side's median, so the ratio need not equal their quotient. Codename One was ahead in 9 of 9 rounds on cold start to first frame on screen; 9 of 9 rounds on memory at rest.

Compute -- the VM workloads (vm/benchmarks), run inside each app; time is the best of the app's own repetitions, higher ratio means Codename One is faster.

Workload Codename One Flutter Ratio
intArithmetic 74 ms 183 ms 2.47x
longArithmetic 56 ms 55 ms 0.98x
mathTranscendental 254 ms 276 ms 1.09x
arraySequential 16 ms 35 ms 2.19x
arrayRandom 295 ms 248 ms 0.84x
objectAllocation 25 ms 39 ms 1.56x
valueEscape 5 ms 7 ms 1.40x
hashMapChurn 49 ms 324 ms 6.61x
stringBuilding 35 ms 109 ms 3.11x
recursion 87 ms 258 ms 2.97x
quicksortBench 138 ms 149 ms 1.08x
Geometric mean 1.81x

Gate: within tolerance against scripts/flutter-bench/baseline. Smaller than its baseline, which does not fail the gate: Executable code -0.42%; Installed size -0.01%; Download size (zipped) -0.07% -- rebaseline to tighten. To accept the move, download this platform's baseline-<platform>.json artifact and run python3 scripts/flutter-bench/flutter_baseline.py calibrate --pr 6038 --reason "<why these moved>" baseline-linux.json, then commit the overlay it writes.

This platform's adapter has not been exercised end to end before; treat the first published run as the thing under review.

windows

9 interleaved rounds

Metric Codename One Flutter Ratio Winner
Installed size 107.3 MB 121.1 MB 1.13x Codename One
Executable code 11.1 MB 14.1 MB 1.27x Codename One
Download size (zipped) 77.7 MB 86.4 MB 1.11x Codename One
Cold start to first frame on screen 109 ms 188 ms 1.72x Codename One
Memory at rest 57.9 MB 92.2 MB 1.59x Codename One

Start-up and memory at rest are judged round by round: the ratio is the median of the per-round ratios, each from two launches made back to back, and the times and sizes shown are each side's median, so the ratio need not equal their quotient. Codename One was ahead in 9 of 9 rounds on cold start to first frame on screen; 9 of 9 rounds on memory at rest.

Compute -- the VM workloads (vm/benchmarks), run inside each app; time is the best of the app's own repetitions, higher ratio means Codename One is faster.

Workload Codename One Flutter Ratio
intArithmetic 47 ms 121 ms 2.57x
longArithmetic 35 ms 35 ms 1.00x
mathTranscendental 133 ms 151 ms 1.14x
arraySequential 6 ms 21 ms 3.50x
arrayRandom 179 ms 204 ms 1.14x
objectAllocation 12 ms 20 ms 1.67x
valueEscape 0 ms 5 ms too fast to time
hashMapChurn 28 ms 209 ms 7.46x
stringBuilding 19 ms 70 ms 3.68x
recursion 107 ms 177 ms 1.65x
quicksortBench 111 ms 119 ms 1.07x
Geometric mean 1.99x

Gate: within tolerance against scripts/flutter-bench/baseline. Smaller than its baseline, which does not fail the gate: Executable code -12.70%; Installed size -1.53%; Download size (zipped) -0.97% -- rebaseline to tighten. To accept the move, download this platform's baseline-<platform>.json artifact and run python3 scripts/flutter-bench/flutter_baseline.py calibrate --pr 6038 --reason "<why these moved>" baseline-windows.json, then commit the overlay it writes.

This platform's adapter has not been exercised end to end before; treat the first published run as the thing under review.

Codename One wins 18 of 18 measured metrics across 4 platform(s).

@shai-almog

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7a900c484b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@shai-almog

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review


P2 Badge Delete sensitive bindings when launch setup fails

When resolveDesktopTool() or launchDesktopTool() throws after this write—for example, because the Settings artifact cannot be resolved offline or the child process cannot start—the Settings process never calls ProjectIO.loadBinding(), so its consumer-side deletion cannot run. The UUID binding remains indefinitely under ~/.codenameoneSettings with every forwarded user -D property, including credentials, merely Base64-encoded; add producer-side cleanup for all pre-consumption failure paths.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@shai-almog

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: b66632a9f4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@shai-almog
shai-almog merged commit 71e550c into master Oct 17, 2026
51 of 58 checks passed
@shai-almog
shai-almog deleted the fix-settings-legacy-install branch October 17, 2026 10:37
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.

1 participant