Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
24cb18d
Add CI workflow for cn1playground language smoke tests
liannacasper Apr 7, 2026
da4aed4
Fix playground workflow script invocation permissions
liannacasper Apr 7, 2026
3cd3e09
Fix registry generator classpath for JDK8 tools API
liannacasper Apr 7, 2026
b29fbae
Use Java 17 and portable checks in playground smoke CI
liannacasper Apr 7, 2026
73abb3b
Build dependent modules in playground smoke Maven step
liannacasper Apr 7, 2026
e91778b
Run playground smoke harness from common module classpath
liannacasper Apr 7, 2026
1f9482d
Run playground smoke tests under Xvfb in CI
liannacasper Apr 7, 2026
e1285ac
Install reactor artifacts before running playground harness
liannacasper Apr 7, 2026
792e546
Force smoke harness process exit after success
liannacasper Apr 7, 2026
a6903ea
Add playground syntax matrix harness to smoke test pipeline
liannacasper Apr 7, 2026
e08c2eb
Use Java text blocks in syntax matrix snippets
liannacasper Apr 7, 2026
d2b1cc7
Stabilize syntax matrix outcomes and always exit process
liannacasper Apr 7, 2026
6c21e10
Document playground smoke workflow and syntax rollout process
liannacasper Apr 7, 2026
c7cd472
Expand syntax matrix to table-driven parse/eval coverage
liannacasper Apr 7, 2026
aecea50
Mark try-with-resources matrix cases as current parse gaps
liannacasper Apr 8, 2026
a9281ef
Enable try-with-resources without catch/finally in parser
liannacasper Apr 8, 2026
8af87c8
Throw evaluation error for enhanced-for over null
liannacasper Apr 8, 2026
a72f2af
Use local AutoCloseable resources in TWR matrix cases
liannacasper Apr 8, 2026
c60e28b
Use StringReader resources in TWR matrix cases
liannacasper Apr 8, 2026
a9f1b88
Enable BeanShell class generation for inline class declarations
liannacasper Apr 8, 2026
350450e
Handle superclass invocation checked exceptions in Name
liannacasper Apr 8, 2026
126d6cf
Support inline AutoCloseable class snippets without ASM generator
liannacasper Apr 8, 2026
76c5eca
Restore BeanShell class generation for playground runtime
liannacasper Apr 8, 2026
ea8c221
Handle superclass invocation target exceptions in Name
liannacasper Apr 9, 2026
5f9bbfa
Remove InvocationTargetException from CN1 playground path
liannacasper Apr 9, 2026
1f5abcb
Remove unsupported reflection and regex usage from playground runtime
liannacasper Apr 9, 2026
dae0150
Use CN1 RE/StringUtil for inline AutoCloseable rewrite
liannacasper Apr 9, 2026
04485ff
Rewrite try-resource helper types to AutoCloseable
liannacasper Apr 9, 2026
f087fdf
Stop rewriting inline AutoCloseable helpers in adaptScript
liannacasper Apr 9, 2026
b2c8b94
Enable scripted class declarations in BSHClassDeclaration
liannacasper Apr 9, 2026
7d0b375
Remove reflection/UUID/stream usage from class generation util
liannacasper Apr 10, 2026
890b25b
Restore strict validation hook with faux-reflection checks
liannacasper Apr 10, 2026
ebbbf11
Remove ASM runtime usage and fall back to CN1-safe rewrites
liannacasper Apr 10, 2026
d337468
Add non-bytecode class rewrite path for simple static inner case
liannacasper Apr 10, 2026
729f721
Unify class/anonymous/lambda adaptation pipeline
liannacasper Apr 10, 2026
121a18a
Return Component in inner_class_static_member matrix case
liannacasper Apr 10, 2026
348f40c
Fix static inner class snippet rewrite in playground runner
liannacasper Apr 10, 2026
c2a0d06
Generalize playground support for top-level class declarations
liannacasper Apr 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/cn1playground-language.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CN1 Playground Language Tests

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'scripts/cn1playground/**'
- '.github/workflows/cn1playground-language.yml'
push:
branches: [main, master]
paths:
- 'scripts/cn1playground/**'
- '.github/workflows/cn1playground-language.yml'
workflow_dispatch:

permissions:
contents: read

jobs:
language-smoke:
name: Playground language smoke
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Java 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'
cache: maven

- name: Ensure Xvfb is available
run: |
set -euo pipefail
if ! command -v xvfb-run >/dev/null 2>&1; then
sudo apt-get update
sudo apt-get install -y xvfb
fi

- name: Run playground language smoke tests
run: |
set -euo pipefail
cd scripts/cn1playground
xvfb-run -a bash tools/run-playground-smoke-tests.sh
32 changes: 30 additions & 2 deletions scripts/cn1playground/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,37 @@ mvn clean install

```bash
cd scripts/cn1playground
./scripts/run-tests.sh
bash tools/run-playground-smoke-tests.sh
```

This smoke command currently runs:

1. CN1 access registry generation (`tools/generate-cn1-access-registry.sh`).
2. Registry sanity checks (expected/forbidden class entries).
3. `PlaygroundSmokeHarness` end-to-end behavior checks.
4. `PlaygroundSyntaxMatrixHarness` syntax regression checks.

## Language Feature Rollout Process

Use this process when adding or fixing Java syntax support in Playground:

1. **Add/adjust matrix coverage first**
Update `common/src/test/java/com/codenameone/playground/PlaygroundSyntaxMatrixHarness.java` with a focused snippet for the target syntax.
- For currently unsupported syntax, add as `ExpectedOutcome.FAILURE`.
- When support lands, flip that case to `ExpectedOutcome.SUCCESS`.

2. **Implement parser/runtime change in small steps**
Prefer one syntax feature per PR (e.g. method references only) to keep regressions easy to isolate.

3. **Run smoke + syntax matrix locally**
Run `bash tools/run-playground-smoke-tests.sh` from `scripts/cn1playground`.

4. **Require CI green before merge**
The `CN1 Playground Language Tests` workflow runs the same smoke command under CI (`xvfb-run`) and should pass before merging syntax updates.

5. **Document behavior changes**
Update this README's known issues/limitations when syntax support changes so users know what is now supported.

## Known Issues

1. **Parse errors with complex expressions**: BeanShell's parser may fail on some Java syntax. Simplify complex expressions or break them into multiple statements.
Expand All @@ -360,4 +388,4 @@ cd scripts/cn1playground

## Contributing

See the main Codename One repository for contribution guidelines.
See the main Codename One repository for contribution guidelines.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ public Object eval(CallStack callstack, Interpreter interpreter) throws EvalErro
statement = nodeCount > 1 ? jjtGetChild(1) : null;
}
final Object iteratee = expression.eval(callstack, interpreter);
if (iteratee == null || iteratee == Primitive.NULL) {
throw new EvalException("Cannot iterate over null value", this, callstack);
}
final CollectionManager cm = CollectionManager.getCollectionManager();
final Iterator<?> iterator = cm.getBshIterator(iteratee);
try {
Expand Down
2 changes: 1 addition & 1 deletion scripts/cn1playground/common/src/main/java/bsh/Name.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
package bsh;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.HashMap;

/**
What's in a name? I'll tell you...
Expand Down
1 change: 1 addition & 0 deletions scripts/cn1playground/common/src/main/java/bsh/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -4546,6 +4546,7 @@ final public void TryStatement() throws ParseException {/*@bgen(jjtree) TryState
switch (jj_ntk == -1 ? jj_ntk_f() : jj_ntk) {
case LPAREN:{
TryWithResources();
closed = true;
break;
}
default:
Expand Down
Loading
Loading