package com.l7tech.server.policy;

import com.l7tech.gateway.common.LicenseException;
import com.l7tech.gateway.common.audit.AuditDetailMessage;
import com.l7tech.gateway.common.audit.MessageProcessingMessages;
import com.l7tech.gateway.common.audit.Messages.M;
import com.l7tech.objectmodel.EntityType;
import com.l7tech.objectmodel.FindException;
import com.l7tech.objectmodel.Goid;
import com.l7tech.objectmodel.folder.Folder;
import com.l7tech.objectmodel.imp.PersistentEntityUtil;
import com.l7tech.policy.CircularPolicyException;
import com.l7tech.policy.DesignTimeEntityProvider;
import com.l7tech.policy.InvalidPolicyException;
import com.l7tech.policy.Policy;
import com.l7tech.policy.PolicyDeletionForbiddenException;
import com.l7tech.policy.PolicyHeader;
import com.l7tech.policy.PolicyType;
import com.l7tech.policy.PolicyVersion;
import com.l7tech.policy.assertion.Assertion;
import com.l7tech.policy.assertion.Include;
import com.l7tech.policy.assertion.PolicyAssertionException;
import com.l7tech.policy.assertion.SetsVariables;
import com.l7tech.policy.assertion.TrueAssertion;
import com.l7tech.policy.assertion.UnknownAssertion;
import com.l7tech.policy.assertion.UsesVariables;
import com.l7tech.policy.variable.PolicyVariableUtils;
import com.l7tech.policy.variable.VariableMetadata;
import com.l7tech.policy.wsp.WspReader.Visibility;
import com.l7tech.server.EntitiesProcessedInBatch;
import com.l7tech.server.audit.Auditor;
import com.l7tech.server.event.EntityInvalidationEvent;
import com.l7tech.server.event.PolicyCacheEvent;
import com.l7tech.server.event.system.PolicyReloadEvent;
import com.l7tech.server.folder.FolderCache;
import com.l7tech.server.policy.assertion.ServerAssertion;
import com.l7tech.server.policy.module.BaseAssertionModule;
import com.l7tech.server.policy.module.CustomAssertionModule;
import com.l7tech.server.policy.module.ModularAssertionModule;
import com.l7tech.server.service.ServiceAndPolicyCacheSharedLock;
import com.l7tech.server.util.PostStartupApplicationListener;
import com.l7tech.util.Config;
import com.l7tech.util.Either;
import com.l7tech.util.EmptyIterator;
import com.l7tech.util.ExceptionUtils;
import com.l7tech.util.Pair;
import com.l7tech.util.ResourceUtils;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.function.Supplier;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.commons.lang3.mutable.MutableBoolean;
import org.apache.commons.lang3.mutable.MutableObject;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.jmx.export.annotation.ManagedAttribute;
import org.springframework.jmx.export.annotation.ManagedOperation;
import org.springframework.jmx.export.annotation.ManagedResource;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.support.TransactionTemplate;

@ManagedResource(description = "Policy Cache", objectName = "l7tech:type=PolicyCache")
public class PolicyCacheImpl implements PolicyCache, ApplicationContextAware, PostStartupApplicationListener {
   private static final String a;
   private static final String b;
   private static final aa c;
   private static final Logger d;
   private static final Visibility e;
   private Level f = Level.FINEST;
   private final PlatformTransactionManager g;
   private Auditor h;
   private ApplicationEventPublisher i;
   private PolicyManager j;
   private PolicyVersionManager k;
   private Config l;
   private final ServerPolicyFactory m;
   private final FolderCache n;
   private final EntitiesProcessedInBatch o;
   private DesignTimeEntityProvider p;
   private final ReadWriteLock q = ServiceAndPolicyCacheSharedLock.getLock();
   private boolean r = true;
   private boolean s = false;
   private final Set<Goid> t = new HashSet<>();
   private final Map<Goid, aa> u = new HashMap<>();
   private final Map<String, Goid> v = new HashMap<>();
   private final ConcurrentMap<Pair<PolicyType, String>, Set<String>> w = new ConcurrentHashMap<>();
   private final Map<String, PolicyCacheImpl.RegisteredPolicy> x = new HashMap<>();
   private static final String[] y;

   public PolicyCacheImpl(PlatformTransactionManager var1, ServerPolicyFactory var2, FolderCache var3, EntitiesProcessedInBatch var4) {
      this.g = var1;
      this.m = var2;
      this.n = var3;
      this.o = var4;
   }

   public void setEntityProvider(DesignTimeEntityProvider var1) {
      this.p = var1;
   }

   public void setConfig(Config var1) {
      this.l = var1;
   }

   public void setPolicyManager(PolicyManager var1) {
      this.j = var1;
   }

   public void setPolicyVersionManager(PolicyVersionManager var1) {
      this.k = var1;
   }

   public void setApplicationContext(ApplicationContext var1) {
      this.h = new Auditor(this, var1, d);
      this.i = var1;
   }

   public void setApplicationEventPublisher(ApplicationEventPublisher var1) {
      this.i = var1;
   }

   @Override
   public PolicyMetadata getPolicyMetadata(Policy var1) {
      boolean var10000;
      label16: {
         try {
            if (var1 != null) {
               var10000 = true;
               break label16;
            }
         } catch (IllegalArgumentException var2) {
            throw a(var2);
         }

         var10000 = false;
      }

      a(var10000, y[18]);
      return this.getPolicyMetadata(var1.getGoid());
   }

   @Override
   public PolicyMetadata getPolicyMetadata(Goid var1) {
      boolean var10000;
      label65: {
         try {
            if (!Goid.isDefault(var1)) {
               var10000 = true;
               break label65;
            }
         } catch (IllegalArgumentException var11) {
            throw a(var11);
         }

         var10000 = false;
      }

      a(var10000, y[17]);
      Lock var2 = this.q.readLock();
      var2.lock();

      try {
         aa var3 = this.e(var1);

         try {
            if (var3 == null || !var3.isValid()) {
               return null;
            }
         } catch (IllegalArgumentException var9) {
            throw a(var9);
         }

         return var3.getPolicyMetadata();
      } finally {
         var2.unlock();
      }
   }

   @Override
   public PolicyMetadata getPolicyMetadataByGuid(String param1) {
      // $VF: Couldn't be decompiled
      // Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
      // java.lang.RuntimeException: parsing failure!
      //   at org.jetbrains.java.decompiler.modules.decompiler.decompose.DomHelper.parseGraph(DomHelper.java:211)
      //   at org.jetbrains.java.decompiler.main.rels.MethodProcessor.codeToJava(MethodProcessor.java:174)
      //
      // Bytecode:
      // 00: aload 0
      // 01: getfield com/l7tech/server/policy/PolicyCacheImpl.q Ljava/util/concurrent/locks/ReadWriteLock;
      // 04: invokeinterface java/util/concurrent/locks/ReadWriteLock.readLock ()Ljava/util/concurrent/locks/Lock; 1
      // 09: astore 2
      // 0a: aload 2
      // 0b: invokeinterface java/util/concurrent/locks/Lock.lock ()V 1
      // 10: aload 0
      // 11: getfield com/l7tech/server/policy/PolicyCacheImpl.v Ljava/util/Map;
      // 14: aload 1
      // 15: invokeinterface java/util/Map.get (Ljava/lang/Object;)Ljava/lang/Object; 2
      // 1a: checkcast com/l7tech/objectmodel/Goid
      // 1d: astore 3
      // 1e: aload 3
      // 1f: ifnull 6c
      // 22: aload 3
      // 23: invokestatic com/l7tech/objectmodel/Goid.isDefault (Lcom/l7tech/objectmodel/Goid;)Z
      // 26: ifne 38
      // 29: goto 30
      // 2c: invokestatic com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 2f: athrow
      // 30: bipush 1
      // 31: goto 39
      // 34: invokestatic com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 37: athrow
      // 38: bipush 0
      // 39: getstatic com/l7tech/server/policy/PolicyCacheImpl.y [Ljava/lang/String;
      // 3c: bipush 0
      // 3d: aaload
      // 3e: invokestatic com/l7tech/server/policy/PolicyCacheImpl.a (ZLjava/lang/String;)V
      // 41: aload 0
      // 42: aload 3
      // 43: invokevirtual com/l7tech/server/policy/PolicyCacheImpl.e (Lcom/l7tech/objectmodel/Goid;)Lcom/l7tech/server/policy/aa;
      // 46: astore 4
      // 48: aload 4
      // 4a: ifnull 6c
      // 4d: aload 4
      // 4f: invokevirtual com/l7tech/server/policy/aa.isValid ()Z
      // 52: ifeq 6c
      // 55: goto 5c
      // 58: invokestatic com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 5b: athrow
      // 5c: aload 4
      // 5e: invokevirtual com/l7tech/server/policy/aa.getPolicyMetadata ()Lcom/l7tech/server/policy/PolicyMetadata;
      // 61: astore 5
      // 63: aload 2
      // 64: invokeinterface java/util/concurrent/locks/Lock.unlock ()V 1
      // 69: aload 5
      // 6b: areturn
      // 6c: aload 2
      // 6d: invokeinterface java/util/concurrent/locks/Lock.unlock ()V 1
      // 72: goto 80
      // 75: astore 6
      // 77: aload 2
      // 78: invokeinterface java/util/concurrent/locks/Lock.unlock ()V 1
      // 7d: aload 6
      // 7f: athrow
      // 80: aconst_null
      // 81: areturn
      // try (33 -> 38): 39 java/lang/IllegalArgumentException
      // try (14 -> 22): 22 java/lang/IllegalArgumentException
      // try (12 -> 17): 18 java/lang/IllegalArgumentException
      // try (6 -> 44): 51 null
      // try (51 -> 52): 51 null
   }

   @Override
   public List<Folder> getFolderPath(Goid param1) {
      // $VF: Couldn't be decompiled
      // Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
      // java.lang.RuntimeException: parsing failure!
      //   at org.jetbrains.java.decompiler.modules.decompiler.decompose.DomHelper.parseGraph(DomHelper.java:211)
      //   at org.jetbrains.java.decompiler.main.rels.MethodProcessor.codeToJava(MethodProcessor.java:174)
      //
      // Bytecode:
      // 00: aload 0
      // 01: aload 1
      // 02: invokevirtual com/l7tech/server/policy/PolicyCacheImpl.f (Lcom/l7tech/objectmodel/Goid;)Lcom/l7tech/server/policy/aa;
      // 05: astore 2
      // 06: aload 2
      // 07: ifnull 35
      // 0a: aload 2
      // 0b: getfield com/l7tech/server/policy/aa.b Lcom/l7tech/policy/Policy;
      // 0e: invokevirtual com/l7tech/policy/Policy.getFolder ()Lcom/l7tech/objectmodel/folder/Folder;
      // 11: ifnull 35
      // 14: goto 1b
      // 17: invokestatic com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 1a: athrow
      // 1b: aload 0
      // 1c: getfield com/l7tech/server/policy/PolicyCacheImpl.n Lcom/l7tech/server/folder/FolderCache;
      // 1f: aload 2
      // 20: getfield com/l7tech/server/policy/aa.b Lcom/l7tech/policy/Policy;
      // 23: invokevirtual com/l7tech/policy/Policy.getFolder ()Lcom/l7tech/objectmodel/folder/Folder;
      // 26: invokevirtual com/l7tech/objectmodel/folder/Folder.getGoid ()Lcom/l7tech/objectmodel/Goid;
      // 29: invokeinterface com/l7tech/server/folder/FolderCache.findPathByPrimaryKey (Lcom/l7tech/objectmodel/Goid;)Ljava/util/List; 2
      // 2e: goto 38
      // 31: invokestatic com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 34: athrow
      // 35: invokestatic java/util/Collections.emptyList ()Ljava/util/List;
      // 38: areturn
      // try (4 -> 10): 11 java/lang/IllegalArgumentException
      // try (6 -> 21): 21 java/lang/IllegalArgumentException
   }

   @Override
   public boolean isStarted() {
      return this.s;
   }

   @Override
   public ServerPolicyHandle getServerPolicy(Policy var1) {
      boolean var10000;
      label16: {
         try {
            if (var1 != null) {
               var10000 = true;
               break label16;
            }
         } catch (IllegalArgumentException var2) {
            throw a(var2);
         }

         var10000 = false;
      }

      a(var10000, y[29]);
      return this.getServerPolicy(var1.getGoid());
   }

