Aravind Ram
Aravind Ram

Reputation: 107

why does ASM methodnode.signature return null?

why does ASM methodnode.signature return null ? Here is my code:

public static void main(String[] args) {
    try {
        FileInputStream fis = new FileInputStream("Test.class");
        ClassReader cr = new ClassReader(fis);
        ClassNode cn = new ClassNode();
        cr.accept(cn, 0);
        List<MethodNode> methods = cn.methods;
        for (MethodNode methodNode : methods) {
            System.out.println(methodNode.signature);
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}

Upvotes: 2

Views: 665

Answers (1)

Rafael Winterhalter
Rafael Winterhalter

Reputation: 43997

The signature is null to indicate that there is no generic information for this method. The signature is nothing than meta data and ignored by the Java runtime which rather looks at a method's descriptor which must never be null.

Upvotes: 2

Related Questions