package com.l7tech.server.bundling;

import java.util.Map;
import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.support.TransactionCallback;

class t implements TransactionCallback<Throwable> {
   final EntityMappingResult val$results;
   final Map val$resourceMapping;
   final EntityBundleImporterImpl this$0;
   private static final String a;

   t(EntityBundleImporterImpl var1, EntityMappingResult var2, Map var3) {
      this.this$0 = var1;
      this.val$results = var2;
      this.val$resourceMapping = var3;
   }

   public Throwable doInTransaction(TransactionStatus 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: getfield com/l7tech/server/bundling/t.this$0 Lcom/l7tech/server/bundling/EntityBundleImporterImpl;
      // 004: getfield com/l7tech/server/bundling/EntityBundleImporterImpl.entityCrud Lcom/l7tech/server/EntityCrud;
      // 007: aload 0
      // 008: getfield com/l7tech/server/bundling/t.val$results Lcom/l7tech/server/bundling/EntityMappingResult;
      // 00b: invokevirtual com/l7tech/server/bundling/EntityMappingResult.getTargetEntityHeader ()Lcom/l7tech/objectmodel/EntityHeader;
      // 00e: invokeinterface com/l7tech/server/EntityCrud.find (Lcom/l7tech/objectmodel/EntityHeader;)Lcom/l7tech/objectmodel/Entity; 2
      // 013: astore 2
      // 014: aload 2
      // 015: ifnonnull 039
      // 018: aload 1
      // 019: invokeinterface org/springframework/transaction/TransactionStatus.setRollbackOnly ()V 1
      // 01e: new com/l7tech/objectmodel/FindException
      // 021: dup
      // 022: aload 0
      // 023: getfield com/l7tech/server/bundling/t.val$results Lcom/l7tech/server/bundling/EntityMappingResult;
      // 026: invokevirtual com/l7tech/server/bundling/EntityMappingResult.getTargetEntityHeader ()Lcom/l7tech/objectmodel/EntityHeader;
      // 029: invokevirtual com/l7tech/objectmodel/EntityHeader.toStringVerbose ()Ljava/lang/String;
      // 02c: getstatic com/l7tech/server/bundling/t.a Ljava/lang/String;
      // 02f: swap
      // 030: invokedynamic makeConcatWithConstants (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; bsm=java/lang/invoke/StringConcatFactory.makeConcatWithConstants (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite; args=[ "\u0001\u0001" ]
      // 035: invokespecial com/l7tech/objectmodel/FindException.<init> (Ljava/lang/String;)V
      // 038: areturn
      // 039: aload 2
      // 03a: instanceof com/l7tech/policy/Policy
      // 03d: ifeq 048
      // 040: aload 2
      // 041: checkcast com/l7tech/policy/Policy
      // 044: astore 3
      // 045: goto 050
      // 048: aload 2
      // 049: checkcast com/l7tech/gateway/common/service/PublishedService
      // 04c: invokevirtual com/l7tech/gateway/common/service/PublishedService.getPolicy ()Lcom/l7tech/policy/Policy;
      // 04f: astore 3
      // 050: aload 3
      // 051: invokevirtual com/l7tech/policy/Policy.getXml ()Ljava/lang/String;
      // 054: astore 4
      // 056: aload 0
      // 057: getfield com/l7tech/server/bundling/t.this$0 Lcom/l7tech/server/bundling/EntityBundleImporterImpl;
      // 05a: getfield com/l7tech/server/bundling/EntityBundleImporterImpl.policyVersionManager Lcom/l7tech/server/policy/PolicyVersionManager;
      // 05d: aload 3
      // 05e: invokevirtual com/l7tech/policy/Policy.getGoid ()Lcom/l7tech/objectmodel/Goid;
      // 061: invokeinterface com/l7tech/server/policy/PolicyVersionManager.findLatestRevisionForPolicy (Lcom/l7tech/objectmodel/Goid;)Lcom/l7tech/policy/PolicyVersion; 2
      // 066: astore 5
      // 068: aload 3
      // 069: aload 5
      // 06b: invokevirtual com/l7tech/policy/PolicyVersion.getXml ()Ljava/lang/String;
      // 06e: invokevirtual com/l7tech/policy/Policy.setXml (Ljava/lang/String;)V
      // 071: new com/l7tech/policy/Policy
      // 074: dup
      // 075: aload 3
      // 076: invokespecial com/l7tech/policy/Policy.<init> (Lcom/l7tech/policy/Policy;)V
      // 079: astore 6
      // 07b: aload 0
      // 07c: getfield com/l7tech/server/bundling/t.this$0 Lcom/l7tech/server/bundling/EntityBundleImporterImpl;
      // 07f: getfield com/l7tech/server/bundling/EntityBundleImporterImpl.dependencyAnalyzer Lcom/l7tech/server/search/DependencyAnalyzer;
      // 082: aload 6
      // 084: aload 0
      // 085: getfield com/l7tech/server/bundling/t.val$resourceMapping Ljava/util/Map;
      // 088: bipush 1
      // 089: invokeinterface com/l7tech/server/search/DependencyAnalyzer.replaceDependencies (Lcom/l7tech/objectmodel/Entity;Ljava/util/Map;Z)V 4
      // 08e: aload 3
      // 08f: aload 6
      // 091: invokevirtual com/l7tech/policy/Policy.getXml ()Ljava/lang/String;
      // 094: invokevirtual com/l7tech/policy/Policy.setXml (Ljava/lang/String;)V
      // 097: aload 5
      // 099: aload 3
      // 09a: invokevirtual com/l7tech/policy/Policy.getXml ()Ljava/lang/String;
      // 09d: invokevirtual com/l7tech/policy/PolicyVersion.setXml (Ljava/lang/String;)V
      // 0a0: aload 0
      // 0a1: getfield com/l7tech/server/bundling/t.this$0 Lcom/l7tech/server/bundling/EntityBundleImporterImpl;
      // 0a4: getfield com/l7tech/server/bundling/EntityBundleImporterImpl.policyVersionManager Lcom/l7tech/server/policy/PolicyVersionManager;
      // 0a7: aload 5
      // 0a9: invokeinterface com/l7tech/server/policy/PolicyVersionManager.update (Lcom/l7tech/objectmodel/PersistentEntity;)V 2
      // 0ae: aload 5
      // 0b0: invokevirtual com/l7tech/policy/PolicyVersion.isActive ()Z
      // 0b3: ifeq 0eb
      // 0b6: aload 2
      // 0b7: instanceof com/l7tech/policy/Policy
      // 0ba: ifeq 0d8
      // 0bd: goto 0c4
      // 0c0: invokestatic com/l7tech/server/bundling/t.a (Ljava/lang/Throwable;)Ljava/lang/Throwable;
      // 0c3: athrow
      // 0c4: aload 0
      // 0c5: getfield com/l7tech/server/bundling/t.this$0 Lcom/l7tech/server/bundling/EntityBundleImporterImpl;
      // 0c8: getfield com/l7tech/server/bundling/EntityBundleImporterImpl.policyManager Lcom/l7tech/server/policy/PolicyManager;
      // 0cb: aload 3
      // 0cc: invokeinterface com/l7tech/server/policy/PolicyManager.update (Lcom/l7tech/objectmodel/PersistentEntity;)V 2
      // 0d1: goto 0f1
      // 0d4: invokestatic com/l7tech/server/bundling/t.a (Ljava/lang/Throwable;)Ljava/lang/Throwable;
      // 0d7: athrow
      // 0d8: aload 0
      // 0d9: getfield com/l7tech/server/bundling/t.this$0 Lcom/l7tech/server/bundling/EntityBundleImporterImpl;
      // 0dc: getfield com/l7tech/server/bundling/EntityBundleImporterImpl.serviceManager Lcom/l7tech/server/service/ServiceManager;
      // 0df: aload 2
      // 0e0: checkcast com/l7tech/gateway/common/service/PublishedService
      // 0e3: invokeinterface com/l7tech/server/service/ServiceManager.update (Lcom/l7tech/objectmodel/PersistentEntity;)V 2
      // 0e8: goto 0f1
      // 0eb: aload 3
      // 0ec: aload 4
      // 0ee: invokevirtual com/l7tech/policy/Policy.setXml (Ljava/lang/String;)V
      // 0f1: aload 1
      // 0f2: invokeinterface org/springframework/transaction/TransactionStatus.flush ()V 1
      // 0f7: aconst_null
      // 0f8: areturn
      // 0f9: astore 2
      // 0fa: aload 1
      // 0fb: invokeinterface org/springframework/transaction/TransactionStatus.setRollbackOnly ()V 1
      // 100: aload 2
      // 101: areturn
      // try (0 -> 22): 105 java/lang/Throwable
      // try (77 -> 89): 89 java/lang/Throwable
      // try (53 -> 80): 81 java/lang/Throwable
      // try (23 -> 104): 105 java/lang/Throwable
   }

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

   static {
      String var10002 = a(
         106,
         a(
            "\\\t\u0006 \u001ec)y\u0001\u0006*Qby{\t\u001c+\u00157fmH\u000b<\u0014v}z\fH>\u001e{`|\u0011H!\u00037zz\u001a\u001e'\u0012r)z\u0006\u001c'\u0005n)h\u0001\u001c&Q\u007fl~\f\r<K7"
         )
      );
      byte var10001 = -1;
      a = var10002;
   }

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

      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 -> 117;
            case 1 -> 2;
            case 2 -> 2;
            case 3 -> 36;
            case 4 -> 27;
            case 5 -> 125;
            default -> 99;
         });
      }

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