Skip to content

Commit

Permalink
NIFI-10958 Adjusted Script Engine handling to avoid exceptions
Browse files Browse the repository at this point in the history
- Added empty check for list of discovered Script Engines to avoid exceptions for documentation generation on Java 17

Signed-off-by: Matthew Burgess <mattyb149@apache.org>

This closes #6774
  • Loading branch information
exceptionfactory authored and mattyb149 committed Dec 12, 2022
1 parent 2fa8217 commit c11dff9
Showing 1 changed file with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,21 @@ public void createResources(final boolean requireInvocable) {
engineAllowableValues = engineList;
AllowableValue[] engines = engineList.toArray(new AllowableValue[0]);

SCRIPT_ENGINE = new PropertyDescriptor.Builder()
final PropertyDescriptor.Builder enginePropertyBuilder = new PropertyDescriptor.Builder()
.name("Script Engine")
.required(true)
.description("The engine to execute scripts")
.allowableValues(engines)
.defaultValue(engines[0].getValue())
.description("Language Engine for executing scripts")
.required(true)
.expressionLanguageSupported(ExpressionLanguageScope.NONE)
.build();
.expressionLanguageSupported(ExpressionLanguageScope.NONE);

if (engineList.isEmpty()) {
enginePropertyBuilder.description("No Script Engines found");
} else {
enginePropertyBuilder.allowableValues(engines);
enginePropertyBuilder.defaultValue(engines[0].getValue());
}

SCRIPT_ENGINE = enginePropertyBuilder.build();
descriptors.add(SCRIPT_ENGINE);
}

Expand Down

0 comments on commit c11dff9

Please sign in to comment.