   @Override
   public ServerPolicyHandle getServerPolicy(Goid var1) {
      boolean var10000;
      label65: {
         try {
            if (!Goid.isDefault(var1)) {
               var10000 = true;
               break label65;
            }
         } catch (IllegalArgumentException var11) {
            throw a(var11);
         }

         var10000 = false;
      }

      a(var10000, y[17]);
      Lock var2 = this.q.readLock();
      var2.lock();

      try {
         aa var3 = this.e(var1);

         try {
            if (var3 == null || !var3.isValid()) {
               return null;
            }
         } catch (IllegalArgumentException var9) {
            throw a(var9);
         }

         return var3.d.ref();
      } finally {
         var2.unlock();
      }
   }

   @Override
   public ServerPolicyHandle getServerPolicy(String var1) {
      boolean var10000;
      label70: {
         try {
            if (var1 != null) {
               var10000 = true;
               break label70;
            }
         } catch (IllegalArgumentException var12) {
            throw a(var12);
         }

         var10000 = false;
      }

      a(var10000, y[17]);
      Lock var2 = this.q.readLock();
      var2.lock();

      try {
         Goid var3 = this.v.get(var1);
         if (var3 != null) {
            aa var4 = this.e(var3);

            try {
               if (var4 == null || !var4.isValid()) {
                  return null;
               }
            } catch (IllegalArgumentException var10) {
               throw a(var10);
            }

            return var4.d.ref();
         }
      } finally {
         var2.unlock();
      }

      return null;
   }

   @Override
   public Set<String> getPoliciesByTypeAndTag(PolicyType param1, String param2) {
      // $VF: Couldn't be decompiled
      // Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
      // java.lang.RuntimeException: parsing failure!
      //   at org.jetbrains.java.decompiler.modules.decompiler.decompose.DomHelper.parseGraph(DomHelper.java:211)
      //   at org.jetbrains.java.decompiler.main.rels.MethodProcessor.codeToJava(MethodProcessor.java:174)
      //
      // Bytecode:
      // 000: aload 0
      // 001: invokevirtual com/l7tech/server/policy/PolicyCacheImpl.d ()V
      // 004: new com/l7tech/util/Pair
      // 007: dup
      // 008: aload 1
      // 009: aload 2
      // 00a: invokespecial com/l7tech/util/Pair.<init> (Ljava/lang/Object;Ljava/lang/Object;)V
      // 00d: astore 3
      // 00e: aload 0
      // 00f: getfield com/l7tech/server/policy/PolicyCacheImpl.w Ljava/util/concurrent/ConcurrentMap;
      // 012: aload 3
      // 013: invokeinterface java/util/concurrent/ConcurrentMap.get (Ljava/lang/Object;)Ljava/lang/Object; 2
      // 018: checkcast java/util/Set
      // 01b: astore 4
      // 01d: aload 4
      // 01f: ifnull 029
      // 022: aload 4
      // 024: areturn
      // 025: invokestatic com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 028: athrow
      // 029: new java/util/HashSet
      // 02c: dup
      // 02d: invokespecial java/util/HashSet.<init> ()V
      // 030: astore 4
      // 032: aload 0
      // 033: getfield com/l7tech/server/policy/PolicyCacheImpl.q Ljava/util/concurrent/locks/ReadWriteLock;
      // 036: invokeinterface java/util/concurrent/locks/ReadWriteLock.readLock ()Ljava/util/concurrent/locks/Lock; 1
      // 03b: astore 5
      // 03d: aload 5
      // 03f: invokeinterface java/util/concurrent/locks/Lock.lock ()V 1
      // 044: aload 0
      // 045: getfield com/l7tech/server/policy/PolicyCacheImpl.u Ljava/util/Map;
      // 048: invokeinterface java/util/Map.values ()Ljava/util/Collection; 1
      // 04d: invokeinterface java/util/Collection.iterator ()Ljava/util/Iterator; 1
      // 052: astore 6
      // 054: aload 6
      // 056: invokeinterface java/util/Iterator.hasNext ()Z 1
      // 05b: ifeq 102
      // 05e: aload 6
      // 060: invokeinterface java/util/Iterator.next ()Ljava/lang/Object; 1
      // 065: checkcast com/l7tech/server/policy/aa
      // 068: astore 7
      // 06a: aload 1
      // 06b: ifnull 081
      // 06e: aload 1
      // 06f: aload 7
      // 071: getfield com/l7tech/server/policy/aa.b Lcom/l7tech/policy/Policy;
      // 074: invokevirtual com/l7tech/policy/Policy.getType ()Lcom/l7tech/policy/PolicyType;
      // 077: if_acmpne 0ff
      // 07a: goto 081
      // 07d: invokestatic com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 080: athrow
      // 081: aload 2
      // 082: ifnull 0a2
      // 085: goto 08c
      // 088: invokestatic com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 08b: athrow
      // 08c: aload 2
      // 08d: aload 7
      // 08f: getfield com/l7tech/server/policy/aa.b Lcom/l7tech/policy/Policy;
      // 092: invokevirtual com/l7tech/policy/Policy.getInternalTag ()Ljava/lang/String;
      // 095: invokevirtual java/lang/String.equals (Ljava/lang/Object;)Z
      // 098: ifeq 0ff
      // 09b: goto 0a2
      // 09e: invokestatic com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 0a1: athrow
      // 0a2: aload 7
      // 0a4: getfield com/l7tech/server/policy/aa.b Lcom/l7tech/policy/Policy;
      // 0a7: invokevirtual com/l7tech/policy/Policy.isDisabled ()Z
      // 0aa: ifeq 0ef
      // 0ad: goto 0b4
      // 0b0: invokestatic com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 0b3: athrow
      // 0b4: getstatic com/l7tech/server/policy/PolicyCacheImpl.d Ljava/util/logging/Logger;
      // 0b7: getstatic java/util/logging/Level.INFO Ljava/util/logging/Level;
      // 0ba: getstatic com/l7tech/server/policy/PolicyCacheImpl.y [Ljava/lang/String;
      // 0bd: bipush 8
      // 0bf: aaload
      // 0c0: bipush 3
      // 0c1: anewarray 321
      // 0c4: dup
      // 0c5: bipush 0
      // 0c6: aload 7
      // 0c8: getfield com/l7tech/server/policy/aa.b Lcom/l7tech/policy/Policy;
      // 0cb: invokevirtual com/l7tech/policy/Policy.getType ()Lcom/l7tech/policy/PolicyType;
      // 0ce: aastore
      // 0cf: dup
      // 0d0: bipush 1
      // 0d1: aload 7
      // 0d3: getfield com/l7tech/server/policy/aa.b Lcom/l7tech/policy/Policy;
      // 0d6: invokevirtual com/l7tech/policy/Policy.getGoid ()Lcom/l7tech/objectmodel/Goid;
      // 0d9: aastore
      // 0da: dup
      // 0db: bipush 2
      // 0dc: aload 7
      // 0de: getfield com/l7tech/server/policy/aa.b Lcom/l7tech/policy/Policy;
      // 0e1: invokevirtual com/l7tech/policy/Policy.getName ()Ljava/lang/String;
      // 0e4: aastore
      // 0e5: invokevirtual java/util/logging/Logger.log (Ljava/util/logging/Level;Ljava/lang/String;[Ljava/lang/Object;)V
      // 0e8: goto 0ff
      // 0eb: invokestatic com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 0ee: athrow
      // 0ef: aload 4
      // 0f1: aload 7
      // 0f3: getfield com/l7tech/server/policy/aa.b Lcom/l7tech/policy/Policy;
      // 0f6: invokevirtual com/l7tech/policy/Policy.getGuid ()Ljava/lang/String;
      // 0f9: invokeinterface java/util/Set.add (Ljava/lang/Object;)Z 2
      // 0fe: pop
      // 0ff: goto 054
      // 102: aload 5
      // 104: invokeinterface java/util/concurrent/locks/Lock.unlock ()V 1
      // 109: goto 118
      // 10c: astore 8
      // 10e: aload 5
      // 110: invokeinterface java/util/concurrent/locks/Lock.unlock ()V 1
      // 115: aload 8
      // 117: athrow
      // 118: aload 0
      // 119: getfield com/l7tech/server/policy/PolicyCacheImpl.w Ljava/util/concurrent/ConcurrentMap;
      // 11c: aload 3
      // 11d: aload 4
      // 11f: invokeinterface java/util/concurrent/ConcurrentMap.putIfAbsent (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; 3
      // 124: pop
      // 125: aload 4
      // 127: areturn
      // try (66 -> 100): 100 java/lang/IllegalArgumentException
      // try (57 -> 70): 71 java/lang/IllegalArgumentException
      // try (52 -> 63): 64 java/lang/IllegalArgumentException
      // try (44 -> 54): 55 java/lang/IllegalArgumentException
      // try (42 -> 49): 50 java/lang/IllegalArgumentException
      // try (14 -> 18): 18 java/lang/IllegalArgumentException
      // try (30 -> 109): 112 null
      // try (112 -> 113): 112 null
   }

   @Override
   public String registerGlobalPolicy(String var1, PolicyType var2, String var3, String var4) {
      this.d();
      PolicyCacheImpl.RegisteredPolicy var5 = new PolicyCacheImpl.RegisteredPolicy(var1, var2, var3, var4);
      Lock var6 = this.q.writeLock();
      var6.lock();

      try {
         this.w.clear();
         this.x.put(var5.getGuid(), var5);
         this.d(var5);
      } finally {
         var6.unlock();
      }

      return var5.getGuid();
   }

   @Override
   public void unregisterGlobalPolicy(String var1) {
      this.d();
      Lock var3 = this.q.readLock();
      var3.lock();

      Goid var2;
      try {
         this.x.remove(var1);
         var2 = this.v.get(var1);
      } finally {
         var3.unlock();
      }

      try {
         if (var2 != null) {
            this.g(var2);
         }
      } catch (IllegalArgumentException var7) {
         throw a(var7);
      }
   }

   @Override
   public Map<Goid, Integer> getDependentVersions(Goid var1) {
      this.d();
      Lock var3 = this.q.readLock();
      var3.lock();

      Map var2;
      try {
         aa var4 = this.e(var1);

         label54: {
            try {
               if (var4 != null && var4.isValid()) {
                  break label54;
               }
            } catch (IllegalArgumentException var8) {
               throw a(var8);
            }

            return Collections.emptyMap();
         }

         var2 = var4.a().getDependentVersions(true);
      } finally {
         var3.unlock();
      }

      return var2;
   }

   @Override
   public String getUniquePolicyVersionIdentifer(Goid var1) {
      this.d();
      String var2 = null;
      Lock var3 = this.q.readLock();
      var3.lock();

      try {
         aa var4 = this.e(var1);

         try {
            if (var4 == null || !var4.isValid()) {
               return var2;
            }
         } catch (IllegalArgumentException var8) {
            throw a(var8);
         }

         var2 = var4.a().getPolicyUniqueIdentifier();
      } finally {
         var3.unlock();
      }

      return var2;
   }

   @Override
   public void update(Policy var1) {
      boolean var10000;
      label16: {
         try {
            this.d();
            if (!Goid.isDefault(var1.getGoid())) {
               var10000 = true;
               break label16;
            }
         } catch (IllegalArgumentException var2) {
            throw a(var2);
         }

         var10000 = false;
      }

      a(var10000, y[22]);
      this.c(this.a(var1));
   }

   @NotNull
   private Policy a(@NotNull Policy var1) {
      try {
         if (var1 == null) {
            a(0);
         }
      } catch (IllegalArgumentException var2) {
         throw a(var2);
      }

      return new Policy(var1, e, true, this.p);
   }

   @Override
   public void validate(Policy var1) throws CircularPolicyException {
      this.d();
      Objects.requireNonNull(var1, y[29]);
      Set var2 = this.b(this.c(var1.getGoid()));

      try {
         if (var2.isEmpty()) {
            return;
         }
      } catch (IOException var8) {
         throw a(var8);
      }

      try {
         Assertion var3 = var1.getAssertion();
         if (var3 != null) {
            Iterator var4 = var3.preorderIterator();

            while (var4.hasNext()) {
               Assertion var5 = (Assertion)var4.next();
               if (var5 instanceof Include var6) {
                  try {
                     if (var2.contains(var6.getPolicyGuid())) {
                        throw new CircularPolicyException(var1, var6.getPolicyGuid(), var6.getPolicyName());
                     }
                  } catch (IOException var7) {
                     throw a(var7);
                  }
               }
            }
         }
      } catch (IOException var9) {
      }
   }

   @Override
   public void validateRemove(Goid var1) throws PolicyDeletionForbiddenException {
      this.d();
      Lock var2 = this.q.readLock();
      var2.lock();

      try {
         this.h(var1);
      } finally {
         var2.unlock();
      }
   }

   @Override
   public Set<Policy> findUsages(Goid var1) {
      this.d();
      return this.c(var1);
   }

   @Override
   public boolean remove(Goid var1) {
      this.d();
      return this.g(var1);
   }

