I am looking at https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.3.2 and i am wondering how does one display the correct form of a method that takes in 2 different types.
E.g.
callthismethod(String a, ArrayMap<String aa, Task<String aaa> > )
where Task is imported from com.this.location
The field descriptor of an instance variable of type
intis simplyI.The field descriptor of an instance variable of type
ObjectisLjava/lang/Object;. Note that the internal form of the binary name for classObjectis used.The field descriptor of an instance variable that is a multidimensional
doublearray,double d[][][], is[[[D.
There seems to be some confusion as you’re looking at a field descriptor but asking a question about a method. So you have to look at the method descriptor documentation just beneath the “Field Descriptors” section.
A method descriptor has the form
where the parameter descriptors have the same form as field descriptors, concatenated without any separators and the return descriptor only differs from field descriptors in also allowing
V, to denote avoidmethod.Since your question doesn’t include the return type, and also doesn’t show the qualified name of the second parameter¹ (we might assume the first one is
java.lang.String), no complete answer can be given for this example. If the method has been declared likethe method descriptor would look like
Note that neither, field descriptors nor method descriptors, encode type arguments. Generic signatures are an entirely different thing, only used for Reflection and debugging, not for the normal execution of code.
Getting the generic signature for your example is as problematic as getting the method descriptor, due to the missing information. Further,
com.this.locationis not a valid package name. Assumingsome.locationforTaskas well, the generic signature would look like¹ in fact, your declaration is entirely invalid as it tries to assign names to type arguments but not to the actual parameter.