bbende commented on code in PR #10811:
URL: https://github.com/apache/nifi/pull/10811#discussion_r2729006079
##########
nifi-commons/nifi-connector-utils/src/main/java/org/apache/nifi/components/connector/util/VersionedFlowUtils.java:
##########
@@ -390,189 +389,26 @@ public static void updateToLatestBundles(final
VersionedProcessGroup processGrou
/**
* Updates the given processor to use the latest available bundle version.
- * See {@link #getLatest(List)} for details on how version comparison is
performed.
+ * See {@link ComponentBundleLookup#getLatestBundle(String)} for details
on how version comparison is performed.
*
* @param processor the processor to update
* @param componentBundleLookup the lookup used to find available bundles
for the processor type
*/
public static void updateToLatestBundle(final VersionedProcessor
processor, final ComponentBundleLookup componentBundleLookup) {
- final Bundle latest = getLatestBundle(processor,
componentBundleLookup);
+ final Bundle latest =
componentBundleLookup.getLatestBundle(processor.getType());
processor.setBundle(latest);
}
/**
* Updates the given controller service to use the latest available bundle
version.
- * See {@link #getLatest(List)} for details on how version comparison is
performed.
+ * See {@link ComponentBundleLookup#getLatestBundle(String)} for details
on how version comparison is performed.
*
* @param service the controller service to update
* @param componentBundleLookup the lookup used to find available bundles
for the service type
*/
public static void updateToLatestBundle(final VersionedControllerService
service, final ComponentBundleLookup componentBundleLookup) {
- final Bundle latest = getLatestBundle(service, componentBundleLookup);
+ final Bundle latest =
componentBundleLookup.getLatestBundle(service.getType());
Review Comment:
It looks like if there are no compatible bundles, then the standard look up
returns `null`, would we only want to call `setBundle` if its not null?
Alternatively, could consider the method in the API to return
`Optional<Bundle>` in order to force scenarios like this to decide. The Java
Doc does say it returns null if not found, so I could go either way on the API
--
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]