PageRenderTime 777ms CodeModel.GetById 28ms RepoModel.GetById 1ms app.codeStats 0ms

/QingTingFanBianYi/src/com/alibaba/fastjson/util/ASMClassLoader.java

https://gitlab.com/qt-prometheus/qt-prometheus
Java | 63 lines | 52 code | 7 blank | 4 comment | 9 complexity | 89b207c3cf1f2e27f4220cbe0d9a3de2 MD5 | raw file
  1. package com.alibaba.fastjson.util;
  2. import com.alibaba.fastjson.JSON;
  3. import java.security.AccessController;
  4. import java.security.PrivilegedAction;
  5. import java.security.ProtectionDomain;
  6. public class ASMClassLoader extends ClassLoader
  7. {
  8. private static ProtectionDomain DOMAIN = (ProtectionDomain)AccessController.doPrivileged(new PrivilegedAction()
  9. {
  10. public Object run()
  11. {
  12. return ASMClassLoader.class.getProtectionDomain();
  13. }
  14. });
  15. public ASMClassLoader()
  16. {
  17. super(getParentClassLoader());
  18. }
  19. static ClassLoader getParentClassLoader()
  20. {
  21. ClassLoader localClassLoader = Thread.currentThread().getContextClassLoader();
  22. if (localClassLoader != null)
  23. try
  24. {
  25. localClassLoader.loadClass(JSON.class.getName());
  26. return localClassLoader;
  27. }
  28. catch (ClassNotFoundException localClassNotFoundException)
  29. {
  30. }
  31. return JSON.class.getClassLoader();
  32. }
  33. public Class<?> defineClassPublic(String paramString, byte[] paramArrayOfByte, int paramInt1, int paramInt2)
  34. throws ClassFormatError
  35. {
  36. return defineClass(paramString, paramArrayOfByte, paramInt1, paramInt2, DOMAIN);
  37. }
  38. public boolean isExternalClass(Class<?> paramClass)
  39. {
  40. ClassLoader localClassLoader = paramClass.getClassLoader();
  41. if (localClassLoader == null)
  42. return false;
  43. for (paramClass = this; ; paramClass = paramClass.getParent())
  44. {
  45. if (paramClass == null)
  46. break label30;
  47. if (paramClass == localClassLoader)
  48. break;
  49. }
  50. label30: return true;
  51. }
  52. }
  53. /* Location: C:\Users\User\dex2jar-2.0\dex\qting\classes-dex2jar.jar
  54. * Qualified Name: com.alibaba.fastjson.util.ASMClassLoader
  55. * JD-Core Version: 0.6.2
  56. */