Skip to content

Commit 3742709

Browse files
akoclaude
andcommitted
fix: use unique action name in Level 10 OR MODIFY java action example
The previous Level 10 example tried to CREATE JaTest.FormatDate which was already created at line 184, causing "java action already exists" in the integration test. Use JaTest.PadString as a self-contained demo so Level 10 does not conflict with the existing FormatDate action. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 63193c6 commit 3742709

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

mdl-examples/doctype-tests/07-java-action-examples.mdl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1809,26 +1809,26 @@ drop java action JaTest.ComputeHash;
18091809
-- team-shared setup scripts, migrations).
18101810

18111811
-- 10.1: Create a Java action initially
1812-
create java action JaTest.FormatDate(
1812+
create java action JaTest.PadString(
18131813
Input: string not null
18141814
) returns string
18151815
as $$
18161816
return Input.trim();
18171817
$$;
18181818

18191819
-- 10.2: Re-run the same script with CREATE OR MODIFY to update the body
1820-
create or modify java action JaTest.FormatDate(
1820+
create or modify java action JaTest.PadString(
18211821
Input: string not null,
1822-
Format: string not null
1822+
PadChar: string not null,
1823+
Width: integer not null
18231824
) returns string
18241825
as $$
1825-
import java.time.LocalDate;
1826-
import java.time.format.DateTimeFormatter;
1827-
LocalDate date = LocalDate.parse(Input);
1828-
return date.format(DateTimeFormatter.ofPattern(Format));
1826+
String s = Input.trim();
1827+
while (s.length() < Width) s = PadChar + s;
1828+
return s;
18291829
$$;
18301830

1831-
drop java action JaTest.FormatDate;
1831+
drop java action JaTest.PadString;
18321832

18331833
-- ============================================================================
18341834
-- Java Action Feature Summary

0 commit comments

Comments
 (0)