How to retrieve the signature of a PsiMethod in the original JVM format?

Answered

So ASM gives me

(Ljava/lang/String;)V

as the signature of a method but I couldn't find any way to retrieve this signature from a PsiMethod in this format. The only thing which I can do is to retrieve the parameters with

getParameters()

and then get the canonical text of every parameter:

p.getType().getCanonicalText()

but this shows boolean instead of Z(this is the signature of boolean in the JVM).

 

So is there any way to retrieve the JVM signature or do I have to write my own function to do this?



2 comments
Comment actions Permalink

com.intellij.psi.util.ClassUtil#getAsmMethodSignature | getVMParametersMethodSignature and methods below should be useful

0
Comment actions Permalink

Thanks, this works.

0

Please sign in to leave a comment.