This commit is contained in:
redkale
2023-12-20 17:19:43 +08:00
parent 5d9bd3018a
commit 0c1e34c2cc
18 changed files with 512 additions and 83 deletions

View File

@@ -0,0 +1,28 @@
/*
*
*/
package org.redkale.test.cache;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
*
* @author zhangjx
*/
public class BaseService {
private void run1() {
}
protected void run2() {
}
public void run3() {
}
public <T> Map<String, String> toMap(List<String> a, Set<T> set){
return null;
}
}

View File

@@ -0,0 +1,13 @@
/*
*/
package org.redkale.test.cache;
/**
*
* @author zhangjx
*/
public class SimpleService extends BaseService {
}

View File

@@ -0,0 +1,45 @@
/*
*
*/
package org.redkale.test.cache;
import java.lang.reflect.Method;
import org.redkale.asm.AsmMethodBoost;
import org.redkale.asm.Type;
/**
*
* @author zhangjx
*/
public class TwoService extends BaseService {
@Override
protected void run2() {
}
@Override
public void run3() {
}
public static void main(String[] args) throws Throwable {
System.out.println("-------------------------------");
for (Method m : TwoService.class.getDeclaredMethods()) {
System.out.println(m);
}
System.out.println("-------------------------------");
for (Method m : SimpleService.class.getDeclaredMethods()) {
System.out.println(m);
}
System.out.println("-------------------------------");
for (Method m : BaseService.class.getDeclaredMethods()) {
System.out.println(m);
if(m.getName().equals("toMap")) {
System.out.println("张颠三倒四: " + Type.getType(m).getInternalName());
System.out.println("张颠三倒四: " + Type.getType(m).getDescriptor());
System.out.println("张颠三倒四: " + Type.getType(m).getClassName());
}
}
System.out.println("-------------------------------");
System.out.println(AsmMethodBoost.getMethodBeans(BaseService.class));
}
}