Skip to content

Conversation

@google-labs-jules
Copy link
Contributor

This PR adds support for ReadWriteLock and ReentrantReadWriteLock to the ParparVM Java API.

Changes:

  • Added vm/JavaAPI/src/java/util/concurrent/locks/ReadWriteLock.java
  • Added vm/JavaAPI/src/java/util/concurrent/locks/ReentrantReadWriteLock.java
  • Added vm/tests/src/test/java/com/codename1/tools/translator/ReadWriteLockIntegrationTest.java covering basic locking, writer exclusion, reentrancy, and correct translation.

The implementation uses standard synchronization primitives available in the ParparVM environment. Serialization support is included with custom readObject logic to handle transient fields.


PR created automatically by Jules for task 10497757767453200611 started by @shai-almog

Implemented java.util.concurrent.locks.ReadWriteLock and ReentrantReadWriteLock in vm/JavaAPI.
Added integration tests in vm/tests/src/test/java/com/codename1/tools/translator/ReadWriteLockIntegrationTest.java.
@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

New to Jules? Learn more at jules.google/docs.

@github-actions
Copy link

github-actions bot commented Dec 24, 2025

✅ Continuous Quality Report

Test & Coverage

Static Analysis

Generated automatically by the PR CI workflow.

@shai-almog
Copy link
Collaborator

shai-almog commented Dec 24, 2025

iOS screenshot updates

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

  • 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: 266 seconds
  • Compilation Time: 52 seconds

Detailed Performance Metrics

Metric Duration
Build Time Statistics
Setup & Unzip 24947 ms
Extract Extensions 20 ms
Google Services Setup 2 ms
Scan Classes 449 ms
Extract Libs 925 ms
Inject Build Hints 26 ms
Generate Unit Tests 2 ms
Generate Stubs 908 ms
Compile Stubs 2042 ms
Generate Icons 796 ms
Prepare ParparVM 125 ms
ParparVM Execution 154354 ms
Post-VM Setup 143 ms
CocoaPods 4285 ms
Finalize 40 ms
Total Time 189065 msMaven Overhead : 77000 ms
CocoaPods Install (Script) 1000 ms
Simulator Boot (Run) 41000 ms
App Install 15000 ms
App Launch 9000 ms
Test Execution 137000 ms

Implemented java.util.concurrent.locks.ReadWriteLock and ReentrantReadWriteLock in vm/JavaAPI.
Added integration tests in vm/tests/src/test/java/com/codename1/tools/translator/ReadWriteLockIntegrationTest.java.
@github-actions
Copy link

✅ ByteCodeTranslator Quality Report

Test & Coverage

  • Tests: 151 total, 0 failed, 0 skipped

Benchmark Results

  • Execution Time: 10132 ms

  • Hotspots (Top 20 sampled methods):

    • 22.20% java.lang.String.indexOf (392 samples)
    • 17.50% com.codename1.tools.translator.Parser.isMethodUsed (309 samples)
    • 14.55% com.codename1.tools.translator.Parser.addToConstantPool (257 samples)
    • 10.48% java.util.ArrayList.indexOf (185 samples)
    • 4.87% java.lang.Object.hashCode (86 samples)
    • 3.34% java.lang.System.identityHashCode (59 samples)
    • 3.06% com.codename1.tools.translator.ByteCodeClass.calcUsedByNative (54 samples)
    • 2.15% com.codename1.tools.translator.ByteCodeClass.fillVirtualMethodTable (38 samples)
    • 1.81% com.codename1.tools.translator.BytecodeMethod.optimize (32 samples)
    • 1.30% com.codename1.tools.translator.BytecodeMethod.equals (23 samples)
    • 1.19% java.lang.Integer.getChars (21 samples)
    • 1.19% java.io.FileOutputStream.writeBytes (21 samples)
    • 1.02% com.codename1.tools.translator.Parser.generateClassAndMethodIndexHeader (18 samples)
    • 0.91% java.lang.StringBuilder.append (16 samples)
    • 0.85% java.util.TreeMap.getEntry (15 samples)
    • 0.85% java.io.FileOutputStream.open0 (15 samples)
    • 0.74% java.io.FileInputStream.open0 (13 samples)
    • 0.68% com.codename1.tools.translator.Parser.cullMethods (12 samples)
    • 0.68% com.codename1.tools.translator.BytecodeMethod.appendCMethodPrefix (12 samples)
    • 0.68% com.codename1.tools.translator.ByteCodeClass.markDependent (12 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 marked this pull request as ready for review December 24, 2025 19:05
@shai-almog shai-almog merged commit fdee96e into master Dec 24, 2025
13 of 14 checks passed
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