public void setPartitionAttributes(PartitionAttributes partitionAttr) {
    if (partitionAttr != null) {
      if (!hasDataPolicy()) {
        setDataPolicy(PartitionedRegionHelper.DEFAULT_DATA_POLICY);
        setHasDataPolicy(false);
      } else if (!PartitionedRegionHelper.ALLOWED_DATA_POLICIES.contains(getDataPolicy())) {
        throw new IllegalStateException(
            String.format(
                "Data policy %s is not allowed for a partitioned region. DataPolicies other than %s are not allowed.",
                getDataPolicy(), PartitionedRegionHelper.ALLOWED_DATA_POLICIES));
      }

      if (hasPartitionAttributes()
          && partitionAttributes instanceof PartitionAttributesImpl
          && partitionAttr instanceof PartitionAttributesImpl) {

        // Make a copy and call merge on it to prevent bug 51616
        PartitionAttributesImpl copy = ((PartitionAttributesImpl) partitionAttributes).copy();
        copy.merge((PartitionAttributesImpl) partitionAttr);
        partitionAttributes = copy;
      } else {
        partitionAttributes = partitionAttr;
      }

      setHasPartitionAttributes(true);
    } else {
      partitionAttributes = null;
      setHasPartitionAttributes(false);
    }
  }
Causes this region attributes to inherit all of the attributes of its "parent" attributes
specified by its <code>refid</code>.

@param cache Used to look up named region attributes

@throws IllegalStateException If no region attributes named <code>refid</code> exist.

@since GemFire 4.1
geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/RegionAttributesCreation.java