Skip to content

Update HelloCodenameOne to use Java 17 and add Java 17 language test#4588

Closed
shai-almog wants to merge 9 commits intomasterfrom
codex/update-hellocodenameone-for-java-17
Closed

Update HelloCodenameOne to use Java 17 and add Java 17 language test#4588
shai-almog wants to merge 9 commits intomasterfrom
codex/update-hellocodenameone-for-java-17

Conversation

@shai-almog
Copy link
Collaborator

Motivation

  • Move the HelloCodenameOne sample to Java 17 so developers can use modern language features in the sample and tests.
  • Provide a small unit test that verifies Java 17 syntax (features that do not require new API surface) compiles and runs under the sample test harness.

Description

  • Updated project-level properties in scripts/hellocodenameone/pom.xml to set java.version, java-tests.version, compiler source/target, and kotlin.compiler.jvmTarget to 17.
  • Updated platform module POMs (javase, android, ios, javascript, win) to set maven.compiler.source/target to 17.
  • Changed scripts/hellocodenameone/common/codenameone_settings.properties to request Java 17 (codename1.arg.java.version=17).
  • Enhanced run/build scripts on Unix and Windows (run.sh/build.sh, run.bat/build.bat) to prefer and export a JDK 17 JAVA_HOME when available before invoking the Maven wrapper.
  • Added Java17LanguageFeaturesTest under scripts/hellocodenameone/common/src/test/java/... that exercises var, switch expression, and text blocks to validate Java 17 language compilation in tests.
  • Documented the Java 17 requirement in scripts/hellocodenameone/README.adoc.

Testing

  • Ran bash ./run.sh help in scripts/hellocodenameone and it printed help successfully (passed).
  • Ran bash ./build.sh help in scripts/hellocodenameone and it printed help successfully (passed).
  • Attempted cd scripts/hellocodenameone && ./mvnw -pl common -DskipTests=false test -Dcodename1.platform=javase which failed in this environment due to the Maven wrapper bootstrap encountering a network error while resolving the wrapper distribution (failed here due to environment/network).
  • Attempted cd scripts/hellocodenameone && mvn -pl common -DskipTests=false test -Dcodename1.platform=javase which failed because com.codenameone:codenameone-maven-plugin:8.0-SNAPSHOT could not be resolved from configured repositories (plugin resolution failure in this environment).

Codex Task

@github-actions
Copy link

github-actions bot commented Mar 5, 2026

✅ Continuous Quality Report

Test & Coverage

Static Analysis

Generated automatically by the PR CI workflow.

@shai-almog
Copy link
Collaborator Author

shai-almog commented Mar 5, 2026

Compared 32 screenshots: 32 matched.

Native Android coverage

  • 📊 Line coverage: 7.30% (3711/50862 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 5.65% (18061/319659), branch 2.75% (857/31113), complexity 3.40% (1011/29741), method 5.98% (828/13853), class 9.63% (176/1827)
    • 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/712 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: 7.30% (3711/50862 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 5.65% (18061/319659), branch 2.75% (857/31113), complexity 3.40% (1011/29741), method 5.98% (828/13853), class 9.63% (176/1827)
    • 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/712 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)

@github-actions
Copy link

github-actions bot commented Mar 5, 2026

✅ ByteCodeTranslator Quality Report

Test & Coverage

  • Tests: 146 total, 0 failed, 2 skipped

Benchmark Results

  • Execution Time: 9494 ms

  • Hotspots (Top 20 sampled methods):

    • 20.74% java.lang.String.indexOf (343 samples)
    • 18.62% com.codename1.tools.translator.Parser.isMethodUsed (308 samples)
    • 11.49% java.util.ArrayList.indexOf (190 samples)
    • 8.46% com.codename1.tools.translator.Parser.addToConstantPool (140 samples)
    • 4.17% com.codename1.tools.translator.ByteCodeClass.calcUsedByNative (69 samples)
    • 4.11% java.lang.Object.hashCode (68 samples)
    • 3.26% com.codename1.tools.translator.BytecodeMethod.addToConstantPool (54 samples)
    • 2.60% com.codename1.tools.translator.BytecodeMethod.optimize (43 samples)
    • 2.42% java.lang.System.identityHashCode (40 samples)
    • 1.75% com.codename1.tools.translator.Parser.generateClassAndMethodIndexHeader (29 samples)
    • 1.69% com.codename1.tools.translator.BytecodeMethod.equals (28 samples)
    • 1.33% com.codename1.tools.translator.ByteCodeClass.markDependent (22 samples)
    • 1.09% com.codename1.tools.translator.ByteCodeClass.fillVirtualMethodTable (18 samples)
    • 1.03% com.codename1.tools.translator.Parser.cullMethods (17 samples)
    • 1.03% java.lang.StringBuilder.append (17 samples)
    • 0.85% sun.nio.ch.FileDispatcherImpl.write0 (14 samples)
    • 0.85% sun.nio.fs.UnixNativeDispatcher.open0 (14 samples)
    • 0.60% com.codename1.tools.translator.BytecodeMethod.appendCMethodPrefix (10 samples)
    • 0.60% java.lang.StringCoding.encode (10 samples)
    • 0.54% java.io.UnixFileSystem.getBooleanAttributes0 (9 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.

@shai-almog shai-almog closed this Mar 5, 2026
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.

1 participant