gmunozfe commented on code in PR #3464:
URL:
https://github.com/apache/incubator-kie-kogito-runtimes/pull/3464#discussion_r1556394932
##########
quarkus/extensions/kogito-quarkus-workflow-extension-common/kogito-quarkus-workflow-common-deployment/src/main/java/org/kie/kogito/quarkus/workflow/deployment/AbstractDevServicesProcessor.java:
##########
@@ -71,6 +71,12 @@ protected static boolean shouldInclude(LaunchModeBuildItem
launchMode, KogitoWor
return launchMode.getLaunchMode().isDevOrTest() ||
config.alwaysInclude;
}
+ protected String getProperty(List<SystemPropertyBuildItem>
systemPropertyBuildItems, String propertyKey) {
+ return systemPropertyBuildItems.stream().filter(property ->
property.getKey().equals(propertyKey))
+ .findAny()
+ .map(SystemPropertyBuildItem::getValue).orElse(null);
Review Comment:
`orElse(null)` makes to return `null` if `propertyKey` is not found, which
could lead to potential `NullPointerExceptions`.
As @fjtirado suggested, probably return an `Optional<String>` and remove the
`orElse` clause.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]