Github user kirklund commented on a diff in the pull request: https://github.com/apache/incubator-geode/pull/278#discussion_r86033727 --- Diff: geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateAlterDestroyRegionCommands.java --- @@ -907,6 +903,31 @@ private void validateRegionFunctionArgs(Cache cache, RegionFunctionArgs regionFu new Object[] {regionFunctionArgs.getCompressor()})); } } + + if (regionFunctionArgs.hasPartitionAttributes()) { + boolean partitionResolverFailure = false; + if (regionFunctionArgs.isPartitionResolverSet()) { + String partitionResolverClassName = regionFunctionArgs.getPartitionResolver(); + Object partitionResolver = null; + + try { + Class<?> compressorClass = + (Class<?>) ClassPathLoader.getLatest().forName(partitionResolverClassName); + partitionResolver = compressorClass.newInstance(); + } catch (InstantiationException e) { + partitionResolverFailure = true; + } catch (IllegalAccessException e) { + partitionResolverFailure = true; + } catch (ClassNotFoundException e) { + partitionResolverFailure = true; + } + if (partitionResolverFailure || !(partitionResolver instanceof PartitionResolver)) { + throw new IllegalArgumentException( --- End diff -- Use cause from above (you don't need to check it for null because null value is same as not having a cause): + throw new IllegalArgumentException( + CliStrings.format(CliStrings.CREATE_REGION__MSG__INVALID_PARTITION_RESOLVER, + new Object[] {regionFunctionArgs.getCompressor()}), cause); + }
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---