   @ManagedOperation(description = "Rebuild Policy Cache")
   public void initializePolicyCache() {
      long var1 = System.currentTimeMillis();
      this.logAndAudit(MessageProcessingMessages.POLICY_CACHE_BUILD);
      ArrayList var3 = new ArrayList();
      Lock var4 = this.q.writeLock();
      var4.lock();

      try {
         this.s = true;
         this.t.clear();

         for (aa var6 : this.u.values()) {
            ResourceUtils.closeQuietly(var6);
         }

         this.u.clear();
         this.v.clear();
         this.w.clear();

         for (Policy var15 : this.j.findAll()) {
            var15 = this.a(var15);
            this.a(var15, null, new HashSet<>(), new HashMap<>(), var3);
         }

         for (PolicyCacheImpl.RegisteredPolicy var17 : this.x.values()) {
            this.a(var17, null, new HashSet<>(), new HashMap<>(), var3);
         }

         this.r = false;
      } catch (FindException var10) {
         this.a();
         d.log(Level.WARNING, y[4], var10);
      } finally {
         var4.unlock();
      }

      for (PolicyCacheEvent var18 : var3) {
         this.a(var18);
      }

      this.a(new PolicyCacheEvent.Started(this));
      this.f();
      d.fine(new h(this, var1));
   }

   @Override
   public void onApplicationEvent(ApplicationEvent param1) {
      // $VF: Couldn't be decompiled
      // Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
      // java.lang.RuntimeException: parsing failure!
      //   at org.jetbrains.java.decompiler.modules.decompiler.decompose.DomHelper.parseGraph(DomHelper.java:211)
      //   at org.jetbrains.java.decompiler.main.rels.MethodProcessor.codeToJava(MethodProcessor.java:174)
      //
      // Bytecode:
      // 00: aload 1
      // 01: instanceof com/l7tech/server/event/system/LicenseChangeEvent
      // 04: ifne 15
      // 07: aload 1
      // 08: instanceof com/l7tech/server/policy/module/AssertionModuleRegistrationEvent
      // 0b: ifeq 28
      // 0e: goto 15
      // 11: invokestatic com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 14: athrow
      // 15: aload 0
      // 16: new com/l7tech/server/policy/s
      // 19: dup
      // 1a: aload 0
      // 1b: invokespecial com/l7tech/server/policy/s.<init> (Lcom/l7tech/server/policy/PolicyCacheImpl;)V
      // 1e: invokevirtual com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Runnable;)V
      // 21: goto 71
      // 24: invokestatic com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 27: athrow
      // 28: aload 1
      // 29: instanceof com/l7tech/server/policy/module/AssertionModuleUnregistrationEvent
      // 2c: ifeq 43
      // 2f: aload 0
      // 30: new com/l7tech/server/policy/u
      // 33: dup
      // 34: aload 0
      // 35: aload 1
      // 36: invokespecial com/l7tech/server/policy/u.<init> (Lcom/l7tech/server/policy/PolicyCacheImpl;Lorg/springframework/context/ApplicationEvent;)V
      // 39: invokevirtual com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Runnable;)V
      // 3c: goto 71
      // 3f: invokestatic com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 42: athrow
      // 43: aload 1
      // 44: instanceof com/l7tech/server/event/EntityInvalidationEvent
      // 47: ifeq 57
      // 4a: aload 1
      // 4b: checkcast com/l7tech/server/event/EntityInvalidationEvent
      // 4e: astore 2
      // 4f: aload 0
      // 50: aload 2
      // 51: invokevirtual com/l7tech/server/policy/PolicyCacheImpl.a (Lcom/l7tech/server/event/EntityInvalidationEvent;)V
      // 54: goto 71
      // 57: aload 1
      // 58: instanceof com/l7tech/server/event/system/Started
      // 5b: ifeq 71
      // 5e: aload 0
      // 5f: new com/l7tech/server/policy/v
      // 62: dup
      // 63: aload 0
      // 64: invokespecial com/l7tech/server/policy/v.<init> (Lcom/l7tech/server/policy/PolicyCacheImpl;)V
      // 67: invokevirtual com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Runnable;)V
      // 6a: goto 71
      // 6d: invokestatic com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 70: athrow
      // 71: return
      // try (0 -> 6): 7 java/lang/IllegalArgumentException
      // try (3 -> 16): 16 java/lang/IllegalArgumentException
      // try (18 -> 29): 29 java/lang/IllegalArgumentException
      // try (41 -> 50): 51 java/lang/IllegalArgumentException
   }

   private void a(EntityInvalidationEvent var1) {
      try {
         if (Policy.class.isAssignableFrom(var1.getEntityClass())) {
            this.b(var1);
            return;
         }
      } catch (IllegalArgumentException var3) {
         throw a(var3);
      }

      try {
         if (PolicyVersion.class.isAssignableFrom(var1.getEntityClass())) {
            this.c(var1);
         }
      } catch (IllegalArgumentException var2) {
         throw a(var2);
      }
   }

   private void b(EntityInvalidationEvent var1) {
      this.d();
      Goid var2 = Policy.DEFAULT_GOID;

      try {
         for (Goid var6 : var1.getEntityIds()) {
            var2 = var6;
            Policy var7 = (Policy)this.j.findByPrimaryKey(var6);

            try {
               if (var7 == null) {
                  this.b(var6);
                  continue;
               }
            } catch (FindException var10) {
               throw a(var10);
            }

            PolicyVersion var8 = this.k.findActiveVersionForPolicy(var6);

            try {
               if (var8 != null) {
                  this.a(var7, var8.getOrdinal());
                  continue;
               }
            } catch (FindException var9) {
               throw a(var9);
            }

            this.b(this.a(var7));
         }
      } catch (FindException var11) {
         this.a();
         this.logAndAudit(MessageProcessingMessages.POLICY_CACHE_STORAGE_ERROR, new String[]{Goid.toString(var2)}, var11);
      }

      this.e();
   }

   private void c(EntityInvalidationEvent param1) {
      // $VF: Couldn't be decompiled
      // Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
      // java.lang.RuntimeException: parsing failure!
      //   at org.jetbrains.java.decompiler.modules.decompiler.decompose.DomHelper.parseGraph(DomHelper.java:211)
      //   at org.jetbrains.java.decompiler.main.rels.MethodProcessor.codeToJava(MethodProcessor.java:174)
      //
      // Bytecode:
      // 000: aload 0
      // 001: invokevirtual com/l7tech/server/policy/PolicyCacheImpl.d ()V
      // 004: getstatic com/l7tech/policy/PolicyVersion.DEFAULT_GOID Lcom/l7tech/objectmodel/Goid;
      // 007: astore 2
      // 008: aload 1
      // 009: invokevirtual com/l7tech/server/event/EntityInvalidationEvent.getEntityIds ()[Lcom/l7tech/objectmodel/Goid;
      // 00c: aload 1
      // 00d: invokevirtual com/l7tech/server/event/EntityInvalidationEvent.getEntityOperations ()[C
      // 010: invokestatic com/l7tech/util/ArrayUtils.box ([C)[Ljava/lang/Character;
      // 013: invokestatic com/l7tech/util/ArrayUtils.zipI ([Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Iterable;
      // 016: astore 3
      // 017: aload 3
      // 018: invokeinterface java/lang/Iterable.spliterator ()Ljava/util/Spliterator; 1
      // 01d: bipush 0
      // 01e: invokestatic java/util/stream/StreamSupport.stream (Ljava/util/Spliterator;Z)Ljava/util/stream/Stream;
      // 021: invokeinterface java/util/stream/Stream.toList ()Ljava/util/List; 1
      // 026: astore 4
      // 028: aload 4
      // 02a: invokeinterface java/util/List.iterator ()Ljava/util/Iterator; 1
      // 02f: astore 5
      // 031: aload 5
      // 033: invokeinterface java/util/Iterator.hasNext ()Z 1
      // 038: ifeq 111
      // 03b: aload 5
      // 03d: invokeinterface java/util/Iterator.next ()Ljava/lang/Object; 1
      // 042: checkcast com/l7tech/util/Pair
      // 045: astore 6
      // 047: bipush 67
      // 049: aload 6
      // 04b: getfield com/l7tech/util/Pair.right Ljava/lang/Object;
      // 04e: checkcast java/lang/Character
      // 051: invokevirtual java/lang/Character.charValue ()C
      // 054: if_icmpeq 075
      // 057: bipush 85
      // 059: aload 6
      // 05b: getfield com/l7tech/util/Pair.right Ljava/lang/Object;
      // 05e: checkcast java/lang/Character
      // 061: invokevirtual java/lang/Character.charValue ()C
      // 064: if_icmpeq 075
      // 067: goto 06e
      // 06a: invokestatic com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 06d: athrow
      // 06e: goto 031
      // 071: invokestatic com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 074: athrow
      // 075: aload 6
      // 077: getfield com/l7tech/util/Pair.left Ljava/lang/Object;
      // 07a: checkcast com/l7tech/objectmodel/Goid
      // 07d: astore 7
      // 07f: aload 0
      // 080: getfield com/l7tech/server/policy/PolicyCacheImpl.k Lcom/l7tech/server/policy/PolicyVersionManager;
      // 083: aload 7
      // 085: invokeinterface com/l7tech/server/policy/PolicyVersionManager.findByPrimaryKey (Lcom/l7tech/objectmodel/Goid;)Lcom/l7tech/objectmodel/PersistentEntity; 2
      // 08a: checkcast com/l7tech/policy/PolicyVersion
      // 08d: astore 8
      // 08f: aload 8
      // 091: ifnull 031
      // 094: aload 8
      // 096: invokevirtual com/l7tech/policy/PolicyVersion.isActive ()Z
      // 099: ifne 0a3
      // 09c: goto 031
      // 09f: invokestatic com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 0a2: athrow
      // 0a3: aload 0
      // 0a4: aload 8
      // 0a6: invokevirtual com/l7tech/policy/PolicyVersion.getPolicyGoid ()Lcom/l7tech/objectmodel/Goid;
      // 0a9: invokevirtual com/l7tech/server/policy/PolicyCacheImpl.f (Lcom/l7tech/objectmodel/Goid;)Lcom/l7tech/server/policy/aa;
      // 0ac: invokestatic java/util/Optional.ofNullable (Ljava/lang/Object;)Ljava/util/Optional;
      // 0af: getstatic com/l7tech/server/policy/PolicyCacheImpl.c Lcom/l7tech/server/policy/aa;
      // 0b2: invokevirtual java/util/Optional.orElse (Ljava/lang/Object;)Ljava/lang/Object;
      // 0b5: checkcast com/l7tech/server/policy/aa
      // 0b8: astore 9
      // 0ba: aload 9
      // 0bc: invokevirtual com/l7tech/server/policy/aa.getPolicyHeader ()Lcom/l7tech/policy/PolicyHeader;
      // 0bf: astore 10
      // 0c1: aload 10
      // 0c3: ifnull 10e
      // 0c6: aload 10
      // 0c8: invokevirtual com/l7tech/policy/PolicyHeader.getPolicyRevision ()J
      // 0cb: aload 8
      // 0cd: invokevirtual com/l7tech/policy/PolicyVersion.getOrdinal ()J
      // 0d0: lcmp
      // 0d1: ifeq 10e
      // 0d4: goto 0db
      // 0d7: invokestatic com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 0da: athrow
      // 0db: aload 0
      // 0dc: getfield com/l7tech/server/policy/PolicyCacheImpl.j Lcom/l7tech/server/policy/PolicyManager;
      // 0df: aload 8
      // 0e1: invokevirtual com/l7tech/policy/PolicyVersion.getPolicyGoid ()Lcom/l7tech/objectmodel/Goid;
      // 0e4: invokeinterface com/l7tech/server/policy/PolicyManager.findByPrimaryKey (Lcom/l7tech/objectmodel/Goid;)Lcom/l7tech/objectmodel/PersistentEntity; 2
      // 0e9: checkcast com/l7tech/policy/Policy
      // 0ec: astore 11
      // 0ee: aload 11
      // 0f0: ifnonnull 103
      // 0f3: aload 0
      // 0f4: aload 8
      // 0f6: invokevirtual com/l7tech/policy/PolicyVersion.getPolicyGoid ()Lcom/l7tech/objectmodel/Goid;
      // 0f9: invokevirtual com/l7tech/server/policy/PolicyCacheImpl.b (Lcom/l7tech/objectmodel/Goid;)V
      // 0fc: goto 10e
      // 0ff: invokestatic com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 102: athrow
      // 103: aload 0
      // 104: aload 11
      // 106: aload 8
      // 108: invokevirtual com/l7tech/policy/PolicyVersion.getOrdinal ()J
      // 10b: invokevirtual com/l7tech/server/policy/PolicyCacheImpl.a (Lcom/l7tech/policy/Policy;J)V
      // 10e: goto 031
      // 111: goto 12c
      // 114: astore 3
      // 115: aload 0
      // 116: invokevirtual com/l7tech/server/policy/PolicyCacheImpl.a ()V
      // 119: aload 0
      // 11a: getstatic com/l7tech/gateway/common/audit/MessageProcessingMessages.POLICY_CACHE_STORAGE_ERROR Lcom/l7tech/gateway/common/audit/Messages$M;
      // 11d: bipush 1
      // 11e: anewarray 1116
      // 121: dup
      // 122: bipush 0
      // 123: aload 2
      // 124: invokestatic com/l7tech/objectmodel/Goid.toString (Lcom/l7tech/objectmodel/Goid;)Ljava/lang/String;
      // 127: aastore
      // 128: aload 3
      // 129: invokevirtual com/l7tech/server/policy/PolicyCacheImpl.logAndAudit (Lcom/l7tech/gateway/common/audit/AuditDetailMessage;[Ljava/lang/String;Ljava/lang/Exception;)V
      // 12c: return
      // try (93 -> 100): 100 com/l7tech/objectmodel/FindException
      // try (75 -> 83): 84 com/l7tech/objectmodel/FindException
      // try (57 -> 61): 61 com/l7tech/objectmodel/FindException
      // try (33 -> 43): 43 com/l7tech/objectmodel/FindException
      // try (27 -> 39): 40 com/l7tech/objectmodel/FindException
      // try (4 -> 108): 109 com/l7tech/objectmodel/FindException
   }

