Skip to content

[Java] Set keyword append token in JavaGeneratorTest - #1144

Closed
coxsim wants to merge 4 commits into
aeron-io:masterfrom
coxsim:master
Closed

coxsim wants to merge 4 commits into
aeron-io:masterfrom
coxsim:master

Conversation

@coxsim

@coxsim coxsim commented Oct 27, 2026

Copy link
Copy Markdown

Currently JavaGeneratorTest fails when run in isolation as it uses schemas (like code-generation-schema.xml) with reserved Java keywords. The test suite passes when run with other tests that set the system property sbe.keyword.append.token and do not clear it after their tests finish.

For example:

Invalid property name='false' please correct the schema or consider setting system property: sbe.keyword.append.token
java.lang.IllegalStateException: Invalid property name='false' please correct the schema or consider setting system property: sbe.keyword.append.token
	at uk.co.real_logic.sbe.generation.java.JavaUtil.formatForJavaKeyword(JavaUtil.java:179)
	at uk.co.real_logic.sbe.generation.java.JavaGenerator.generateEnumValues(JavaGenerator.java:2284)
	at uk.co.real_logic.sbe.generation.java.JavaGenerator.generateEnum(JavaGenerator.java:2006)
	at uk.co.real_logic.sbe.generation.java.JavaGenerator.generateTypeStubs(JavaGenerator.java:209)
	at uk.co.real_logic.sbe.generation.java.JavaGenerator.generate(JavaGenerator.java:258)
	at uk.co.real_logic.sbe.generation.java.JavaGeneratorTest.shouldHandleLowerCaseEnumValueReference(JavaGeneratorTest.java:847)

This change sets the append token property before each test and restores it to the previous value after each test.

@coxsim coxsim closed this Oct 27, 2026
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.

1 participant