Github user apiri commented on a diff in the pull request:
https://github.com/apache/nifi-minifi/pull/108#discussion_r161253393
--- Diff:
minifi-nar-bundles/minifi-framework-bundle/minifi-framework/minifi-runtime/src/main/java/org/apache/nifi/minifi/FlowEnricher.java
---
@@ -130,17 +127,13 @@ private void enrichComponent(EnrichingElementAdapter
componentToEnrich, Map<Stri
componentToEnrich.setBundleInformation(enrichingBundleCoordinate);
componentToEnrich.setDependsUponBundleCoordinate(enrichingBundleDetails.getDependencyCoordinate());
} else {
-
- // mUltiple options
+ // multiple options
final Set<String> componentToEnrichBundleVersions =
componentToEnrichVersionToBundles.values().stream()
.map(bundle ->
bundle.getBundleDetails().getCoordinate().getVersion()).collect(Collectors.toSet());
- final String componentToEnrichId =
componentToEnrich.getComponentId();
- String bundleVersion =
componentToEnrichBundleVersions.stream().sorted().reduce((version,
otherVersion) -> otherVersion).orElse(null);
- if (bundleVersion != null) {
-
componentToEnrich.setBundleInformation(componentToEnrichVersionToBundles.get(bundleVersion).getBundleDetails().getCoordinate());
- }
- logger.info("Enriching {} with bundle {}", new Object[]{});
-
+ final String bundleVersion =
componentToEnrichBundleVersions.stream().sorted().reduce((version,
otherVersion) -> otherVersion).orElse(null);
+ final BundleCoordinate enrichingCoordinate =
componentToEnrichVersionToBundles.get(bundleVersion).getBundleDetails().getCoordinate();
--- End diff --
Okay, fair enough. Definitely looks odd and I will adjust that.
---