   private void a(Policy var1, long var2) {
      try {
         if (!this.o.wasProcessed(var1.getGoid(), var2)) {
            this.o.addProcessedEntity(var1.getGoid(), var2);
            this.b(this.a(var1));
            return;
         }
      } catch (IllegalArgumentException var4) {
         throw a(var4);
      }

      d.fine(new w(this, var1, var2));
   }

   @ManagedAttribute(description = "Cache Size", currencyTimeLimit = 30)
   public int getSize() {
      this.q.readLock().lock();

      try {
         return this.u.size();
      } finally {
         this.q.readLock().unlock();
      }
   }

   @ManagedAttribute(description = "Cached Policies", currencyTimeLimit = 30)
   public Set<Goid> getPolicies() {
      this.q.readLock().lock();

      try {
         return new TreeSet<>(this.u.keySet());
      } finally {
         this.q.readLock().unlock();
      }
   }

   @ManagedAttribute(description = "Unlicensed Policies", currencyTimeLimit = 30)
   public Set<Goid> getUnlicensedPolicies() {
      this.q.readLock().lock();

      try {
         return new TreeSet<>(this.t);
      } finally {
         this.q.readLock().unlock();
      }
   }

   void a(Level var1) {
      this.f = var1;
   }

   boolean a(Goid var1) {
      try {
         if (this.f(var1) != null) {
            return true;
         }
      } catch (IllegalArgumentException var2) {
         throw a(var2);
      }

      return false;
   }

   void a(Goid var1, boolean var2) {
      try {
         if (var2) {
            this.t.remove(var1);
            return;
         }
      } catch (IllegalArgumentException var3) {
         throw a(var3);
      }

      this.t.add(var1);
   }

   protected ServerAssertion buildServerPolicy(Policy var1) throws ServerPolicyException, InvalidPolicyException {
      Object var3 = e(var1);

      boolean var10000;
      label27: {
         try {
            if (var1.getVisibility() == e) {
               var10000 = true;
               break label27;
            }
         } catch (LicenseException var7) {
            throw a(var7);
         }

         var10000 = false;
      }

      a(var10000, new x(this));
      if (var3 == null) {
         var3 = new TrueAssertion();
      }

      ServerAssertion var2;
      try {
         var2 = this.m.compilePolicy((Assertion)var3, true);
         this.a(var1.getGoid(), true);
      } catch (LicenseException var6) {
         this.a(var1.getGoid(), false);
         this.logAndAudit(MessageProcessingMessages.POLICY_CACHE_UNLICENSED, var1.getName(), Goid.toString(var1.getGoid()), ExceptionUtils.getMessage(var6));
         String var5 = y[26] + ExceptionUtils.getMessage(var6);
         var2 = new ap(this, new UnknownAssertion(), var5);
      }

      return var2;
   }

   protected void logAndAudit(AuditDetailMessage var1, String... var2) {
      this.h.logAndAudit(var1, var2);
   }

   protected void logAndAudit(AuditDetailMessage var1, String[] var2, Exception var3) {
      this.h.logAndAudit(var1, var2, var3);
   }

   private void b(Policy var1) {
      this.d(var1);
   }

   private void b(Goid var1) {
      d.log(Level.FINE, new y(this, var1));
      this.g(var1);
   }

   private Set<Policy> c(Goid var1) {
      HashSet var2 = new HashSet();
      Lock var3 = this.q.readLock();
      var3.lock();

      try {
         aa var4 = this.e(var1);
         if (var4 != null) {
            for (Goid var7 : var4.f) {
               aa var8 = this.e(var7);

               try {
                  if (var8 != null) {
                     var2.add(var8.b);
                  }
               } catch (IllegalArgumentException var12) {
                  throw a(var12);
               }
            }
         }
      } finally {
         var3.unlock();
      }

      return Collections.unmodifiableSet(var2);
   }

   private void a(Goid var1, Map<Goid, Policy> var2) {
      Lock var3 = this.q.readLock();
      var3.lock();

      try {
         for (Policy var5 : this.c(var1)) {
            try {
               if (!var2.containsKey(var5.getGoid())) {
                  var2.put(var5.getGoid(), var5);
                  this.a(var5.getGoid(), var2);
               }
            } catch (IllegalArgumentException var9) {
               throw a(var9);
            }
         }
      } finally {
         var3.unlock();
      }
   }

   private void a(Goid param1, boolean param2, Set<Goid> param3) {
      // $VF: Couldn't be decompiled
      // Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
      // java.lang.RuntimeException: parsing failure!
      //   at org.jetbrains.java.decompiler.modules.decompiler.decompose.DomHelper.parseGraph(DomHelper.java:211)
      //   at org.jetbrains.java.decompiler.main.rels.MethodProcessor.codeToJava(MethodProcessor.java:174)
      //
      // Bytecode:
      // 00: aload 3
      // 01: invokeinterface java/util/Set.iterator ()Ljava/util/Iterator; 1
      // 06: astore 4
      // 08: aload 4
      // 0a: invokeinterface java/util/Iterator.hasNext ()Z 1
      // 0f: ifeq 58
      // 12: aload 4
      // 14: invokeinterface java/util/Iterator.next ()Ljava/lang/Object; 1
      // 19: checkcast com/l7tech/objectmodel/Goid
      // 1c: astore 5
      // 1e: aload 0
      // 1f: aload 5
      // 21: invokevirtual com/l7tech/server/policy/PolicyCacheImpl.e (Lcom/l7tech/objectmodel/Goid;)Lcom/l7tech/server/policy/aa;
      // 24: astore 6
      // 26: aload 6
      // 28: ifnull 55
      // 2b: iload 2
      // 2c: ifeq 49
      // 2f: goto 36
      // 32: invokestatic com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 35: athrow
      // 36: aload 6
      // 38: getfield com/l7tech/server/policy/aa.f Ljava/util/Set;
      // 3b: aload 1
      // 3c: invokeinterface java/util/Set.add (Ljava/lang/Object;)Z 2
      // 41: pop
      // 42: goto 55
      // 45: invokestatic com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 48: athrow
      // 49: aload 6
      // 4b: getfield com/l7tech/server/policy/aa.f Ljava/util/Set;
      // 4e: aload 1
      // 4f: invokeinterface java/util/Set.remove (Ljava/lang/Object;)Z 2
      // 54: pop
      // 55: goto 08
      // 58: return
      // try (14 -> 18): 19 java/lang/IllegalArgumentException
      // try (16 -> 27): 27 java/lang/IllegalArgumentException
   }

   private void a(aa var1) {
      try {
         if (!PersistentEntityUtil.isLocked(var1.b)) {
            throw new IllegalArgumentException(y[9]);
         }
      } catch (IllegalArgumentException var4) {
         throw a(var4);
      }

      aa var2 = this.u.put(var1.a, var1);

      try {
         if (var2 != null) {
            ResourceUtils.closeQuietly(var2);
            this.v.remove(var2.b.getGuid());
            var1.f.addAll(var2.f);
            this.a(var1.a, false, var2.b());
         }
      } catch (IllegalArgumentException var3) {
         throw a(var3);
      }

      this.v.put(var1.b.getGuid(), var1.a);
      this.a(var1.a, true, var1.b());
   }

   private aa d(Goid param1) {
      // $VF: Couldn't be decompiled
      // Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
      // java.lang.RuntimeException: parsing failure!
      //   at org.jetbrains.java.decompiler.modules.decompiler.decompose.DomHelper.parseGraph(DomHelper.java:211)
      //   at org.jetbrains.java.decompiler.main.rels.MethodProcessor.codeToJava(MethodProcessor.java:174)
      //
      // Bytecode:
      // 00: aload 0
      // 01: getfield com/l7tech/server/policy/PolicyCacheImpl.u Ljava/util/Map;
      // 04: aload 1
      // 05: invokeinterface java/util/Map.remove (Ljava/lang/Object;)Ljava/lang/Object; 2
      // 0a: checkcast com/l7tech/server/policy/aa
      // 0d: astore 2
      // 0e: aload 2
      // 0f: ifnull c5
      // 12: aload 2
      // 13: invokestatic com/l7tech/util/ResourceUtils.closeQuietly (Ljava/io/Closeable;)V
      // 16: aload 0
      // 17: getfield com/l7tech/server/policy/PolicyCacheImpl.v Ljava/util/Map;
      // 1a: aload 2
      // 1b: getfield com/l7tech/server/policy/aa.b Lcom/l7tech/policy/Policy;
      // 1e: invokevirtual com/l7tech/policy/Policy.getGuid ()Ljava/lang/String;
      // 21: invokeinterface java/util/Map.remove (Ljava/lang/Object;)Ljava/lang/Object; 2
      // 26: pop
      // 27: aload 0
      // 28: aload 1
      // 29: bipush 0
      // 2a: aload 2
      // 2b: invokevirtual com/l7tech/server/policy/aa.b ()Ljava/util/Set;
      // 2e: invokevirtual com/l7tech/server/policy/PolicyCacheImpl.a (Lcom/l7tech/objectmodel/Goid;ZLjava/util/Set;)V
      // 31: new java/util/HashSet
      // 34: dup
      // 35: invokespecial java/util/HashSet.<init> ()V
      // 38: astore 3
      // 39: aload 2
      // 3a: invokevirtual com/l7tech/server/policy/aa.b ()Ljava/util/Set;
      // 3d: invokeinterface java/util/Set.iterator ()Ljava/util/Iterator; 1
      // 42: astore 4
      // 44: aload 4
      // 46: invokeinterface java/util/Iterator.hasNext ()Z 1
      // 4b: ifeq 9d
      // 4e: aload 4
      // 50: invokeinterface java/util/Iterator.next ()Ljava/lang/Object; 1
      // 55: checkcast com/l7tech/objectmodel/Goid
      // 58: astore 5
      // 5a: aload 0
      // 5b: aload 5
      // 5d: invokevirtual com/l7tech/server/policy/PolicyCacheImpl.e (Lcom/l7tech/objectmodel/Goid;)Lcom/l7tech/server/policy/aa;
      // 60: astore 6
      // 62: aload 6
      // 64: ifnull 9a
      // 67: aload 6
      // 69: invokevirtual com/l7tech/server/policy/aa.isValid ()Z
      // 6c: ifne 9a
      // 6f: goto 76
      // 72: invokestatic com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 75: athrow
      // 76: aload 6
      // 78: getfield com/l7tech/server/policy/aa.f Ljava/util/Set;
      // 7b: invokeinterface java/util/Set.isEmpty ()Z 1
      // 80: ifeq 9a
      // 83: goto 8a
      // 86: invokestatic com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 89: athrow
      // 8a: aload 3
      // 8b: aload 5
      // 8d: invokeinterface java/util/Set.add (Ljava/lang/Object;)Z 2
      // 92: pop
      // 93: goto 9a
      // 96: invokestatic com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 99: athrow
      // 9a: goto 44
      // 9d: aload 3
      // 9e: invokeinterface java/util/Set.iterator ()Ljava/util/Iterator; 1
      // a3: astore 4
      // a5: aload 4
      // a7: invokeinterface java/util/Iterator.hasNext ()Z 1
      // ac: ifeq c5
      // af: aload 4
      // b1: invokeinterface java/util/Iterator.next ()Ljava/lang/Object; 1
      // b6: checkcast com/l7tech/objectmodel/Goid
      // b9: astore 5
      // bb: aload 0
      // bc: aload 5
      // be: invokevirtual com/l7tech/server/policy/PolicyCacheImpl.d (Lcom/l7tech/objectmodel/Goid;)Lcom/l7tech/server/policy/aa;
      // c1: pop
      // c2: goto a5
      // c5: aload 2
      // c6: areturn
      // try (42 -> 47): 48 java/lang/IllegalArgumentException
      // try (44 -> 54): 55 java/lang/IllegalArgumentException
      // try (50 -> 61): 62 java/lang/IllegalArgumentException
   }

