NIFI-15975 Fixed single line comment bug, multiple let statements bug and improved the invalid read JSLT transform message.#11338
Open
dan-s1 wants to merge 5 commits into
Open
NIFI-15975 Fixed single line comment bug, multiple let statements bug and improved the invalid read JSLT transform message.#11338dan-s1 wants to merge 5 commits into
dan-s1 wants to merge 5 commits into
Conversation
… and improved the invalid read JSLT transform message.
…nux based operating system.
pvillard31
requested changes
Jun 16, 2026
| } | ||
| try (final BufferedReader reader = new BufferedReader(new InputStreamReader(resourceReference.read()))) { | ||
| return reader.lines().collect(Collectors.joining()); | ||
| return reader.lines().collect(Collectors.joining(System.lineSeparator())); |
Contributor
There was a problem hiding this comment.
Did you consider joining the lines with a fixed newline instead of System.lineSeparator(), so the compiled transform and the modifyContent provenance detail stay identical across Windows and Linux?
Contributor
Author
There was a problem hiding this comment.
I did not consider that. I made the same change as was made in #7678 for JoltTransformJSON and JoltTransformRecord which solved the similar issue. Do still want this change? If so, should a similar change then be made for JoltTransformJSON and JoltTransformRecord?
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.
Summary
NIFI-15975
This PR along with the fix in the
nifi-apifor NIFI-15982 solve three issues that were reported in NIFI-15975.The first two issues had to do with when single line Java comments are used in the JSLT transform. Before the fix for NIFI-15982, the framework mistook the leading forward slash of the Java comment as a file path. The second issue was the code in the
JSLTTransformJSONactually did not report the true reason why it failed which was the JSLT transform was not a valid file path. The fix for NIFI-15982 took care of NIFI mistakenly thinking the single line Java comment is a file and the fix in this PR ensures the real reason for failure is displayed.The final issue reported what was the inability to place two
letstatements on separate lines without placing an additional space between them. That was due to the JSLT transform being read with the new lines being stripped out. The fix for this was to reintroduce the new lines when reconstituting the JSLT transform after it is read from the given source.As an aside, the fix for NIFI-15982 also fixed
JoltTransformJSONandValidateJson, as the Jolt spec and schema source could be text and single Java comments are allowed.Tracking
Please complete the following tracking steps prior to pull request creation.
Issue Tracking
Pull Request Tracking
NIFI-00000NIFI-00000VerifiedstatusPull Request Formatting
mainbranchVerification
Please indicate the verification steps performed prior to pull request creation.
Build
./mvnw clean install -P contrib-checkLicensing
LICENSEandNOTICEfilesDocumentation