Skip to content

Conversation

@google-labs-jules
Copy link
Contributor

This change addresses multiple SpotBugs warnings of type SBSC_USE_STRINGBUFFER_CONCATENATION ("Method concatenates strings using + in a loop").

Changes include:

  • Refactoring Java code in CodenameOne/src to use StringBuilder for loop-based concatenation in:
    • com.codename1.ads.InnerActive.java
    • com.codename1.facebook.FaceBookAccess.java
    • com.codename1.io.Log.java
    • com.codename1.io.Oauth2.java
    • com.codename1.io.Util.java
    • com.codename1.properties.PropertyXMLElement.java
    • com.codename1.testing.TestUtils.java
    • com.codename1.ui.ComponentSelector.java
    • com.codename1.ui.Container.java
    • com.codename1.ui.TextArea.java
    • com.codename1.ui.html.CSSEngine.java
    • com.codename1.ui.html.HTMLComponent.java
    • com.codename1.ui.html.HTMLElement.java
    • com.codename1.ui.html.HTMLForm.java
    • com.codename1.ui.html.HTMLInputFormat.java
    • com.codename1.ui.html.ResourceThreadQueue.java
    • com.codename1.ui.plaf.DefaultLookAndFeel.java
    • com.codename1.xml.Element.java
    • com.codename1.xml.XMLParser.java
  • Updating .github/scripts/generate-quality-report.py to treat SBSC_USE_STRINGBUFFER_CONCATENATION as a build failure condition.

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

Replaced string concatenation in loops with StringBuilder in multiple files to improve performance and satisfy SpotBugs checks.
Updated .github/scripts/generate-quality-report.py to fail on this violation.
@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.

@shai-almog
Copy link
Collaborator

shai-almog commented Dec 28, 2025

Compared 30 screenshots: 30 matched.

Native Android coverage

  • 📊 Line coverage: 24.44% (2618/10711 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 24.21% (12226/50505), branch 15.12% (706/4668), complexity 17.21% (729/4237), method 32.40% (589/1818), class 34.32% (104/303)
    • Lowest covered classes
      • com.codename1.impl.android.com.codename1.impl.android.AndroidContactsManager – 0.00% (0/400 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidImplementation$Video – 0.00% (0/168 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.IntentIntegrator – 0.00% (0/139 lines covered)
      • com.codename1.impl.android.util.com.codename1.impl.android.util.Base64 – 0.00% (0/117 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidImplementation$SocketImpl – 0.00% (0/77 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidTextureView – 0.00% (0/76 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidSurfaceView – 0.00% (0/73 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.LocalNotificationPublisher – 0.00% (0/65 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.FridaDetectionUtil – 0.00% (0/64 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.PushNotificationService – 0.00% (0/59 lines covered)

✅ Native Android screenshot tests passed.

Native Android coverage

  • 📊 Line coverage: 24.44% (2618/10711 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 24.21% (12226/50505), branch 15.12% (706/4668), complexity 17.21% (729/4237), method 32.40% (589/1818), class 34.32% (104/303)
    • Lowest covered classes
      • com.codename1.impl.android.com.codename1.impl.android.AndroidContactsManager – 0.00% (0/400 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidImplementation$Video – 0.00% (0/168 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.IntentIntegrator – 0.00% (0/139 lines covered)
      • com.codename1.impl.android.util.com.codename1.impl.android.util.Base64 – 0.00% (0/117 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidImplementation$SocketImpl – 0.00% (0/77 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidTextureView – 0.00% (0/76 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidSurfaceView – 0.00% (0/73 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.LocalNotificationPublisher – 0.00% (0/65 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.FridaDetectionUtil – 0.00% (0/64 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.PushNotificationService – 0.00% (0/59 lines covered)

Refactored code to use StringBuilder in loops to prevent string concatenation performance issues.
Updated .github/scripts/generate-quality-report.py to treat SBSC_USE_STRINGBUFFER_CONCATENATION as a build failure.
Replaced string concatenation in loops with StringBuilder in multiple files to improve performance and satisfy SpotBugs checks.
Updated .github/scripts/generate-quality-report.py to fail on this violation.
Fixed compilation errors in ComponentSelector and InnerActive by calling toString() before indexOf/substring on StringBuilder, as CN1's StringBuilder lacks these methods.
@shai-almog
Copy link
Collaborator

shai-almog commented Dec 28, 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: 285 seconds
  • Compilation Time: 63 seconds

Detailed Performance Metrics

Metric Duration
Build Time Statistics
Setup & Unzip 24397 ms
Extract Extensions 17 ms
Google Services Setup 3 ms
Scan Classes 448 ms
Extract Libs 1068 ms
Inject Build Hints 29 ms
Generate Unit Tests 5 ms
Generate Stubs 952 ms
Compile Stubs 2256 ms
Generate Icons 920 ms
Prepare ParparVM 115 ms
ParparVM Execution 170405 ms
Post-VM Setup 147 ms
CocoaPods 4404 ms
Finalize 21 ms
Total Time 205188 msMaven Overhead : 80000 ms
CocoaPods Install (Script) 1000 ms
Simulator Boot (Run) 46000 ms
App Install 18000 ms
App Launch 6000 ms
Test Execution 141000 ms

Replaced string concatenation in loops with StringBuilder in multiple files to improve performance and satisfy SpotBugs checks.
Updated .github/scripts/generate-quality-report.py to fail on this violation.
Fixed compilation errors in ComponentSelector and InnerActive by calling toString() before indexOf/substring on StringBuilder, as CN1's StringBuilder lacks these methods.
@github-actions
Copy link

✅ Continuous Quality Report

Test & Coverage

Static Analysis

Generated automatically by the PR CI workflow.

@shai-almog shai-almog marked this pull request as ready for review December 28, 2025 12:30
@shai-almog shai-almog merged commit 42acf97 into master Dec 28, 2025
13 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