Skip to content

Commit

Permalink
Implemented type getter for field and method nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
Lenni0451 committed Dec 20, 2024
1 parent aa38883 commit 9f3410e
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package net.lenni0451.commons.asm;

import org.objectweb.asm.Type;
import org.objectweb.asm.tree.FieldNode;
import org.objectweb.asm.tree.MethodInsnNode;
import org.objectweb.asm.tree.MethodNode;

Expand Down Expand Up @@ -55,8 +56,12 @@ public static Type type(final Object ob) {
return Type.getType((Class<?>) ob);
} else if (ob instanceof Field) {
return Type.getType(((Field) ob).getType());
} else if (ob instanceof FieldNode) {
return Type.getType(((FieldNode) ob).desc);
} else if (ob instanceof Method) {
return Type.getType((Method) ob);
} else if (ob instanceof MethodNode) {
return Type.getType(((MethodNode) ob).desc);
} else if (ob instanceof Constructor) {
return Type.getType((Constructor<?>) ob);
} else if (ob instanceof Type) {
Expand Down

0 comments on commit 9f3410e

Please sign in to comment.