Review Request JDK-8186050: StackFrame should provide the method signature

mandy chung mandy.chung at oracle.com
Fri Sep 22 18:20:50 UTC 2017



On 9/22/17 3:45 AM, Peter Levart wrote:
>
> Just two more things...
>
> 1st:
>
> I was I little confused reading this part of javadoc of getDescriptor():
>
>  152          * Returns the <i>descriptor</i> of the method type for
>  153          * this stack frame.  A method descriptor is a string 
> representing the
>  154          * types of parameters that the method takes, and a 
> return descriptor,
>  155          * representing the type of the value (if any) that the 
> method returns
>  156          * as defined by <cite>The Java™ Virtual Machine 
> Specification</cite>.
>
> Wouldn't it be better to say:
>
>  152          * Returns the <i>descriptor</i> of the method type for
>  153          * this stack frame.  A method descriptor is a string 
> representing the
>  154          * types of parameters that the method takes, and the 
> method's return type,
>
>  156          * as defined by <cite>The Java™ Virtual Machine 
> Specification</cite>.
>
> I think there is a slight difference between "method return type" and 
> "the type of value (if any) that the method returns". The former is a 
> property of the method, the later is a property of the returned value 
> (primitive or reference or none) in a particular invocation of the 
> method and may be different (a subtype).
>
I agree the slight difference you call out.  Since it's specified in 
JVMS 4.3.3, there is no need to include this statement in javadoc.

I simply take it out.  The webrev.03 is updated in place.

>
> 2nd:
>
> I don't know in what circumstance may the MemberName.getMethodType() 
> or .getMethodDescriptor() return null, but the MemberName code is 
> written as follows:
>
>  169         if (type == null) {
>  170             expandFromVM();
>  171             if (type == null) {
>  172                 return null;
>  173             }
>  174         }
>
> Is there a real circumstance when this may happen? Should 
> StackWalker.StackFrame.getMethodType() / .getDescriptor() document 
> that situation or maybe transform it into an exception or error?
>

There is no type when this MemberName is not resolved.  For stack frame 
case, the methods are already resolved.

Mandy
> Regards, Peter
>



More information about the core-libs-dev mailing list