package com.l7tech.server.util;

import com.l7tech.objectmodel.ConstraintViolationException;
import java.lang.reflect.Method;
import java.util.logging.Logger;
import org.springframework.aop.ThrowsAdvice;
import org.springframework.dao.DataIntegrityViolationException;

public class ConstraintViolationThrowsAdvice implements ThrowsAdvice {
   private static final Logger a;
   private static final String[] b;

   public void afterThrowing(Method param1, Object[] param2, Object param3, DataIntegrityViolationException param4) throws ConstraintViolationException {
      // $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: invokevirtual java/lang/reflect/Method.getExceptionTypes ()[Ljava/lang/Class;
      // 04: astore 5
      // 06: aload 5
      // 08: ldc com/l7tech/objectmodel/ConstraintViolationException
      // 0a: invokestatic com/l7tech/util/ArrayUtils.contains ([Ljava/lang/Object;Ljava/lang/Object;)Z
      // 0d: ifeq 5f
      // 10: getstatic com/l7tech/server/util/ConstraintViolationThrowsAdvice.a Ljava/util/logging/Logger;
      // 13: getstatic java/util/logging/Level.FINE Ljava/util/logging/Level;
      // 16: invokevirtual java/util/logging/Logger.isLoggable (Ljava/util/logging/Level;)Z
      // 19: ifeq 3d
      // 1c: goto 23
      // 1f: invokestatic com/l7tech/server/util/ConstraintViolationThrowsAdvice.a (Lcom/l7tech/objectmodel/ConstraintViolationException;)Lcom/l7tech/objectmodel/ConstraintViolationException;
      // 22: athrow
      // 23: getstatic com/l7tech/server/util/ConstraintViolationThrowsAdvice.a Ljava/util/logging/Logger;
      // 26: getstatic java/util/logging/Level.FINE Ljava/util/logging/Level;
      // 29: getstatic com/l7tech/server/util/ConstraintViolationThrowsAdvice.b [Ljava/lang/String;
      // 2c: bipush 0
      // 2d: aaload
      // 2e: aload 4
      // 30: invokestatic com/l7tech/util/ExceptionUtils.getDebugException (Ljava/lang/Throwable;)Ljava/lang/Throwable;
      // 33: invokevirtual java/util/logging/Logger.log (Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/Throwable;)V
      // 36: goto 3d
      // 39: invokestatic com/l7tech/server/util/ConstraintViolationThrowsAdvice.a (Lcom/l7tech/objectmodel/ConstraintViolationException;)Lcom/l7tech/objectmodel/ConstraintViolationException;
      // 3c: athrow
      // 3d: aload 4
      // 3f: ldc org/hibernate/exception/ConstraintViolationException
      // 41: invokestatic com/l7tech/util/ExceptionUtils.getCauseIfCausedBy (Ljava/lang/Throwable;Ljava/lang/Class;)Ljava/lang/Throwable;
      // 44: checkcast org/hibernate/exception/ConstraintViolationException
      // 47: astore 6
      // 49: aload 6
      // 4b: ifnull 5f
      // 4e: new com/l7tech/objectmodel/ConstraintViolationException
      // 51: dup
      // 52: aload 6
      // 54: invokevirtual org/hibernate/exception/ConstraintViolationException.getMessage ()Ljava/lang/String;
      // 57: invokespecial com/l7tech/objectmodel/ConstraintViolationException.<init> (Ljava/lang/String;)V
      // 5a: athrow
      // 5b: invokestatic com/l7tech/server/util/ConstraintViolationThrowsAdvice.a (Lcom/l7tech/objectmodel/ConstraintViolationException;)Lcom/l7tech/objectmodel/ConstraintViolationException;
      // 5e: athrow
      // 5f: getstatic com/l7tech/server/util/ConstraintViolationThrowsAdvice.a Ljava/util/logging/Logger;
      // 62: getstatic java/util/logging/Level.WARNING Ljava/util/logging/Level;
      // 65: aload 4
      // 67: invokestatic com/l7tech/util/ExceptionUtils.getDebugException (Ljava/lang/Throwable;)Ljava/lang/Throwable;
      // 6a: new com/l7tech/server/util/c
      // 6d: dup
      // 6e: aload 0
      // 6f: aload 4
      // 71: invokespecial com/l7tech/server/util/c.<init> (Lcom/l7tech/server/util/ConstraintViolationThrowsAdvice;Lorg/springframework/dao/DataIntegrityViolationException;)V
      // 74: invokevirtual java/util/logging/Logger.log (Ljava/util/logging/Level;Ljava/lang/Throwable;Ljava/util/function/Supplier;)V
      // 77: new org/springframework/dao/DataIntegrityViolationException
      // 7a: dup
      // 7b: getstatic com/l7tech/server/util/ConstraintViolationThrowsAdvice.b [Ljava/lang/String;
      // 7e: bipush 1
      // 7f: aaload
      // 80: invokespecial org/springframework/dao/DataIntegrityViolationException.<init> (Ljava/lang/String;)V
      // 83: athrow
      // try (3 -> 11): 12 com/l7tech/objectmodel/ConstraintViolationException
      // try (7 -> 22): 23 com/l7tech/objectmodel/ConstraintViolationException
      // try (30 -> 38): 38 com/l7tech/objectmodel/ConstraintViolationException
   }

   static {
      String[] var5 = new String[2];
      int var3 = 0;
      String var2 = "?#\u000e=%`|\u0017-B\r!ft0$\u0016,'`|\r34 /~t\r#\r'\u0005jv\u001c:\u0016 /|5\u00189B\n/|f\r8\u0003 .fC\u0010%\u000e(4{z\u0017\u000f\u001a*%ba\u0010%\f<=+\u0016(\"sf\u001cj\u00071#we\r#\r'`}v\u001a?\u0010;%v5\u001d?\u0007i4}5\u001d+\u0016(`{{\r/\u0005;)flY<\u000b&,sa\u0010%\fg";
      int var4 = "?#\u000e=%`|\u0017-B\r!ft0$\u0016,'`|\r34 /~t\r#\r'\u0005jv\u001c:\u0016 /|5\u00189B\n/|f\r8\u0003 .fC\u0010%\u000e(4{z\u0017\u000f\u001a*%ba\u0010%\f<=+\u0016(\"sf\u001cj\u00071#we\r#\r'`}v\u001a?\u0010;%v5\u001d?\u0007i4}5\u001d+\u0016(`{{\r/\u0005;)flY<\u000b&,sa\u0010%\fg"
         .length();
      char var1 = 'I';
      int var0 = -1;

      while (true) {
         String var10002 = a(88, a(var2.substring(++var0, var0 + var1)));
         byte var10001 = -1;
         var5[var3++] = var10002;
         if ((var0 += var1) >= var4) {
            b = var5;
            a = Logger.getLogger(ConstraintViolationThrowsAdvice.class.getName());
            return;
         }

         var1 = var2.charAt(var0);
      }
   }

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

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

      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 -> 33;
            case 1 -> 18;
            case 2 -> 58;
            case 3 -> 17;
            case 4 -> 24;
            case 5 -> 74;
            default -> 77;
         });
      }

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