   private aa e(Goid var1) {
      return this.u.get(var1);
   }

   private aa f(Goid var1) {
      Lock var3 = this.q.readLock();
      var3.lock();

      aa var2;
      try {
         var2 = this.e(var1);
      } finally {
         var3.unlock();
      }

      return var2;
   }

   private void c(Policy param1) {
      // $VF: Couldn't be decompiled
      // Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
      // java.lang.RuntimeException: parsing failure!
      //   at org.jetbrains.java.decompiler.modules.decompiler.decompose.DomHelper.parseGraph(DomHelper.java:211)
      //   at org.jetbrains.java.decompiler.main.rels.MethodProcessor.codeToJava(MethodProcessor.java:174)
      //
      // Bytecode:
      // 00: aload 0
      // 01: aload 1
      // 02: invokevirtual com/l7tech/policy/Policy.getGoid ()Lcom/l7tech/objectmodel/Goid;
      // 05: invokevirtual com/l7tech/server/policy/PolicyCacheImpl.f (Lcom/l7tech/objectmodel/Goid;)Lcom/l7tech/server/policy/aa;
      // 08: astore 2
      // 09: aload 2
      // 0a: ifnull 56
      // 0d: aload 2
      // 0e: invokevirtual com/l7tech/server/policy/aa.c ()Z
      // 11: ifne 56
      // 14: goto 1b
      // 17: invokestatic com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 1a: athrow
      // 1b: aload 2
      // 1c: invokevirtual com/l7tech/server/policy/aa.isValid ()Z
      // 1f: ifeq 56
      // 22: goto 29
      // 25: invokestatic com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 28: athrow
      // 29: aload 2
      // 2a: getfield com/l7tech/server/policy/aa.b Lcom/l7tech/policy/Policy;
      // 2d: invokevirtual com/l7tech/policy/Policy.getVersion ()I
      // 30: aload 1
      // 31: invokevirtual com/l7tech/policy/Policy.getVersion ()I
      // 34: if_icmpne 56
      // 37: goto 3e
      // 3a: invokestatic com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 3d: athrow
      // 3e: aload 2
      // 3f: getfield com/l7tech/server/policy/aa.b Lcom/l7tech/policy/Policy;
      // 42: invokevirtual com/l7tech/policy/Policy.getXml ()Ljava/lang/String;
      // 45: aload 1
      // 46: invokevirtual com/l7tech/policy/Policy.getXml ()Ljava/lang/String;
      // 49: invokevirtual java/lang/String.equals (Ljava/lang/Object;)Z
      // 4c: ifne 62
      // 4f: goto 56
      // 52: invokestatic com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 55: athrow
      // 56: aload 0
      // 57: aload 1
      // 58: invokevirtual com/l7tech/server/policy/PolicyCacheImpl.d (Lcom/l7tech/policy/Policy;)V
      // 5b: goto 62
      // 5e: invokestatic com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 61: athrow
      // 62: return
      // try (5 -> 10): 11 java/lang/IllegalArgumentException
      // try (7 -> 16): 17 java/lang/IllegalArgumentException
      // try (13 -> 25): 26 java/lang/IllegalArgumentException
      // try (19 -> 35): 36 java/lang/IllegalArgumentException
      // try (28 -> 41): 42 java/lang/IllegalArgumentException
   }

   private void d(Policy var1) {
      d.log(Level.FINE, new z(this, var1));
      ArrayList var2 = new ArrayList();
      Lock var3 = this.q.writeLock();
      var3.lock();

      try {
         this.w.clear();
         HashMap var4 = new HashMap();
         this.a(var1.getGoid(), var4);
         this.a(Collections.singleton(var1.getGoid()));
         this.a(var4.keySet());
         this.b(var1, null, new HashSet<>(), new HashMap<>(), var2);

         for (Policy var6 : var4.values()) {
            this.a(var6, null, new HashSet<>(), new HashMap<>(), var2);
            this.b(this.e(var6.getGoid()));
         }

         this.b(this.e(var1.getGoid()));
      } finally {
         var3.unlock();
      }

      for (PolicyCacheEvent var11 : var2) {
         this.a(var11);
      }
   }

   private boolean g(Goid var1) {
      boolean var2 = false;
      HashSet var4 = new HashSet();
      Lock var5 = this.q.writeLock();
      var5.lock();

      Policy var3;
      try {
         this.w.clear();
         aa var6 = this.e(var1);
         if (var6 == null) {
            var3 = null;
            String[] var10 = y;
            d.log(Level.FINE, var10[24], var1);
         } else {
            var2 = true;
            Policy var7 = var6.b;
            HashMap var8 = new HashMap();

            label73: {
               try {
                  this.a(var1, var8);
                  this.a(var8.keySet());
                  d.log(Level.FINE, y[32], var1);
                  if (var8.isEmpty()) {
                     this.d(var1);
                     break label73;
                  }
               } catch (IllegalArgumentException var15) {
                  throw a(var15);
               }

               d.log(Level.FINE, y[1], new Object[]{var1, var8.keySet()});
               this.a(var7, null, var8.keySet(), var4);
            }

            var3 = var7;
            this.b(this.e(var1));
         }
      } finally {
         var5.unlock();
      }

      try {
         if (var3 != null) {
            this.a(new PolicyCacheEvent.Deleted(this, var3));
         }
      } catch (IllegalArgumentException var14) {
         throw a(var14);
      }

      for (Goid var18 : var4) {
         this.a(new PolicyCacheEvent.Invalid(this, var18, null));
      }

      return var2;
   }

   private void a(Policy var1, @Nullable Goid var2, Set<Goid> var3, Set<Goid> var4) {
      Goid var5 = var1.getGoid();
      aa var6 = this.e(var5);

      try {
         if (var6 != null) {
            var4.add(var5);
            this.a(new aa(var6.b, var2));
         }
      } catch (IllegalArgumentException var12) {
         throw a(var12);
      }

      for (Policy var9 : this.c(var5)) {
         Goid var10 = var9.getGoid();

         try {
            if (var3.contains(var10)) {
               var3.remove(var10);
               this.a(var9, var5, var3, var4);
            }
         } catch (IllegalArgumentException var11) {
            throw a(var11);
         }
      }
   }

   private void a(Policy param1, @Nullable Policy param2, Set<Goid> param3, Map<Goid, Integer> param4, List<PolicyCacheEvent> param5) {
      // $VF: Couldn't be decompiled
      // Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
      // java.lang.RuntimeException: parsing failure!
      //   at org.jetbrains.java.decompiler.modules.decompiler.decompose.DomHelper.parseGraph(DomHelper.java:211)
      //   at org.jetbrains.java.decompiler.main.rels.MethodProcessor.codeToJava(MethodProcessor.java:174)
      //
      // Bytecode:
      // 00: aload 0
      // 01: aload 1
      // 02: invokevirtual com/l7tech/policy/Policy.getGoid ()Lcom/l7tech/objectmodel/Goid;
      // 05: invokevirtual com/l7tech/server/policy/PolicyCacheImpl.e (Lcom/l7tech/objectmodel/Goid;)Lcom/l7tech/server/policy/aa;
      // 08: astore 6
      // 0a: aload 6
      // 0c: ifnull 1e
      // 0f: aload 6
      // 11: invokevirtual com/l7tech/server/policy/aa.c ()Z
      // 14: ifeq 31
      // 17: goto 1e
      // 1a: invokestatic com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 1d: athrow
      // 1e: aload 0
      // 1f: aload 1
      // 20: aload 2
      // 21: aload 3
      // 22: aload 4
      // 24: aload 5
      // 26: invokevirtual com/l7tech/server/policy/PolicyCacheImpl.b (Lcom/l7tech/policy/Policy;Lcom/l7tech/policy/Policy;Ljava/util/Set;Ljava/util/Map;Ljava/util/List;)Lcom/l7tech/server/policy/aa;
      // 29: pop
      // 2a: goto 31
      // 2d: invokestatic com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 30: athrow
      // 31: return
      // try (5 -> 10): 11 java/lang/IllegalArgumentException
      // try (7 -> 21): 22 java/lang/IllegalArgumentException
   }

   aa b(Policy var1, @Nullable Policy var2, Set<Goid> var3, Map<Goid, Integer> var4, List<PolicyCacheEvent> var5) {
      Goid var6 = var1.getGoid();
      var4.put(var6, var1.getVersion());
      HashSet var7 = new HashSet();
      d.log(Level.FINE, new i(this, var6, var1));
      PolicyMetadata var9 = null;
      ServerAssertion var10 = null;
      Object var11 = null;
      MutableObject var12 = new MutableObject();

      try {
         try {
            a(var3.add(var6), new j(this, var2, var1));
            Assertion var8 = e(var1);
            Iterator var13 = Optional.ofNullable(var8.preorderIterator()).orElse(new EmptyIterator());

            while (var13.hasNext()) {
               Assertion var31 = (Assertion)var13.next();

               try {
                  if (!(var31 instanceof Include)) {
                     continue;
                  }
               } catch (ServerPolicyException var25) {
                  throw a(var25);
               }

               Include var15 = (Include)var31;
               String var16 = var15.getPolicyGuid();

               boolean var10000;
               label81: {
                  try {
                     d.log(Level.FINE, new k(this, var6, var1, var16, var15));
                     if (var16 != null) {
                        var10000 = true;
                        break label81;
                     }
                  } catch (ServerPolicyException var24) {
                     throw a(var24);
                  }

                  var10000 = false;
               }

               a(var10000, new l(this, var1));
               this.a(var1, var2, var15, var3, var7, var4, var5, var12);
            }

            var9 = this.a(var1, var8, var7);
            var10 = this.buildServerPolicy(var1);
         } catch (ServerPolicyException var26) {
            boolean var14 = true;
            if (ExceptionUtils.causedBy(var26, PolicyAssertionException.class)) {
               var14 = false;
            }

            this.a(var1, var26, var14);
            var11 = var26;
         } catch (ServerPolicyInstantiationException | CircularPolicyException | InvalidPolicyException var27) {
            this.a(var1, var27, false);
            var11 = var27;
         } catch (FindException var28) {
            this.a();
            this.logAndAudit(MessageProcessingMessages.POLICY_CACHE_STORAGE_ERROR, new String[]{Goid.toString(var6)}, var28);
            var11 = var28;
         }

         var3.remove(var6);
         aa var30 = this.a(var6, var1, var4, var7, var9, var10, (Goid)var12.getValue());
         this.a(var30);
         var10 = null;
         this.a(var6, var1, (Exception)var11, var5, var30);
         return var30;
      } finally {
         ResourceUtils.closeQuietly(var10);
      }
   }

   private void a(
      Policy var1,
      @Nullable Policy var2,
      Include var3,
      Set<Goid> var4,
      Set<Goid> var5,
      Map<Goid, Integer> var6,
      List<PolicyCacheEvent> var7,
      MutableObject<Goid> var8
   ) throws FindException, ServerPolicyInstantiationException, CircularPolicyException {
      String var9 = var3.getPolicyGuid();
      aa var11 = null;
      if (this.v.containsKey(var9)) {
         var11 = this.e(this.v.get(var9));
      }

      Goid var10;
      label66: {
         label70: {
            try {
               if (var11 != null && !var11.c()) {
                  break label70;
               }
            } catch (FindException var17) {
               throw a(var17);
            }

            d.log(Level.FINE, new m(this, var9, var3));
            Policy var12 = this.j.findByGuid(var9);

            boolean var10000;
            label55: {
               try {
                  if (var12 != null) {
                     var10000 = true;
                     break label55;
                  }
               } catch (FindException var16) {
                  throw a(var16);
               }

               var10000 = false;
            }

            a(var10000, new n(this, var1, var9));
            var10 = var12.getGoid();
            var5.add(var10);
            var11 = this.b(this.a(var12), var1, var4, var6, var7);
            break label66;
         }

         var10 = var11.a;
         var5.add(var10);
      }

      if (!var11.isValid()) {
         d.log(Level.FINE, new q(this, var10, var3));
         var11.f.add(var1.getGoid());
         var8.setValue(var11.a);
         String var10002 = String.valueOf(var1.getGoid());
         String var10003 = String.valueOf(var10);
         String[] var14 = y;
         throw new ServerPolicyInstantiationException(var14[25] + var10002 + var14[19] + var10003 + var14[7]);
      }

      d.log(Level.FINE, new o(this, var10, var3));
      var6.putAll(var11.a().getDependentVersions(true));
      var5.addAll(var11.a().getUsedPolicyIds(false));

      for (Goid var13 : var11.a().getUsedPolicyIds(false)) {
         boolean var19;
         label44: {
            try {
               if (!var4.contains(var13)) {
                  var19 = true;
                  break label44;
               }
            } catch (FindException var15) {
               throw a(var15);
            }

            var19 = false;
         }

         a(var19, new p(this, var2, var1));
      }
   }

