@Deprecated
  public static GemFireCacheImpl getForPdx(String reason) {
    InternalDistributedSystem system = getAnyInstance();
    if (system == null) {
      throw new CacheClosedException(reason);
    }

    GemFireCacheImpl cache = (GemFireCacheImpl) system.getCache();
    if (cache == null) {
      throw new CacheClosedException(reason);
    }

    return cache;
  }
Returns instance to pdx even while it is being closed.

@deprecated Please use a cache that is passed to your method instead.
geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java