This is the mail archive of the frysk@sources.redhat.com mailing list for the frysk project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch: StackFrame.toString()


>>>>> "Yao" == Yao Qi <qiyaoltc@cn.ibm.com> writes:

>> I'm happy to document these accessors if someone would confirm that
>> this is the intended interpretation.

Yao> This patch is fine to me.

Thanks.  I'll write up javadoc for StackFrame sometime soon.

>> +  public String toString ()
>> +  {
>> +    StringBuffer builder = new StringBuffer("at 0x");
>> +    builder.append(Long.toHexString(getAddress()));
>> +    String mn = getMethodName();
>> +    if (mn != null && ! "".equals(mn))

Yao> Just one question for my curiosity,
Yao> Is there any difference between ""equals(mn) and mn.equals("")?

It is a fairly common java style to write it as "".equals(mn), because
this will avoid a NullPointerException if mn==null.  In this case it
doesn't matter as we're explicitly checking for null.

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]