diff options
author | zaaarf <zaaarf@proton.me> | 2023-03-27 18:41:48 +0200 |
---|---|---|
committer | zaaarf <zaaarf@proton.me> | 2023-03-27 18:41:48 +0200 |
commit | b2b516b2b158ed680e402a05a496150293cccfe5 (patch) | |
tree | ef69b6d1bfec78753e7c159bf456af54902cff57 /src/main/java/ftbsc | |
parent | a3f4dafff792882995d6dcd1d198d1f451c24783 (diff) |
fix: trying to get fqn of primitive
Diffstat (limited to 'src/main/java/ftbsc')
-rw-r--r-- | src/main/java/ftbsc/lll/proxies/impl/MethodProxy.java | 2 | ||||
-rw-r--r-- | src/main/java/ftbsc/lll/proxies/impl/TypeProxy.java | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/main/java/ftbsc/lll/proxies/impl/MethodProxy.java b/src/main/java/ftbsc/lll/proxies/impl/MethodProxy.java index a1306f7..b205cbf 100644 --- a/src/main/java/ftbsc/lll/proxies/impl/MethodProxy.java +++ b/src/main/java/ftbsc/lll/proxies/impl/MethodProxy.java @@ -39,6 +39,8 @@ public class MethodProxy extends AbstractProxy { */ protected MethodProxy(String name, int modifiers, QualifiableProxy parent, Type[] parameters, Type returnType) { super(name, Type.getMethodDescriptor(returnType, parameters), modifiers, parent, ProxyType.METHOD); + for(Type t : parameters) + System.out.println(t.toString() + t.getSort()); this.parameters = Arrays.stream(parameters) .map(t -> TypeProxy.from(t, 0)) .toArray(TypeProxy[]::new); diff --git a/src/main/java/ftbsc/lll/proxies/impl/TypeProxy.java b/src/main/java/ftbsc/lll/proxies/impl/TypeProxy.java index 7be1eb3..67100ac 100644 --- a/src/main/java/ftbsc/lll/proxies/impl/TypeProxy.java +++ b/src/main/java/ftbsc/lll/proxies/impl/TypeProxy.java @@ -50,15 +50,15 @@ public class TypeProxy extends QualifiableProxy { * Builds a {@link TypeProxy} from a {@link Type} and modifiers. * @param type the {@link Type} representing this Class * @param modifiers the modifiers of the class - * @return the builty {@link TypeProxy} + * @return the built {@link TypeProxy} */ public static TypeProxy from(Type type, int modifiers) { while(type.getSort() == Type.ARRAY) type = type.getElementType(); - String fqn = type.getInternalName().replace('/', '.'); + boolean primitive = type.getSort() < Type.ARRAY; + String fqn = primitive ? type.getClassName() : type.getInternalName().replace('/', '.'); String simpleName = extractSimpleNameFromFQN(fqn); String parent = extractParentFromFQN(fqn); - boolean primitive = type.getSort() < Type.ARRAY; if(fqn.contains("$")) return new TypeProxy(simpleName, type.getDescriptor(), modifiers, from(type, Modifier.PUBLIC), primitive); else return new TypeProxy(simpleName, type.getDescriptor(), modifiers, parent, primitive); |