Repository navigation
Swing, SwingX and JavaFX compatibility layers: desktop Java apps as Codename One apps - #5980
shai-almog wants to merge 12 commits into
Conversation
|
Developer Guide build artifacts are available for download from this workflow run:
Developer Guide quality checks: |
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
✅ Continuous Quality ReportTest & Coverage
Static Analysis
Generated automatically by the PR CI workflow. |
Cloudflare Preview
|
There was a problem hiding this comment.
💡 Codex Review
CodenameOne/maven/compat-jdk/src/main/java/com/codename1/compat/jdk/File.java
Lines 261 to 262 in 61cd902
On the device filesystem this method changes no permissions, yet for every existing file it reports that making the file read-only succeeded while canWrite() continues to return true. Code that checks the return value may therefore assume sensitive or finalized data is protected when it remains writable; return false when the requested state cannot be established.
ℹ️ 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".
|
Compared 206 screenshots: 206 matched. Benchmark ResultsDetailed Performance Metrics
ParparVM vs HotSpot (JDK 25): Windows x64Runner CPU: AMD64 Family 26 Model 2 Stepping 1, AuthenticAMD (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in
Result: no regression |
✅ ByteCodeTranslator Quality ReportTest & Coverage
Benchmark Results
Static Analysis
Generated automatically by the PR CI workflow. |
|
Compared 206 screenshots: 206 matched. Benchmark ResultsDetailed Performance Metrics
ParparVM vs HotSpot (JDK 25): Windows arm64Runner CPU: ARMv8 (64-bit) Family 8 Model D49 Revision 0, MICROSOFT CORPORATION (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in
Result: no regression |
|
Compared 184 screenshots: 184 matched. |
|
Compared 12 screenshots: 12 matched. |
|
Compared 191 screenshots: 191 matched. Native Android coverage
✅ Native Android screenshot tests passed. Native Android coverage
Benchmark ResultsDetailed Performance Metrics
|
|
Compared 206 screenshots: 206 matched. ParparVM vs HotSpot (JDK 25): Linux x64Runner CPU: AMD EPYC 9V74 80-Core Processor (baseline 1 improvement past the baseline (not a failure; rebaseline to lock it in):
Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in
A change that moves performance ON PURPOSE records the new baseline in Result: no regression (improved past the baseline: consider rebaselining) |
|
Compared 206 screenshots: 206 matched. ParparVM vs HotSpot (JDK 25): Linux arm64Runner CPU: Neoverse-N2 (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in
Result: no regression |
|
Compared 227 screenshots: 227 matched. |
|
Compared 206 screenshots: 206 matched. Benchmark ResultsDetailed Performance Metrics
|
|
Compared 249 screenshots: 249 matched. |
|
Compared 188 screenshots: 188 matched. Benchmark Results
Detailed Performance Metrics
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
CodenameOne/maven/compat-jdk/src/main/java/com/codename1/compat/jdk/File.java
Lines 293 to 301 in 4a287d0
When two threads use createNewFile() for the same path, both can observe that it does not exist and both then open it for output, so both return true and the later open may truncate data written by the first caller. Desktop code commonly relies on this method's atomic create semantics for lock and sentinel files; serialize the check-and-create operation at least within the application process, or use an exclusive-create primitive where the port provides one.
When appending to a file larger than Integer.MAX_VALUE, narrowing its length to int wraps the offset before it is passed to FileSystemStorage. Depending on the port this either fails or writes at an earlier position and corrupts the existing file instead of appending; since the underlying API cannot express larger offsets, detect this case and fail explicitly rather than truncating the position.
ℹ️ 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".
|
Compared 192 screenshots: 192 matched. Benchmark Results
Detailed Performance Metrics
ParparVM vs HotSpot (JDK 25): macOS arm64Runner CPU: Apple M1 (Virtual) (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in
Result: no regression |
|
Compared 189 screenshots: 189 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 534d0f01fc
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9919796706
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
CodenameOne/maven/compat-jdk/src/main/java/com/codename1/compat/jdk/File.java
Lines 326 to 327 in ec52692
For every remapped desktop application, File.deleteOnExit() silently does nothing, so temporary files that callers expect to be removed during normal termination remain in the application sandbox across launches. This can steadily consume storage and retain sensitive temporary data even when the app terminates through the orderly JdkSystem.exit path, which already runs shutdown hooks. Record requested paths and delete them during that exit sequence instead of returning without registering any cleanup.
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8b053d6629
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 89cb8679b1
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e4ccd77277
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
This overload does not validate cbuf, off, and len before calling read(). With an invalid range such as read(new char[1], 2, 1), it consumes one character and only then throws when assigning to the array, whereas Reader.read must reject the range without changing the stream; the len == 0 fast path also incorrectly accepts null buffers and invalid offsets. Perform the standard null and bounds checks before reading.
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
When a parsed day, hour, or minute field overflows while being converted to seconds, these unchecked operations wrap to an unrelated duration. For example, Duration.parse("P106751991167301D") returns a large negative duration here, while the JDK reports a DateTimeParseException; use checked multiplication and addition throughout this parsing block and translate arithmetic overflow into a parse failure. The mirrored vm/JavaAPI implementation has the same issue.
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cfb5423474
ℹ️ 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".
Flutter vs Codename OneSame 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. android9 interleaved rounds; host load 0.42, 1.79, 1.52
Compute -- the VM workloads (
Gate: within tolerance against
ios9 interleaved rounds; host load 34.08, 26.33, 20.58
Compute -- the VM workloads ( Not measured: iOS compute is not measured: a device build needs signed hardware, and on the simulator Flutter runs its JIT debug engine rather than AOT code. The macOS row runs the same ParparVM and Dart AOT compilers on the same Apple silicon. Gate: within tolerance against
javascript9 interleaved rounds; host load 1.84, 1.06, 0.47
Compute -- the VM workloads (
Gate: within tolerance against
linux9 interleaved rounds; host load 0.23, 2.82, 2.41
Compute -- the VM workloads (
Gate: within tolerance against
macos9 interleaved rounds; host load 7.83, 21.2, 24.16
Compute -- the VM workloads (
Gate: within tolerance against
windows9 interleaved rounds
Compute -- the VM workloads (
Gate: within tolerance against
Codename One wins 26 of 26 measured metrics across 6 platform(s). |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
CodenameOne/Ports/CLDC11/src/java/io/BufferedInputStream.java
Lines 182 to 184 in 3b5fe83
When the underlying stream reports Integer.MAX_VALUE available bytes while this buffer still contains unread data, the addition wraps and returns a negative number. This can occur with files larger than 2 GiB or custom streams and causes callers to treat available data as absent or use an invalid allocation size; perform the addition as a long and cap the result at Integer.MAX_VALUE.
CodenameOne/Ports/CLDC11/src/java/io/BufferedReader.java
Lines 186 to 189 in 3b5fe83
After readLine() stops at \r, skipLf may be true with only the matching \n left in the buffer. This method then reports true because that discarded character is buffered, even when the underlying reader is not ready; the next read() consumes the \n internally and can block, violating the guarantee made by ready(). Consume the pending LF before deciding whether a returnable character is available.
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b9f0a19b0c
ℹ️ 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".
| } | ||
| } | ||
| if (started != null) { | ||
| started.start(); |
There was a problem hiding this comment.
Roll back registrations when Thread.start() fails
When a custom ThreadFactory returns an already-started thread, or Thread.start() otherwise throws, this call runs after both the command and thread have been registered but removes neither. In a single-thread pool, the stale thread then occupies the sole worker slot, so the task never runs and the executor cannot terminate after shutdown(); the new rollback around factory.newThread(...) does not cover this later failure path.
Useful? React with 👍 / 👎.
| || c >= 0x370 && c <= 0x3ff && c != 0x37e && c != 0x387 && c != 0x375 | ||
| && c != 0x384 && c != 0x385 && c != 0x3f6 // Greek |
There was a problem hiding this comment.
Exclude unassigned code points from letter ranges
This broad Greek range includes reserved holes that Unicode classifies as unassigned. For example, U+0378 reaches this branch, so getType returns OTHER_LETTER and isLetter, isJavaIdentifierStart, and isDefined all return true, while the JDK returns false or UNASSIGNED; code validating identifiers or assigned characters can therefore accept reserved characters.
Useful? React with 👍 / 👎.
| coords.add(group + ":" + artifact); | ||
| ("provided".equals(scope) ? provided : shipped).add(group + ":" + artifact); | ||
| String version = element(dep.group(1), "version"); | ||
| version = version == null ? null : resolveIn(version, pom, poms); |
There was a problem hiding this comment.
Resolve inherited versions using child property overrides
When a dependency inherited from a parent uses a property that the child overrides, pom here is the parent's text, so resolveIn resolves the parent's own value before consulting the child POM in poms. Maven instead interpolates the effective inherited dependency with the child's property—for example, a parent dependency using ${lib.version} should use 2 when the child overrides the parent's value 1—so the importer currently adds the wrong dependency version to the application build.
Useful? React with 👍 / 👎.
| Runnable release = held.get(i); | ||
| try { | ||
| release.run(); | ||
| } catch (RuntimeException e) { |
There was a problem hiding this comment.
Continue releasing flat-map streams after Errors
When a short-circuiting terminal operation closes several nested flatMap streams and the most recently opened stream's close handler throws an Error, this catch does not intercept it, so the loop exits before the earlier mapped streams are closed. This can skip resource-release handlers that the JDK runs while unwinding nested flat maps; catch Throwable and retain the first failure as close() already does.
Useful? React with 👍 / 👎.
| due.set(due.get() + rate); | ||
| arm(due.get() - System.currentTimeMillis()); |
There was a problem hiding this comment.
Saturate fixed-rate deadline arithmetic
When a fixed-rate period is large enough that adding it to the absolute deadline overflows, the next deadline wraps into the past and is armed with a nonpositive delay. For example, a zero-delay task with a period of Long.MAX_VALUE milliseconds repeatedly fires immediately instead of waiting effectively forever, potentially creating a busy loop; saturate the absolute deadline or track the remaining relative delay without overflowing.
Useful? React with 👍 / 👎.
|
|
||
| /// The paths under `start`, `start` first, depth first, to `maxDepth` | ||
| /// levels below it. | ||
| public static Stream<Path> walk(Path start, int maxDepth, FileVisitOption... options) throws IOException { |
There was a problem hiding this comment.
Reject null file-visit options
When callers pass a null options array or a null element, this method ignores it and starts traversing, whereas Files.walk must throw NullPointerException for either input. This silently accepts invalid configuration and may touch the filesystem before the caller discovers anything is wrong; validate the varargs even though FOLLOW_LINKS itself has no effect on this platform. find below has the same omission.
Useful? React with 👍 / 👎.
* Add pure-logic Java class library additions to JavaAPI and CLDC11
java.util.function, java.util.stream, java.time, java.text, collections,
java.util.concurrent, non-file java.io streams, java.lang members,
MessageDigest/SecureRandom, charsets and UUID. Host-backed APIs (files,
nio.file, prefs, logging, URL, resource bundles, service loader, modules)
are left as on master. JdkHost is a narrow internal hook.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Install the narrow JdkHost from the ParparVM ports
CoreJdkHost serves the EDT waits, log, secure random, digests and locale
number symbols; JavaSE and Android carry a copy of JdkHost for the core.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Translator runtime support and bulk conformance tests for the class library
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Rewrite every String regex member onto com.codename1.util.regex
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Java API additions: review fixes and CI root causes
- No object serialization: ObjectInput, ObjectOutput and Externalizable are
back to master's empty interfaces in vm/JavaAPI and gone from Ports/CLDC11.
- Concurrency reads one monotonic clock (BlockingWait.now, System.nanoTime)
for every deadline and delay, so a wall-clock change cannot fire a timed
wait or a scheduled task early or late.
- A positive timeout under a millisecond is rounded up instead of being
due immediately (BlockingWait.millis), at every timed call site.
- FutureTask consumes the runner's interrupt only when cancel(true)
delivered it; cancel(false) leaves the thread's status alone.
- Character: the unassigned Greek code points are not letters.
- CoreJdkHost finds the locale's separators between any script's decimal
digits, not only ASCII ones.
- Bulk checks: sub-millisecond timed get, cancel(false) interrupt status.
- CI: copyright exclusions for the Harmony/OpenJDK-derived classes, the
backend javadoc run no longer documents the class library's internal
com.codename1.impl, CodeQL no longer resolves the JDK's SecureRandom to
the device class library's copy, and the flutter-bench size overlay.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Java API additions: second round of review fixes
- Duration.dividedBy is exact past 292 years: the magnitude is divided as
an unsigned 128-bit number when the nanosecond count overflows a long.
- Character: the unassigned CJK compatibility code points are not letters.
- Math.scalb's clamp counts all 53 (24) significand bits, so an extreme
negative factor underflows to a signed zero; cbrt scales subnormals.
- ScheduledPool saturates a fixed rate's next deadline and consumes only
the interrupt cancel(true) delivered.
- PrintWriter.checkError reports a wrapped PrintWriter's failure.
- Matcher stays exhausted after a zero-width match at the region end.
- Bulk checks for each, and MatcherExhaustionTest.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Java API additions: third round of review fixes and baselines
- tanh: Lambert continued fraction for |x| < 1 (within 1.05 ulp).
- String(byte[], int, int, ...): range checked before the native reads it.
- Pool: a worker thread that fails to start gives its slot back.
- Character: CJK extension ranges split at their unassigned gaps.
- Recalibrate the Linux flutter size row and the windows-arm64 hello RAM row.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Java API additions: fourth round of review fixes and baselines
- CompletableFuture: completions drain a per-thread queue, so a long
chain cannot overflow the stack; a waiter that times out or is
interrupted is taken off the stack.
- Character: script letters are a table generated from JDK 21's data.
- StringBuffer.compareTo: snapshots the other buffer, no nested locks.
- DateTimeFormatter: each X/x/Z width parses only its own offset form.
- Math.hypot: compensated, within 1 ulp.
- ScheduledPool: re-checks cancellation after claiming the runner.
- Recalibrate the Linux flutter size row and the linux-x64 translator RAM row.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Java API additions: fifth round of review fixes
- Locale.forLanguageTag: only '-' separates subtags.
- MessageFormat: clone keeps, and equals compares, formats the pattern
cannot spell.
- Collectors.flatMapping: the consuming failure wins, close's is suppressed.
- StreamState.abandon: releases every stage after an Error too.
- CountDownLatch.await: throws for an interrupted caller on an open latch.
- Comments on why the pool's workers survive a failed task and why
CharSequence streams read eagerly.
- Recalibrate the Linux flutter size row.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Java API additions: sixth round of review fixes
- Regex: ? and {0,1} take their one round of a group that can only match
empty, so "(^)?" captures the empty string, as the JDK does.
- ZoneId.of: a region ID starts with a letter.
- InputStreamReader/OutputStreamWriter.getEncoding: null once closed.
- BufferedWriter.close: the flush failure wins, close's is suppressed.
- DecimalFormatSymbols: comment on why US NaN stays U+FFFD (JDK 8).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Java API additions: seventh round of review fixes
- Pool.execute: a command that needs a new worker is handed to it, never
queued, so a thread that fails to start cannot leave it run by another;
a command queued meanwhile gets a replacement worker.
- BufferedOutputStream.close: the flush failure wins, close's is suppressed.
- ScheduledPool: deadlines saturate, so a huge delay is not already due.
- Collectors: identity-finish collectors report IDENTITY_FINISH, toSet
also UNORDERED.
- CopyOnWriteArrayList.addAll: snapshot the source before locking.
- PrintWriter: an InterruptedIOException re-interrupts the thread.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Java API review fixes: URI query split, null arguments, ill-formed locale tags
- URI splits the query at the first '?', so later ones stay in the query.
- String charset-name overloads, Clock.fixed and SecureRandom's seed array
refuse null as the JDK does.
- Locale.toLanguageTag writes und for an ill-formed language and drops an
ill-formed region.
- Comments on why String.lines stays eager and why a negative grouping
size is accepted (JDK 8 to 18 behaviour).
- windows-x64 hello RAM perf baseline recalibrated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Java API review fixes: FutureTask run-once, ranges, overflow, reentrant removeIf
- FutureTask records the outcome before releasing the runner, so a
concurrent run() cannot call the task twice, and no longer clears an
interrupt that may not be the cancellation's.
- String.indexOf(int, int, int) searches a supplementary code point as
its pair and requires it wholly inside the range.
- UUID.fromString refuses a component past Long.MAX_VALUE.
- CopyOnWriteArrayList.removeIf keeps a predicate's own change and throws
ConcurrentModificationException instead of overwriting it.
- PrintWriter refuses a null Writer.
- Comment on why an unstarted worker still runs its first task after
shutdownNow (ThreadPoolExecutor does the same).
- Linux flutter size baseline recalibrated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Java API review fixes: ISO offsets, negative zero year, addAllAbsent lock order
- ISO offset parsing refuses the compact +HHMM and +HHMMss forms.
- An ISO date refuses the year -0000.
- CopyOnWriteArrayList.addAllAbsent snapshots its source before locking,
as addAll does, so two lists adding each other cannot deadlock.
- Comments on why an empty ChoiceFormat alternative keeps the JDK 8
answer and why Matcher.results does not fail fast on misuse.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Java API review fixes: zero multiplier parse, null buffers, variants, RandomAccess
- DecimalFormat with a zero multiplier parses zero as NaN and anything
else as an infinity, instead of returning the number unchanged.
- BufferedReader and BufferedWriter refuse a null delegate.
- Locale.toLanguageTag leaves out a variant that cannot be written as a
private-use subtag.
- List.reversed() of a RandomAccess list is RandomAccess too.
- Conformance checks, including that sharp s keeps its case.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Java API review fixes: List/Set spliterator characteristics, chunked String writes
- List's default spliterator reports ORDERED and Set's DISTINCT.
- BufferedWriter.write(String, int, int) copies through its own buffer a
chunk at a time instead of allocating a copy of the whole range.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Java API review fixes: scheduled cancel race, runAndReset, allOf, edge cases
- ScheduledPool: cancel(true) re-checks the runner while marked
INTERRUPTING and the run waits that out on leaving, so an interrupt can
no longer reach a worker that has moved on to another task.
- FutureTask.runAndReset records a failure before releasing the runner.
- CompletableFuture.allOf copies the caller's array.
- Instant.until(MILLIS) works from the deltas, so instants near MIN and
MAX no longer overflow.
- StringBuilder.repeat with a zero count returns before validating.
- windows-arm64 translator RAM perf baseline recorded as measured.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Java API review fixes: adapter characteristics, CharSequence.compare, null streams
- Collectors.mapping, filtering and flatMapping keep the downstream
collector's characteristics; collectingAndThen drops only
IDENTITY_FINISH.
- CharSequence.compare uses a Comparable type's own order when both
arguments are of that type.
- InputStreamReader and OutputStreamWriter refuse a null stream in their
Charset constructors.
- RAM perf baselines recorded as measured for linux-x64, windows-x64 and
macos-arm64, which all improved on new runner CPUs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Java API review fixes: backtracking \R, continued property keys, close on Error
- \R in the regex engine is no longer atomic, so a CR LF pair splits
when what follows needs the LF (\R\R matches CR LF, as Java 9+ does).
- Properties.load takes an = or : on the line after a key ended by
blanks and a continuation.
- BufferedOutputStream and BufferedWriter close the delegate when
flushing throws an Error.
- Comment on why the Matcher replace callbacks do not fail fast.
- Linux flutter size baseline recalibrated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Java API review fixes: URI relative references, sorted spliterators, leap seconds
- URI: a reference without a scheme is not absolute (resolve() handed every
relative reference back unresolved), an empty path is "" not null, a
relative path merges with the base directory, and normalize() keeps the
path's own leading and trailing slashes.
- Spliterators: an iterator spliterator declared SORTED reports natural order.
- ISO instants: only 23:59:60 is a leap second.
- DecimalFormat: a null affix is stored, as JDK 8 stores it.
- Charset copies its alias array; deadlines are overflow safe for any clock
origin.
- Comments for the ideographic blocks and BufferedWriter locking.
- windows-arm64 hello RAM baseline.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Java API review fixes: concat null checks, fixed-rate deadlines, removeIf
- Int/Long/DoubleStream.concat check both arguments before consuming one.
- ScheduledPool: the fixed-rate step is overflow safe for any clock origin,
and shutdownNow() no longer answers a fixed-rate task twice when its
wrapper is already queued in the pool.
- CopyOnWriteArrayList.removeIf throws ConcurrentModificationException when
the predicate changed the list, as filter() does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Java API review fixes: null checks, invokeAll validation, immutable sublists
- PrintWriter refuses a null OutputStream at construction.
- invokeAll wraps every task, refusing a null, before submitting any.
- Period.addTo/subtractFrom refuse a null temporal even for a zero period.
- List.of(...).subList is an immutable copy, so clear() on an empty range
still throws.
- Comments for PrintWriter locking and recursive computeIfAbsent (JDK 8).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Java API review fixes: close suppression, removeIf check order, subList IAE
- BufferedWriter/BufferedOutputStream.close attach a delegate close failure
of any kind to the flush failure instead of losing the original.
- CopyOnWriteArrayList.removeIf checks for a reentrant change before its
nothing-removed return.
- List.of(...).subList throws IllegalArgumentException for reversed bounds.
- Comments for the MessageFormat argument ceiling (JDK 8 has none) and the
default uncaught-exception handler field.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Java API review fixes: failures skip the executor, X- charsets, unordered set
- CompletableFuture: thenApply/thenAccept/thenRun/thenCompose (async) pass
an upstream failure on at once instead of submitting a step a shut-down
executor would reject in its place.
- Charset.isRegistered is false for the reserved X- prefix.
- Collectors.toUnmodifiableSet reports UNORDERED.
- A note at the NaN canonicalization on the raw-bits methods sharing it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Java API review fixes: variant tags, date literals, stream and regex order
- Locale.toLanguageTag writes the well-formed leading variant subtags as
they are and only the rest as x-lvariant, as JDK 8 does.
- SimpleDateFormat (and MessageFormat date arguments) check each literal.
- URI.normalize keeps an unmatched ".." without adding a slash.
- Stream.collect checks the stream's state before calling the supplier.
- The rewritten String regex members check the receiver first.
- Comment: a terminated shutdown hook is accepted, as on JDK 8.
- windows-x64 (AMD family 26) baseline from a second sample.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Java API review fixes: allOf/anyOf null checks, runner release, characteristics
- CompletableFuture.allOf/anyOf check every input before installing any
callback.
- FutureTask releases its runner even when done() throws.
- Int/Long/DoublePipeline.collect check the stream before the supplier.
- groupingBy reports IDENTITY_FINISH when its downstream does.
- String.indexOf(int,int,int) answers -1 for a value that is no code point.
- The literal split shortcut leaves a lone surrogate to the engine.
- Comments: partitioningBy is never IDENTITY_FINISH; the sharp s is below
the Latin-1 upper-casing range.
- Perf rows for linux-x64 EPYC and windows-x64 Intel from this run.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Java API review fixes: prefixed zone syntax, yield interrupt, CLDC parity
ZoneId.of validates the region syntax of a UTC/GMT/UT-prefixed ID with
no sign; Thread.yield leaves the interrupt status set; COWAL removeAll
and retainAll check for a reentrant change before the nothing-removed
return. The CLDC DateTimeFormatter accepts a leap second only at 23:59,
and the CLDC ScheduledPool.shutdownNow no longer lists an owed fixed-rate
firing twice. Duration.ZERO.addTo(null) stays as JDK 8 has it.
Flutter linux download-size baseline moved by 2 bytes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Java API review fixes: authority-only resolve, runAndReset release, CHM views
URI.resolve puts a root slash before a relative path merged onto a base
with an authority and an empty path, so "a" against http://h is
http://h/a, not http://ha. FutureTask.runAndReset releases its runner
even when done() throws. ConcurrentHashMap's values view rejects a null
query and the plain keySet view rejects addAll even for an empty input.
The android-compat test cleanup resets dark mode and refreshes the
configuration, which a test order that ran ResumeConfigurationTest
first left dark.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Java API review fixes: URI scheme grammar, ZZZZ parse, weak-map lookup
URI rejects a colon in the first segment of a relative path, and a
scheme must start with a letter and may hold "+" and "." (svn+ssh).
DateTimeFormatter parses ZZZZ as the localized GMT offset it prints.
WeakHashMap compares with the queried key's equals. Properties keeps the
empty entry a last line of only a backslash makes. The perf overlay
drops three rows master's pr/6045.json already re-recorded from the same
value, which the baseline gate refuses to see twice.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Java API review fixes: full localized offset, stats toString, done stages
OOOO and ZZZZ parse only the full localized offset (GMT+08:00), as the
JDK does. Int/Long/DoubleSummaryStatistics print the JDK's summary. A
CompletableFuture dependent completed by hand skips its action. A
reversed view hands bulk changes to the backing list, so an unmodifiable
one refuses even a no-op. NavigationTest uninstalls its static dispatcher
and LocalContinuityTest clears it: one left behind answered a Form for
any route and made an unknown route restorable. linux-x64
objectAllocation RAM recorded lower.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Java API review fixes: extreme instants, aggregate time conflicts, Month, combined stages
Instant.parse round-trips Instant.MIN/MAX, N/A fields conflict-check
against component fields, a bare Month formats, and thenCombine /
applyToEither skip their action once the dependent is done.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Java API review fixes: day-of-year conflicts, bound spliterators, atomic addAllAbsent, script letters
Word boundaries take counted quantifiers, a day-of-year is checked
against the resolved date, the first estimateSize binds a collection
spliterator, addAllAbsent publishes once, and the script letter table
covers its blocks whole. Records the linux Flutter size and the linux
arm64 translator RAM moves.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Java API review fixes: extlang subtags, CHM entry-set add, racy blockUi check
forLanguageTag reads extended language subtags, ConcurrentHashMap's
entry set writes through on add, and the blockUi conformance check
expects a second blocking wait only when the join really waits.
Records the linux Flutter size and linux x64 translator RAM moves.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Java API review fixes: custom temporal units, parse past the end, snippet name clash
TemporalUnit.isSupportedBy probes like the JDK instead of recursing,
DateFormat.parse fails cleanly at a start past the end, and the
Playground's auto-import prefers the one Codename One class when the
device library adds a JDK class of the same name (SecureRandom,
Temporal). Drops seven doc-snippet baseline entries that now run and
records the linux x64 stringBuilding and windows x64 translator moves.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Unmodifiable lists reject every mutation, stack traces print suppressed throwables
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Map.of views reject clear, initializr build test prints the end of a failed build
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Offset-only parses, MessageFormat clones its subformats, async stages use defaultExecutor
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* usePattern keeps zero-width advancement, reversed views snapshot aliased input
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Zero offsets print as zero, ISO instants need offset minutes, U+180E is not white space
Drops the windows-x64 recursion rebaseline that master's baseline fold superseded.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* A continuation can join a nested dependent, CHM view removeIf keeps replaced mappings
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Regex by code point with Unicode tables; randomUUID needs a secure source
- Pattern matches, repeats and backtracks by code point, so "." and a
class take a whole surrogate pair, and classes hold code points above
U+FFFF.
- Scripts, blocks and general categories, and UNICODE_CHARACTER_CLASS
((?U)), are answered from the generated Unicode 15.0 tables in
UnicodeTables rather than refused.
- UUID.randomUUID throws without a secure random source instead of
falling back to a clock-seeded generator.
- ChoiceFormat writes an infinite limit as "<" explicitly rather than
through a NaN comparison ParparVM answers differently.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* PMD fixes in the regex engine; rebaseline Flutter size for the Unicode tables
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Recalibrate linux x64 translator and objectAllocation perf rows
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Regex review: pairs in escapes and quotes, JDK search rule, tables for every property
- A search skips the positions inside a surrogate pair when the pattern
names a supplementary code point or a surrogate, as the JDK's StartS
does, so a negated class no longer matches half a pair.
- Two backslash-u escapes spelling a pair are one code point, and
\Q...\E quotes code points, inside a class and out (Pattern.quote of
an emoji matched nothing).
- The JDK's binary properties and the general categories answer from
UnicodeTables for all of Unicode; IsWhite_Space no longer takes
U+001C-U+001F, and a case category under CASE_INSENSITIVE takes Lu, Ll
and Lt as on the JDK.
- Ports/CLDC11 Random: a no-break space in a comment failed an ASCII
compile.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Regex review 2: properties skip pair halves, caseless back references and classes, marks in words
- A pattern with a Unicode property or a (?U) shorthand skips the
positions inside a pair, as the JDK's search does, so [^\p{L}] no
longer takes half a supplementary letter.
- A caseless back reference compares code points.
- A caseless Unicode class also tries the lower form of the upper one,
so (?iu)[a-z] takes U+0131 and U+017F as on the JDK.
- \b and \B count a non-spacing mark after a letter or digit as part of
the word, and read the lone high half before a position inside a pair.
- usePattern keeps the match and drops its groups; group(0) is null.
- \p{all}.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Regex review 3: unbounded single-atom lookbehind, quantified \R keeps its pair
- A lookbehind may repeat one character without bound, as on JDK 21
("(?<=a+)b"); a group repeated without bound or a back reference
inside one is still refused, as there.
- A quantifier repeats \R whole, so each round takes \r\n as a pair.
- Code comments on the JDK parser accidents left alone: a leading {1},
x{1}{2}, and [a&&&b].
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Regex review 4 (fuzzing): escaped pairs, COMMENTS before a suffix, folded class members
- An escaped supplementary character is one atom under a quantifier.
- COMMENTS mode skips whitespace before the ? or + of a quantifier.
- A single class member under UNICODE_CASE also stands for its folded
form, so (?iu)[ı] takes "I" as on the JDK.
- A possessive repeat of an empty group takes its round and sets it.
- (?) is refused.
- Code comments on the JDK accidents left alone: which positions inside
a pair its search accepts, the inner groups of repeated empty groups,
and its && grammar.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Rebaseline Flutter linux size for the regex code-point work
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Rebase the size and perf overlays onto master's #6059
#6059 rebaselined the JavaScript and Linux gallery size rows from the
same values this PR did, so those rows are dropped here to be measured
again on top of it. The x64 translator override starts from the row as
master now reads it, after #6059 removed the stale #5976 entry.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…odename One swing-compat (java.awt, javax.swing, java.beans, javax.imageio and a SwingX subset) is authored already relocated under com.codename1.desktopcompat; javafx-compat is authored under the javafx names and relocated at build time. desktop-compat-runtime holds what both layers share, including shims for the host-backed JDK APIs a device lacks (java.io.File, java.net.URL, java.nio.file, ResourceBundle, java.util.logging, java.util.prefs). fxml-compiler turns FXML and JavaFX CSS into code and tables at build time. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ClassRelocator applies every active layer in one pass; CompatRewrites redirects the JDK members a device cannot have; the compliance check reports unsupported desktop API under its original name. remap-compat and import-desktop-project in Maven and Gradle, with the archetype wiring. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
b9f0a19 to
a29fff5
Compare
…s Closeable A stream bundle is UTF-8 when its bytes are well-formed UTF-8 and ISO-8859-1 otherwise, as the JDK has read them since Java 9. The compliance report no longer reverses a shim whose target is itself a JDK class. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ugaring, doc snippet roles The four core-unittests and AndroidDesugaringDependencyTest covered the core JDK host and the nio desugaring this PR no longer has. The nio desugar_jdk_libs variant clashed with the Flutter Android build (DartList.reversed), so AndroidGradleBuilder is master's again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he JS gallery sizes dart.core.DateTime named java.util.regex, which no ParparVM target has and nothing relocates in an ordinary application: every native Flutter build failed on a missing java_util_regex_Pattern.h. It now uses com.codename1.util.regex, as RegExp already did. The PR's flutter-bench overlay justified the JavaAPI growth that moved to #6044; its linux rows are dropped and the javascript rows recalibrated from this PR's first gallery run on top of #6044 and #6055. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Android API 35 gives java.util.List a reversed() answering a List, and every Flutter plugin class extending DartList (dio's Interceptors) failed to compile in the generated Android project. Dart's reversed getter is now dartReversed() in Java; the transpiler emits that name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…uild A reactor build that stops before packaging (mvn test over several modules, as the Java 8 CI leg runs) resolves the runtime to its target/classes directory, and the remap found no runtime jar. The directory is now read like the jar, leaving out com/codename1/impl the way the module's jar does. Also rebaselines the android and linux gallery sizes from their first run on top of #6044 and #6055. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Command.equals compares names, so the cancel and accept buttons must be told apart by identity; master's #6052 tripped the forbidden-PMD gate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # CodenameOne/src/com/codename1/impl/FileDialogSupport.java # maven/dart-runtime/src/main/java/dart/core/DartList.java # maven/dart-runtime/src/main/java/dart/core/DateTime.java # maven/dart-runtime/src/test/java/dart/core/DartCoreSemanticsTest.java # maven/dart-transpiler/src/main/java/com/codename1/dart/transpiler/codegen/JavaEmitter.java
A collection that cannot stop a thread records a root miss and skips the sweep, then names each missed thread with pthread_getname_np. The thread it could not stop is usually one that is exiting: markDeadThread deregisters it and the pthread ends, so the recorded handle can name a thread that no longer exists, and glibc reads its freed descriptor. The bulk conformance run, whose pool checks start and retire many threads, crashed with SIGSEGV in this diagnostic right after the skip line (vm-tests, StringBuilderGrowthApp, exit 139). The name is now read only for a handle still registered in allThreads, under the critical section markDeadThread takes, and blocked threads are released before that lock is taken. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What this adds
An existing Swing or JavaFX project builds as a Codename One application for every target, the way an Android module does with the Android compatibility layer. The sources are imported with
cn1:import-desktop-projectintocommon/src/main/desktopand built unmodified.maven/swing-compat:java.awt, Java2D,javax.swing,java.beans,javax.imageio, a SwingX subset and the FlatLaf entry points, written over Codename One components. Authored already relocated, because the JDK owns those package names; applications compile against the JDK's Swing.maven/javafx-compat: thejavafx.*subset (scene graph, controls, charts, layout panes, properties and bindings, animation, effects, Canvas), authored under the real names.maven/fxml-compiler: FXML and JavaFX CSS compiled at build time; nothing on a device parses XML or reflects.maven/compat-jdk: the JDK classes a device lacks (streams,java.util.function,java.nio.file, regex,CompletableFuture,java.timegaps and more), shared with the Android layer.maven/build-engine: one composed relocation pass over every layer, generated entry points and registries, records and pattern switches desugared, and the compliance check extended so that unsupported API is a build error reported under its original name and source line.scripts/desktop-compat-samples), screenshot tests inhellocodenameone, an integration test, a real-port interaction harness (maven/integration-tests/desktop-compat-realport) and a benchmark harness (scripts/desktop-compat-benchmarks).docs/developer-guide/Desktop-Interop.asciidoc, with measured size, memory and start-up tables.Verified locally
Not verified / known gaps
desktop-compat.ymladditions,desktop-compat-benchmarks.yml) have never run on GitHub. Windows is unmeasured; macOS runtime numbers needrun-macos-bench.sh.DesktopCompat*tests have to be seeded from the first CI run.🤖 Generated with Claude Code