This commit is contained in:
坏黑
2018-04-22 22:12:42 +08:00
parent c573617a01
commit b49a779859
126 changed files with 1896 additions and 705 deletions

View File

@@ -1,16 +1,24 @@
package com.ilummc.tlib.util;
import java.lang.reflect.Field;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
import javax.annotation.concurrent.ThreadSafe;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassWriter;
import com.ilummc.tlib.TLib;
import com.ilummc.tlib.util.asm.AsmAnalyser;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassWriter;
import sun.reflect.Reflection;
import javax.annotation.concurrent.ThreadSafe;
import java.lang.reflect.Field;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
import sun.reflect.Reflection;
@ThreadSafe
public class Ref {
@@ -62,7 +70,7 @@ public class Ref {
public static Optional<Class<?>> getCallerClass(int depth) {
return Optional.ofNullable(CallerClass.impl.getCallerClass(depth + 1));
}
private static abstract class CallerClass {
private static CallerClass impl;
@@ -79,7 +87,9 @@ public class Ref {
abstract Class<?> getCallerClass(int i);
private static class ReflectionImpl extends CallerClass {
@Override
@SuppressWarnings({ "deprecation", "restriction" })
@Override
Class<?> getCallerClass(int i) {
return Reflection.getCallerClass(i);
}