   private static Assertion e(Policy var0) throws InvalidPolicyException {
      try {
         return var0.getAssertion();
      } catch (IOException var4) {
         String var10002 = String.valueOf(var0.getGoid());
         String var10003 = ExceptionUtils.getMessage(var4);
         String[] var3 = y;
         throw new InvalidPolicyException(var3[10] + var10002 + var3[27] + var10003, var4);
      }
   }

   @NotNull
   private aa a(Goid var1, Policy var2, Map<Goid, Integer> var3, Set<Goid> var4, PolicyMetadata var5, ServerAssertion var6, Goid var7) {
      aa var8;
      if (var6 != null) {
         ServerPolicy var9 = new ServerPolicy(var2, var5, var4, var3, var6, new r(this, var1));
         var8 = new aa(this.a(var2), var9, null);
      } else {
         var8 = new aa(this.a(var2), var7);
      }

      try {
         if (var8 == null) {
            a(1);
         }

         return var8;
      } catch (IllegalArgumentException var10) {
         throw a(var10);
      }
   }

   private void a(Goid var1, Policy var2, Exception var3, List<PolicyCacheEvent> var4, aa var5) {
      try {
         if (var5.isValid()) {
            var4.add(new PolicyCacheEvent.Updated(this, var2));
            return;
         }
      } catch (IllegalArgumentException var6) {
         throw a(var6);
      }

      var4.add(new PolicyCacheEvent.Invalid(this, var1, var3));
   }

   private void a(Policy var1, Exception var2, boolean var3) {
      PolicyCacheImpl var10000;
      M var10001;
      String[] var10002;
      Exception var10003;
      label16: {
         try {
            var10000 = this;
            var10001 = MessageProcessingMessages.POLICY_CACHE_INVALID;
            var10002 = new String[]{var1.getName(), var1.getId(), ExceptionUtils.getMessage(var2)};
            if (var3) {
               var10003 = var2;
               break label16;
            }
         } catch (IllegalArgumentException var4) {
            throw a(var4);
         }

         var10003 = (Exception)ExceptionUtils.getDebugException(var2);
      }

      var10000.logAndAudit(var10001, var10002, var10003);
   }

   private void a() {
      Lock var1 = this.q.writeLock();
      var1.lock();

      try {
         this.w.clear();
         this.r = true;
      } finally {
         var1.unlock();
      }
   }

   private void a(Set<Goid> var1) {
      for (Goid var3 : var1) {
         aa var4 = this.e(var3);

         try {
            if (var4 != null) {
               var4.d();
            }
         } catch (IllegalArgumentException var5) {
            throw a(var5);
         }
      }
   }

   private void h(Goid var1) throws PolicyDeletionForbiddenException {
      aa var2 = this.e(var1);

      try {
         if (var2 == null || var2.f.isEmpty()) {
            return;
         }
      } catch (PolicyDeletionForbiddenException var7) {
         throw a(var7);
      }

      for (Goid var4 : var2.f) {
         aa var5 = this.e(var4);

         try {
            if (var5 != null) {
               throw new PolicyDeletionForbiddenException(var2.b, EntityType.POLICY, var5.b);
            }
         } catch (PolicyDeletionForbiddenException var6) {
            throw a(var6);
         }
      }
   }

   private Set<String> b(Set<Policy> var1) {
      HashSet var2 = new HashSet();

      for (Policy var4 : var1) {
         var2.add(var4.getGuid());
      }

      return var2;
   }

   private PolicyMetadata a(Policy var1, @Nullable Assertion var2, Set<Goid> var3) throws FindException {
      long var4 = 0L;
      PolicyVersion var6 = this.k.findActiveVersionForPolicy(var1.getGoid());
      if (var6 != null) {
         var4 = var6.getOrdinal();
      }

      MutableBoolean var7 = new MutableBoolean(false);
      MutableBoolean var8 = new MutableBoolean(false);
      TreeSet var9 = new TreeSet<>(String.CASE_INSENSITIVE_ORDER);
      TreeMap var10 = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);

      Object var10000;
      label46: {
         try {
            if (var2 != null) {
               var10000 = var2.preorderIterator();
               break label46;
            }
         } catch (FindException var18) {
            throw a(var18);
         }

         var10000 = new EmptyIterator();
      }

      Object var11 = var10000;

      while (var11.hasNext()) {
         Assertion var12 = (Assertion)var11.next();

         try {
            if (!var12.isEnabled()) {
               continue;
            }
         } catch (FindException var17) {
            throw a(var17);
         }

         a(var12, var7, var8);
         a(var9, var10, var12);
      }

      for (Goid var13 : var3) {
         this.a(var13, var7, var8, var9, var10);
      }

