XN137 commented on code in PR #2261: URL: https://github.com/apache/polaris/pull/2261#discussion_r2254455846
########## service/common/src/main/java/org/apache/polaris/service/admin/PolarisAdminService.java: ########## @@ -200,6 +205,43 @@ private Optional<CatalogRoleEntity> findCatalogRoleByName(String catalogName, St .map(path -> CatalogRoleEntity.of(path.getRawLeafEntity())); } + private <T> Stream<T> loadEntities( + @Nonnull PolarisEntityType entityType, + @Nonnull PolarisEntitySubType entitySubType, + @Nullable PolarisEntity catalogEntity, + @Nonnull Function<PolarisBaseEntity, T> transformer) { + List<PolarisEntityCore> catalogPath; + long catalogId; + if (catalogEntity == null) { + catalogPath = null; + catalogId = 0; + } else { + catalogPath = PolarisEntity.toCoreList(List.of(catalogEntity)); Review Comment: i had noticed that `toCoreList` has some `null` handling but if we passed `PolarisEntity.toCoreList(List.of(null))` i think it would still result in an NPE ? imo having the explicit "if null" makes the overall flow clearer either way -- 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: issues-unsubscr...@polaris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org