Github user dschneider-pivotal commented on a diff in the pull request:

    https://github.com/apache/incubator-geode/pull/201#discussion_r71577488
  
    --- Diff: 
geode-core/src/main/java/com/gemstone/gemfire/internal/cache/LocalRegion.java 
---
    @@ -7769,17 +7879,55 @@ void cleanUpOnIncompleteOp(EntryEventImpl event, 
RegionEntry re) {
         this.entries.removeEntry(event.getKey(), re, false) ;      
       }
     
    -  static void validateRegionName(String name)
    +  static void validateRegionName(String name, InternalRegionArguments 
internalRegionArgs)
       {
         if (name == null) {
           throw new 
IllegalArgumentException(LocalizedStrings.LocalRegion_NAME_CANNOT_BE_NULL.toLocalizedString());
         }
    -    if (name.length() == 0) {
    +    if (name.isEmpty()) {
           throw new 
IllegalArgumentException(LocalizedStrings.LocalRegion_NAME_CANNOT_BE_EMPTY.toLocalizedString());
         }
    -    if (name.indexOf(SEPARATOR) >= 0) {
    +    if (name.contains(SEPARATOR)) {
           throw new 
IllegalArgumentException(LocalizedStrings.LocalRegion_NAME_CANNOT_CONTAIN_THE_SEPARATOR_0.toLocalizedString(SEPARATOR));
         }
    +
    +    // Validate the name of the region only if it isn't an internal region
    +    if (internalRegionArgs.isInternalRegion()){
    +      return;
    +    }
    +    if (internalRegionArgs.isUsedForMetaRegion()) {
    +      return;
    +    }
    +    if (internalRegionArgs.isUsedForPartitionedRegionAdmin()) {
    +      return;
    +    }
    +    if (internalRegionArgs.isUsedForPartitionedRegionBucket()) {
    +      return;
    +    }
    +
    +//    LocalRegion metaRegion = internalRegionArgs.getInternalMetaRegion();
    +//    if (metaRegion != null) {
    +//      if (metaRegion instanceof HARegion) {
    +//        if (metaRegion.getName().equals(name)) {
    +//          return;
    +//        }
    +//      }
    +//      if (metaRegion instanceof SerialGatewaySenderQueueMetaRegion) {
    +//        return;
    +//      }
    +//    }
    +
    +    if (name.startsWith("__")
    --- End diff --
    
    Why was the special case needed? Shouldn't this region have set 
isInternalRegion?


---
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.
---

Reply via email to