      boolean var20 = var7.booleanValue();
      boolean var21 = var8.booleanValue();
      String[] var14 = var9.toArray(new String[var9.size()]);
      VariableMetadata[] var15 = var10.values().toArray(new VariableMetadata[0]);
      PolicyHeader var16 = new PolicyHeader(var1, var4);
      return new t(this, var20, var21, var14, var15, var16);
   }

   private void a(Goid param1, MutableBoolean param2, MutableBoolean param3, Set<String> param4, Map<String, VariableMetadata> param5) {
      // $VF: Couldn't be decompiled
      // Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
      // java.lang.RuntimeException: parsing failure!
      //   at org.jetbrains.java.decompiler.modules.decompiler.decompose.DomHelper.parseGraph(DomHelper.java:211)
      //   at org.jetbrains.java.decompiler.main.rels.MethodProcessor.codeToJava(MethodProcessor.java:174)
      //
      // Bytecode:
      // 00: aload 0
      // 01: aload 1
      // 02: invokevirtual com/l7tech/server/policy/PolicyCacheImpl.e (Lcom/l7tech/objectmodel/Goid;)Lcom/l7tech/server/policy/aa;
      // 05: astore 6
      // 07: aload 6
      // 09: ifnull 9b
      // 0c: aload 6
      // 0e: invokevirtual com/l7tech/server/policy/aa.isValid ()Z
      // 11: ifeq 9b
      // 14: goto 1b
      // 17: invokestatic com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 1a: athrow
      // 1b: aload 6
      // 1d: getfield com/l7tech/server/policy/aa.c Lcom/l7tech/server/policy/ServerPolicyHandle;
      // 20: invokevirtual com/l7tech/server/policy/ServerPolicyHandle.getPolicyMetadata ()Lcom/l7tech/server/policy/PolicyMetadata;
      // 23: astore 7
      // 25: aload 2
      // 26: aload 2
      // 27: invokevirtual org/apache/commons/lang3/mutable/MutableBoolean.booleanValue ()Z
      // 2a: ifne 3e
      // 2d: aload 7
      // 2f: invokeinterface com/l7tech/server/policy/PolicyMetadata.isWssInPolicy ()Z 1
      // 34: ifeq 46
      // 37: goto 3e
      // 3a: invokestatic com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 3d: athrow
      // 3e: bipush 1
      // 3f: goto 47
      // 42: invokestatic com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 45: athrow
      // 46: bipush 0
      // 47: invokevirtual org/apache/commons/lang3/mutable/MutableBoolean.setValue (Z)V
      // 4a: aload 3
      // 4b: aload 3
      // 4c: invokevirtual org/apache/commons/lang3/mutable/MutableBoolean.booleanValue ()Z
      // 4f: ifne 63
      // 52: aload 7
      // 54: invokeinterface com/l7tech/server/policy/PolicyMetadata.isMultipart ()Z 1
      // 59: ifeq 6b
      // 5c: goto 63
      // 5f: invokestatic com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 62: athrow
      // 63: bipush 1
      // 64: goto 6c
      // 67: invokestatic com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 6a: athrow
      // 6b: bipush 0
      // 6c: invokevirtual org/apache/commons/lang3/mutable/MutableBoolean.setValue (Z)V
      // 6f: aload 7
      // 71: invokeinterface com/l7tech/server/policy/PolicyMetadata.getVariablesUsed ()[Ljava/lang/String; 1
      // 76: astore 8
      // 78: aload 8
      // 7a: ifnull 91
      // 7d: aload 4
      // 7f: aload 8
      // 81: invokestatic java/util/Arrays.asList ([Ljava/lang/Object;)Ljava/util/List;
      // 84: invokeinterface java/util/Set.addAll (Ljava/util/Collection;)Z 2
      // 89: pop
      // 8a: goto 91
      // 8d: invokestatic com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 90: athrow
      // 91: aload 5
      // 93: aload 7
      // 95: invokestatic com/l7tech/policy/variable/PolicyVariableUtils.getVariablesSetNoThrow (Lcom/l7tech/policy/assertion/SetsVariables;)[Lcom/l7tech/policy/variable/VariableMetadata;
      // 98: invokestatic com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/util/Map;[Lcom/l7tech/policy/variable/VariableMetadata;)V
      // 9b: return
      // try (4 -> 9): 10 java/lang/IllegalArgumentException
      // try (16 -> 23): 24 java/lang/IllegalArgumentException
      // try (20 -> 28): 28 java/lang/IllegalArgumentException
      // try (31 -> 39): 40 java/lang/IllegalArgumentException
      // try (36 -> 44): 44 java/lang/IllegalArgumentException
      // try (51 -> 58): 59 java/lang/IllegalArgumentException
   }

   private static void a(Assertion param0, MutableBoolean param1, MutableBoolean param2) {
      // $VF: Couldn't be decompiled
      // Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
      // java.lang.RuntimeException: parsing failure!
      //   at org.jetbrains.java.decompiler.modules.decompiler.decompose.DomHelper.parseGraph(DomHelper.java:211)
      //   at org.jetbrains.java.decompiler.main.rels.MethodProcessor.codeToJava(MethodProcessor.java:174)
      //
      // Bytecode:
      // 00: aload 0
      // 01: invokestatic com/l7tech/policy/assertion/Assertion.isRequest (Lcom/l7tech/policy/assertion/Assertion;)Z
      // 04: ifeq 21
      // 07: aload 0
      // 08: invokestatic com/l7tech/policy/assertion/Assertion.isWSSecurity (Lcom/l7tech/policy/assertion/Assertion;)Z
      // 0b: ifeq 21
      // 0e: goto 15
      // 11: invokestatic com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 14: athrow
      // 15: aload 1
      // 16: bipush 1
      // 17: invokevirtual org/apache/commons/lang3/mutable/MutableBoolean.setValue (Z)V
      // 1a: goto 42
      // 1d: invokestatic com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 20: athrow
      // 21: aload 0
      // 22: invokestatic com/l7tech/policy/assertion/Assertion.isMultipart (Lcom/l7tech/policy/assertion/Assertion;)Z
      // 25: ifeq 42
      // 28: aload 0
      // 29: invokestatic com/l7tech/policy/assertion/Assertion.isRequest (Lcom/l7tech/policy/assertion/Assertion;)Z
      // 2c: ifeq 42
      // 2f: goto 36
      // 32: invokestatic com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 35: athrow
      // 36: aload 2
      // 37: bipush 1
      // 38: invokevirtual org/apache/commons/lang3/mutable/MutableBoolean.setValue (Z)V
      // 3b: goto 42
      // 3e: invokestatic com/l7tech/server/policy/PolicyCacheImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 41: athrow
      // 42: return
      // try (0 -> 6): 7 java/lang/IllegalArgumentException
      // try (3 -> 13): 13 java/lang/IllegalArgumentException
      // try (15 -> 21): 22 java/lang/IllegalArgumentException
      // try (18 -> 27): 28 java/lang/IllegalArgumentException
   }

   private static void a(Set<String> var0, Map<String, VariableMetadata> var1, Assertion var2) {
      if (var2 instanceof UsesVariables) {
         String[] var3 = PolicyVariableUtils.getVariablesUsedNoThrow((UsesVariables)var2);

         try {
            if (var3 != null) {
               var0.addAll(Arrays.asList(var3));
            }
         } catch (IllegalArgumentException var4) {
            throw a(var4);
         }
      }

      if (var2 instanceof SetsVariables) {
         VariableMetadata[] var5 = PolicyVariableUtils.getVariablesSetNoThrow((SetsVariables)var2);
         a(var1, var5);
      }
   }

   private static void a(Map<String, VariableMetadata> var0, VariableMetadata[] var1) {
      if (var1 != null) {
         for (VariableMetadata var5 : var1) {
            var0.put(var5.getName(), var5);
         }
      }
   }

   private void b() {
      Lock var2 = this.q.readLock();
      var2.lock();

      HashSet var1;
      try {
         var1 = new HashSet<>(this.t);
      } finally {
         var2.unlock();
      }

      int var3 = var1.size();

      try {
         if (var3 < 1) {
            return;
         }
      } catch (IllegalArgumentException var7) {
         throw a(var7);
      }

      this.logAndAudit(MessageProcessingMessages.POLICY_CACHE_RESETTING_POLICIES, Integer.toString(var3));
      this.c(var1);
   }

   private void c() {
      Lock var2 = this.q.readLock();
      var2.lock();

      HashSet var1;
      try {
         var1 = new HashSet<>(this.u.keySet());
      } finally {
         var2.unlock();
      }

      this.logAndAudit(MessageProcessingMessages.POLICY_CACHE_MODULE_UNLOAD);
      this.c(var1);
   }

   private boolean a(Either<ModularAssertionModule, CustomAssertionModule> var1) {
      try {
         if (var1.isLeft()) {
            return this.a((BaseAssertionModule<?>)var1.left());
         }
      } catch (IllegalArgumentException var2) {
         throw a(var2);
      }

      return this.a((BaseAssertionModule<?>)var1.right());
   }

   private boolean a(BaseAssertionModule<?> var1) {
      try {
         if (!var1.isFromDb()) {
            return true;
         }
      } catch (IllegalArgumentException var9) {
         throw a(var9);
      }

      String[] var7 = y;
      String[] var2 = this.l.getProperty(var7[2], "").split(var7[14]);

      for (String var6 : var2) {
         try {
            if (var6.equals(var1.getEntityName())) {
               return false;
            }
         } catch (IllegalArgumentException var8) {
            throw a(var8);
         }
      }

      return true;
   }

   private void c(Set<Goid> var1) {
      Lock var2 = this.q.writeLock();
      var2.lock();

      try {
         this.w.clear();
         this.a(var1);

         for (Goid var4 : var1) {
            aa var5 = this.e(var4);

            try {
               if (var5 == null) {
                  continue;
               }
            } catch (FindException var14) {
               throw a(var14);
            }

            Policy var6 = null;

            try {
               var6 = (Policy)this.j.findByPrimaryKey(var4);
            } catch (FindException var13) {
               this.a();
               this.logAndAudit(MessageProcessingMessages.POLICY_CACHE_STORAGE_ERROR, new String[]{var4.toString()}, var13);
            }

            try {
               if (var6 != null) {
                  this.d(this.a(var6));
                  continue;
               }
            } catch (FindException var15) {
               throw a(var15);
            }

            this.g(var4);
         }
      } finally {
         var2.unlock();
      }

      this.a(new PolicyCacheEvent.Reset(this));
   }

   private void d() {
      Lock var2 = this.q.readLock();
      var2.lock();

      boolean var1;
      try {
         boolean var10000;
         label46: {
            if (this.s) {
               try {
                  if (this.r) {
                     var10000 = true;
                     break label46;
                  }
               } catch (IllegalArgumentException var8) {
                  throw a(var8);
               }
            }

            var10000 = false;
         }

         var1 = var10000;
      } finally {
         var2.unlock();
      }

      try {
         if (var1) {
            this.initializePolicyCache();
         }
      } catch (IllegalArgumentException var7) {
         throw a(var7);
      }
   }

   private void a(Runnable var1) {
      try {
         if (this.g != null) {
            new TransactionTemplate(this.g).execute(new aw(this, var1));
            return;
         }
      } catch (IllegalArgumentException var2) {
         throw a(var2);
      }

      var1.run();
   }

   private void a(PolicyCacheEvent var1) {
      this.i.publishEvent(var1);
   }

   private void e() {
      this.i.publishEvent(new PolicyReloadEvent(this));
   }

   private void f() {
      if (d.isLoggable(this.f)) {
         Lock var1 = this.q.readLock();
         var1.lock();

         try {
            for (aa var3 : this.u.values()) {
               this.b(var3);
            }
         } finally {
            var1.unlock();
         }
      }
   }

   private void b(aa var1) {
      try {
         if (var1 == null || !d.isLoggable(this.f)) {
            return;
         }
      } catch (IllegalArgumentException var5) {
         throw a(var5);
      }

      StringBuilder var2 = new StringBuilder();

      label23: {
         try {
            var2.append(y[12]);
            var2.append(var1.b.getVersion());
            var2.append('\n');
            if (var1.isValid()) {
               var2.append(y[30]);
               var2.append(var1.a().getPolicyUniqueIdentifier());
               var2.append('\n');
               var2.append(y[16]);
               var2.append(var1.a().getUsedPolicyIds(false));
               var2.append('\n');
               break label23;
            }
         } catch (IllegalArgumentException var4) {
            throw a(var4);
         }

         String[] var3 = y;
         var2.append(var3[33]);
      }

      String[] var6 = y;
      var2.append(var6[23]);
      var2.append(var1.f);
      var2.append('\n');
      d.log(this.f, var6[15] + var1.a + "\n" + var2.toString());
   }

   private static <T extends Exception> void a(boolean var0, @NotNull Supplier<T> var1) throws T {
      try {
         if (var1 == null) {
            a(2);
         }
      } catch (Exception var3) {
         throw a(var3);
      }

      try {
         if (!var0) {
            throw (Exception)var1.get();
         }
      } catch (Exception var2) {
         throw a(var2);
      }
   }

   private static void a(boolean var0, String var1) {
      try {
         if (!var0) {
            throw new IllegalArgumentException(var1);
         }
      } catch (IllegalArgumentException var2) {
         throw a(var2);
      }
   }

   static {
      String[] var5 = new String[34];
      int var3 = 0;
      String var2 = "I\u001bsvG\u0013\u0013e\u0017m8_VPkZ\u007f#R]\u0014'\u0014x&\u0013C\u001ff\u0013~(\u001e\u001e\u0019~Zp$@GPh\u001f=\"RE\u0015nZ{8A@\u0004-I\u001b~9Z]\u0017**r=ZP\t*YfaN\u0013\u0011yZt?ER\u001cc\u001e=7\\AP\u007f\tx#@\tPqK`Hy\u001fo'VA=e\u001eh=Vu\u0019f\u001f3\u0001\\_\u0019i\u0003^0P[\u0015C\u0014k0_Z\u0014k\u000et>]|\u001e_\u0014o4TZ\u0003~\b|%Z\\\u001e$\u001fe2_F\u0014o\u001eP>WF\u001co\t\u000ez\bx!RA\u0015n*r=ZP\t\u0018O\bo>A\u0013\u0011i\u0019x\"@Z\u001emZm>_Z\u0013c\u001fn\u0011o\u0002~4CG\u0019e\u0014N$CC\u001cc\u001fo\ni\u0012x2Xe\u0011f\u000fx\u0012-Zj9ZP\u0018*\u0013nqZ]\u0006k\u0016t5&C\u001ds>AZ\u001emZy8@R\u0012f\u001fyq\u0014\u0014\u000b:\u0007:v\u0013\tP)\u0001,,\u0013\u001b\u000b8\u000747_\u0014q>PX\u0015nZm>_Z\u0013sZp0J\u0013\u001ee\u000e=3V\u0013\u0000f\u001b~4W\u0013\u0019d\u000erqG[\u0015*\nr=ZP\t*\u0019|2[V\u0017C\u0014k0_Z\u0014*\nr=ZP\t*\rt%[\u0013\u0019nZ(i\u0015p~_\u0004\u0004o\u0019u~@V\u0002|\u001fo~C\\\u001cc\u0019d~c\\\u001cc\u0019d\u0012RP\u0018o3p!_\t\\\u001fo\"Z\\\u001e0Z>K\bz$^V\u001e~Z{>A\u00130D\u0015i\u001fF_\u001c*\n|#R^\u0015~\u001foq\u0014\u0016\u0003-Zr7\u0013\u0016\u0003$_nq^F\u0003~Zs>G\u0013\u0012oZs$__\u0007V\t7}o@Z\u001bN\u001fm4]W\u0015d\u0019dqZ]\u0016eZ{>A\u0013\u0000e\u0016t2J\u0013\u0006_\tx\"\t\u00138I\u001bsvG\u0013\u0013e\u0017m8_VPkZ\u007f#R]\u0014'\u0014x&\u0013C\u001ff\u0013~(\u001e\u001e\u0019~Zp$@GPh\u001f=\"RE\u0015nZ{8A@\u0004\u0017z\u0015q8PJPg\u000fn%\u0013]\u001f~Z\u007f4\u0013]\u0005f\u0016\u0014*\bx7VA\u0003*\u000erqc\\\u001cc\u0019dq\u0010\u0014\u0006z\u0015q8PJ\u0016i\bx0GV e\u0016t2Jp\u0011i\u0012x\u0014]G\u0002s7I\u001bsvG\u0013\u0005z\u001e|%V\u0013\u0011*\u0018o0]W]d\u001fjqC\\\u001cc\u0019d|\u001eZ\u0004*\u0017h\"G\u0013\u0012oZn0EV\u0014*\u001ct#@G\t_\tx5\u0013q\t0Z(D\u0015=4]G\u0002sZ{>F]\u0014*\u001cr#\u0013c\u001ff\u0013~(\u0013\u0010\u000b:\u00071qZT\u001ee\bt?T\u001dC\u0014~=FW\u0015*\u001bn\"VA\u0004c\u0015sqZ]PZ\u0015q8PJP)\u0019K\tn4AG\u0019e\u0014=?\\GPk\f|8_R\u0012f\u001f'q\u00020Z(i\u0015p~_\u0004\u0004o\u0019u~@V\u0002|\u001fo~C\\\u001cc\u0019d~c\\\u001cc\u0019d\u0012RP\u0018o3p!_\u0017z\u0015q8PJPg\u000fn%\u0013]\u001f~Z\u007f4\u0013]\u0005f\u0016\u0010_\u0014t FVP\\\u001fo\"Z\\\u001e0Z*J4r%}F\u001cfZp4G[\u001fnZ8\"\u001d\u0016\u0003*\u0017h\"G\u0013\u001ee\u000e=#VG\u0005x\u0014=?F_\u001c";
      int var4 = "I\u001bsvG\u0013\u0013e\u0017m8_VPkZ\u007f#R]\u0014'\u0014x&\u0013C\u001ff\u0013~(\u001e\u001e\u0019~Zp$@GPh\u001f=\"RE\u0015nZ{8A@\u0004-I\u001b~9Z]\u0017**r=ZP\t*YfaN\u0013\u0011yZt?ER\u001cc\u001e=7\\AP\u007f\tx#@\tPqK`Hy\u001fo'VA=e\u001eh=Vu\u0019f\u001f3\u0001\\_\u0019i\u0003^0P[\u0015C\u0014k0_Z\u0014k\u000et>]|\u001e_\u0014o4TZ\u0003~\b|%Z\\\u001e$\u001fe2_F\u0014o\u001eP>WF\u001co\t\u000ez\bx!RA\u0015n*r=ZP\t\u0018O\bo>A\u0013\u0011i\u0019x\"@Z\u001emZm>_Z\u0013c\u001fn\u0011o\u0002~4CG\u0019e\u0014N$CC\u001cc\u001fo\ni\u0012x2Xe\u0011f\u000fx\u0012-Zj9ZP\u0018*\u0013nqZ]\u0006k\u0016t5&C\u001ds>AZ\u001emZy8@R\u0012f\u001fyq\u0014\u0014\u000b:\u0007:v\u0013\tP)\u0001,,\u0013\u001b\u000b8\u000747_\u0014q>PX\u0015nZm>_Z\u0013sZp0J\u0013\u001ee\u000e=3V\u0013\u0000f\u001b~4W\u0013\u0019d\u000erqG[\u0015*\nr=ZP\t*\u0019|2[V\u0017C\u0014k0_Z\u0014*\nr=ZP\t*\rt%[\u0013\u0019nZ(i\u0015p~_\u0004\u0004o\u0019u~@V\u0002|\u001fo~C\\\u001cc\u0019d~c\\\u001cc\u0019d\u0012RP\u0018o3p!_\t\\\u001fo\"Z\\\u001e0Z>K\bz$^V\u001e~Z{>A\u00130D\u0015i\u001fF_\u001c*\n|#R^\u0015~\u001foq\u0014\u0016\u0003-Zr7\u0013\u0016\u0003$_nq^F\u0003~Zs>G\u0013\u0012oZs$__\u0007V\t7}o@Z\u001bN\u001fm4]W\u0015d\u0019dqZ]\u0016eZ{>A\u0013\u0000e\u0016t2J\u0013\u0006_\tx\"\t\u00138I\u001bsvG\u0013\u0013e\u0017m8_VPkZ\u007f#R]\u0014'\u0014x&\u0013C\u001ff\u0013~(\u001e\u001e\u0019~Zp$@GPh\u001f=\"RE\u0015nZ{8A@\u0004\u0017z\u0015q8PJPg\u000fn%\u0013]\u001f~Z\u007f4\u0013]\u0005f\u0016\u0014*\bx7VA\u0003*\u000erqc\\\u001cc\u0019dq\u0010\u0014\u0006z\u0015q8PJ\u0016i\bx0GV e\u0016t2Jp\u0011i\u0012x\u0014]G\u0002s7I\u001bsvG\u0013\u0005z\u001e|%V\u0013\u0011*\u0018o0]W]d\u001fjqC\\\u001cc\u0019d|\u001eZ\u0004*\u0017h\"G\u0013\u0012oZn0EV\u0014*\u001ct#@G\t_\tx5\u0013q\t0Z(D\u0015=4]G\u0002sZ{>F]\u0014*\u001cr#\u0013c\u001ff\u0013~(\u0013\u0010\u000b:\u00071qZT\u001ee\bt?T\u001dC\u0014~=FW\u0015*\u001bn\"VA\u0004c\u0015sqZ]PZ\u0015q8PJP)\u0019K\tn4AG\u0019e\u0014=?\\GPk\f|8_R\u0012f\u001f'q\u00020Z(i\u0015p~_\u0004\u0004o\u0019u~@V\u0002|\u001fo~C\\\u001cc\u0019d~c\\\u001cc\u0019d\u0012RP\u0018o3p!_\u0017z\u0015q8PJPg\u000fn%\u0013]\u001f~Z\u007f4\u0013]\u0005f\u0016\u0010_\u0014t FVP\\\u001fo\"Z\\\u001e0Z*J4r%}F\u001cfZp4G[\u001fnZ8\"\u001d\u0016\u0003*\u0017h\"G\u0013\u001ee\u000e=#VG\u0005x\u0014=?F_\u001c"
         .length();
      char var1 = '8';
      int var7 = -1;

      label24:
      while (true) {
         byte var10000 = 85;
         String var10001 = var2.substring(++var7, var7 + var1);
         byte var10002 = -1;

         while (true) {
            String var8 = a(var10000, a(var10001));
            switch (var10002) {
               case 0:
                  var5[var3++] = var8;
                  if ((var7 += var1) >= var4) {
                     y = var5;
                     String[] var9 = y;
                     a = y[29];
                     b = var9[17];
                     c = new aa();
                     d = Logger.getLogger(PolicyCacheImpl.class.getName());
                     e = Visibility.omitDisabled;
                     return;
                  }

                  var1 = var2.charAt(var7);
                  break;
               default:
                  var5[var3++] = var8;
                  if ((var7 += var1) < var4) {
                     var1 = var2.charAt(var7);
                     continue label24;
                  }

                  var2 = "g(L\u0005mwm\u0014<\u0010\u0011.f,DgB\t`.)R+E\u0018kjv\u00175E\u0001ax$Y \u0000\n|a \u0017$A\u000ffk\u0010d3A\u0018{}w\u0017\u000eN\u001aob$SM";
                  var4 = "g(L\u0005mwm\u0014<\u0010\u0011.f,DgB\t`.)R+E\u0018kjv\u00175E\u0001ax$Y \u0000\n|a \u0017$A\u000ffk\u0010d3A\u0018{}w\u0017\u000eN\u001aob$SM"
                     .length();
                  var1 = '0';
                  var7 = -1;
            }

            var10000 = 104;
            var10001 = var2.substring(++var7, var7 + var1);
            var10002 = 0;
         }
      }
   }

   private static Exception a(Exception var0) {
      return var0;
   }

   private static char[] a(String var0) {
      char[] var10000 = var0.toCharArray();
      if (var10000.length < 2) {
         var10000[0] = (char)(var10000[0] ^ 37);
      }

      return var10000;
   }

   private static String a(int var0, char[] var1) {
      int var10003 = var1.length;
      int var10002 = var0;
      char[] var10001 = var1;
      int var10000 = var10003;

      for (int var2 = 0; var10000 > var2; var2++) {
         var10001[var2] = (char)(var10001[var2] ^ var10002 ^ switch (var2 % 7) {
            case 0 -> 95;
            case 1 -> 47;
            case 2 -> 72;
            case 3 -> 4;
            case 4 -> 102;
            case 5 -> 102;
            default -> 37;
         });
      }

      return new String(var10001).intern();
   }

   private static final class RegisteredPolicy extends Policy {
      private static final AtomicLong registeredOidCounter;
      static final long serialVersionUID = -1598198985386651340L;
      private static final String[] c;

      RegisteredPolicy(String param1, PolicyType param2, String param3, String param4) {
         // $VF: Couldn't be decompiled
         // Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
         // java.lang.RuntimeException: parsing failure!
         //   at org.jetbrains.java.decompiler.modules.decompiler.decompose.DomHelper.parseGraph(DomHelper.java:211)
         //   at org.jetbrains.java.decompiler.main.rels.MethodProcessor.codeToJava(MethodProcessor.java:174)
         //
         // Bytecode:
         // 00: aload 0
         // 01: aload 2
         // 02: aload 1
         // 03: aload 4
         // 05: bipush 0
         // 06: invokespecial com/l7tech/policy/Policy.<init> (Lcom/l7tech/policy/PolicyType;Ljava/lang/String;Ljava/lang/String;Z)V
         // 09: aload 1
         // 0a: ifnull 17
         // 0d: aload 1
         // 0e: invokevirtual java/lang/String.trim ()Ljava/lang/String;
         // 11: invokevirtual java/lang/String.isEmpty ()Z
         // 14: ifeq 28
         // 17: new java/lang/IllegalArgumentException
         // 1a: dup
         // 1b: getstatic com/l7tech/server/policy/PolicyCacheImpl$RegisteredPolicy.c [Ljava/lang/String;
         // 1e: bipush 2
         // 1f: aaload
         // 20: invokespecial java/lang/IllegalArgumentException.<init> (Ljava/lang/String;)V
         // 23: athrow
         // 24: invokestatic com/l7tech/server/policy/PolicyCacheImpl$RegisteredPolicy.b (Ljava/lang/IllegalArgumentException;)Ljava/lang/IllegalArgumentException;
         // 27: athrow
         // 28: aload 2
         // 29: ifnonnull 3d
         // 2c: new java/lang/IllegalArgumentException
         // 2f: dup
         // 30: getstatic com/l7tech/server/policy/PolicyCacheImpl$RegisteredPolicy.c [Ljava/lang/String;
         // 33: bipush 1
         // 34: aaload
         // 35: invokespecial java/lang/IllegalArgumentException.<init> (Ljava/lang/String;)V
         // 38: athrow
         // 39: invokestatic com/l7tech/server/policy/PolicyCacheImpl$RegisteredPolicy.b (Ljava/lang/IllegalArgumentException;)Ljava/lang/IllegalArgumentException;
         // 3c: athrow
         // 3d: aload 4
         // 3f: ifnull 54
         // 42: aload 4
         // 44: invokevirtual java/lang/String.trim ()Ljava/lang/String;
         // 47: invokevirtual java/lang/String.isEmpty ()Z
         // 4a: ifeq 65
         // 4d: goto 54
         // 50: invokestatic com/l7tech/server/policy/PolicyCacheImpl$RegisteredPolicy.b (Ljava/lang/IllegalArgumentException;)Ljava/lang/IllegalArgumentException;
         // 53: athrow
         // 54: new java/lang/IllegalArgumentException
         // 57: dup
         // 58: getstatic com/l7tech/server/policy/PolicyCacheImpl$RegisteredPolicy.c [Ljava/lang/String;
         // 5b: bipush 0
         // 5c: aaload
         // 5d: invokespecial java/lang/IllegalArgumentException.<init> (Ljava/lang/String;)V
         // 60: athrow
         // 61: invokestatic com/l7tech/server/policy/PolicyCacheImpl$RegisteredPolicy.b (Ljava/lang/IllegalArgumentException;)Ljava/lang/IllegalArgumentException;
         // 64: athrow
         // 65: aload 0
         // 66: new com/l7tech/objectmodel/Goid
         // 69: dup
         // 6a: lconst_0
         // 6b: getstatic com/l7tech/server/policy/PolicyCacheImpl$RegisteredPolicy.registeredOidCounter Ljava/util/concurrent/atomic/AtomicLong;
         // 6e: invokevirtual java/util/concurrent/atomic/AtomicLong.getAndDecrement ()J
         // 71: invokespecial com/l7tech/objectmodel/Goid.<init> (JJ)V
         // 74: invokevirtual com/l7tech/server/policy/PolicyCacheImpl$RegisteredPolicy.setGoid (Lcom/l7tech/objectmodel/Goid;)V
         // 77: aload 0
         // 78: invokestatic java/util/UUID.randomUUID ()Ljava/util/UUID;
         // 7b: invokevirtual java/util/UUID.toString ()Ljava/lang/String;
         // 7e: invokevirtual com/l7tech/server/policy/PolicyCacheImpl$RegisteredPolicy.setGuid (Ljava/lang/String;)V
         // 81: aload 0
         // 82: aload 3
         // 83: invokevirtual com/l7tech/server/policy/PolicyCacheImpl$RegisteredPolicy.setInternalTag (Ljava/lang/String;)V
         // 86: aload 0
         // 87: getstatic com/l7tech/policy/wsp/WspReader$Visibility.omitDisabled Lcom/l7tech/policy/wsp/WspReader$Visibility;
         // 8a: invokevirtual com/l7tech/server/policy/PolicyCacheImpl$RegisteredPolicy.setVisibility (Lcom/l7tech/policy/wsp/WspReader$Visibility;)V
         // 8d: aload 0
         // 8e: invokespecial com/l7tech/policy/Policy.lock ()V
         // 91: return
         // try (8 -> 19): 19 java/lang/IllegalArgumentException
         // try (21 -> 30): 30 java/lang/IllegalArgumentException
         // try (32 -> 38): 39 java/lang/IllegalArgumentException
         // try (34 -> 48): 48 java/lang/IllegalArgumentException
      }

      static {
         String[] var5 = new String[3];
         int var3 = 0;
         String var2 = "|vG\rL7Gv~ZXL6\u0002`5\u0011pb[H\u0005-\u0014$iN\\P-\u0015a\u007f\u0005\u0011jzFH\u0005-\u0014$iN\\P-\u0015a\u007f\u0005";
         int var4 = "|vG\rL7Gv~ZXL6\u0002`5\u0011pb[H\u0005-\u0014$iN\\P-\u0015a\u007f\u0005\u0011jzFH\u0005-\u0014$iN\\P-\u0015a\u007f\u0005".length();
         char var1 = 16;
         int var0 = -1;

         while (true) {
            String var10002 = c(50, c(var2.substring(++var0, var0 + var1)));
            byte var10001 = -1;
            var5[var3++] = var10002;
            if ((var0 += var1) >= var4) {
               c = var5;
               registeredOidCounter = new AtomicLong(-100000L);
               return;
            }

            var1 = var2.charAt(var0);
         }
      }

      private static IllegalArgumentException b(IllegalArgumentException var0) {
         return var0;
      }

      private static char[] c(String var0) {
         char[] var10000 = var0.toCharArray();
         if (var10000.length < 2) {
            var10000[0] = (char)(var10000[0] ^ 85);
         }

         return var10000;
      }

      private static String c(int var0, char[] var1) {
         int var10003 = var1.length;
         int var10002 = var0;
         char[] var10001 = var1;
         int var10000 = var10003;

         for (int var2 = 0; var10000 > var2; var2++) {
            var10001[var2] = (char)(var10001[var2] ^ var10002 ^ switch (var2 % 7) {
               case 0 -> 54;
               case 1 -> 41;
               case 2 -> 25;
               case 3 -> 31;
               case 4 -> 23;
               case 5 -> 118;
               default -> 85;
            });
         }

         return new String(var10001).intern();
      }
   }
}
