Repository navigation
Name the first missing placeholder of a declaration, the same on every run - #111
Merged
Merged
Conversation
…y run
With several ${NAME} placeholders in one declaration and no value for
them, the error named whichever one the resolver met first, and that
changed between JVM runs (#110): ConnectionDeclaration copied its
properties, HttpSourceConfig its headers and GeneratorSourceConfig its
arguments with Map.copyOf, whose iteration order is randomised per JVM.
Each now keeps declaration order in an unmodifiable LinkedHashMap, and
still refuses a null key or value. So the error names the first
missing placeholder as written, and headers are also sent and printed
in the order they were declared.
The message still names one placeholder, not all of them: resolution
stops at the first gap, as it does for a value that breaks a header,
and a stable first name is what an example or a test needs.
Fixes #110
This was referenced Oct 12, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #110
When a declaration had several
${NAME}placeholders with no value, the error named an arbitrary one, and which one changed between JVM runs.ConnectionDeclaration(properties),HttpSourceConfig(headers) andGeneratorSourceConfig(arguments) copied their maps withMap.copyOf, which iterates in an order randomised per JVM. All three now keep declaration order in an unmodifiableLinkedHashMapand still refuse a null key or value. The othercopyOfcalls in the declaration ASTs areList.copyOf, which already keeps order.As a side effect, headers are now sent and printed in the order they were declared.
One name or all of them: the message still names only the first missing placeholder. Resolution stops at the first gap, as it does for a value that breaks a header. A stable first name is enough for an example or a test, and it leaves the message format relix-cli already matches alone. Reporting every gap would mean collecting failures across the whole
Execution, and that can come later if anyone asks for it.Tests
LangAstValidationTest.DeclaredOrder: twenty entries in reverse order keep that order for a connection's properties, an http source's headers and a generator's arguments. A null value is still refused.PlaceholdersTest: a connection with eight missing placeholders, and an http source with six missing headers, fail with the exact message naming the first one as written.All five new assertions fail on
developwithout the fix../gradlew checkpasses.Once this is on
develop, relix-cli (DarkCollective/relix-cli#42) can show an example with several missing placeholders.