Thanks Dianne, it all makes sense now!

So I guess the number after $ (i.e. 2500) is probably just some memory
offset or something..

On 8월25일, 오후2시54분, Dianne Hackborn <[email protected]> wrote:
> It's a thunk to allow an inner class to call a private method (or access a
> private variable) on its containing class.
>
> I've started getting in the habit of going through code and getting rid of
> private methods and variables from these core system classes, to get rid of
> such thunks, but that does have the unfortunately side-effect of not
> allowing Eclipse to show you unnused methods and variables.  Compromises,
> compromises.
>
> 2009/8/25 Brian <[email protected]>
>
>
>
>
>
>
>
> > Thanks for the reply. I understand that the $ sign is normally used to
> > denote a nested/inner class.
>
> > In the above example (ActivityThread.java -
>
> >http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;...
> > )
>
> > android.app.ActivityThread$H.handleMessage
>
> > Refers to the H class, which is nested in ActivityThread.java:
>
> > 1621     private final class H extends Handler {....}
>
> > However, as for
>
> > at android.app.ActivityThread.handleDestroyActivity
> > (ActivityThread.java:3180)
> > at android.app.ActivityThread.access$2500(ActivityThread.java:115)
> >  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:
> > 1745)
>
> > I still don't understand fully what it can mean.
>
> > Looking at the source code (line number a bit off due to diff.
> > version):
>
> > (in function H.handleMessage)
> > 1723                 case DESTROY_ACTIVITY:
> > 1724                     handleDestroyActivity((IBinder)msg.obj,
> > msg.arg1 != 0,
> > 1725                             msg.arg2, false);
> > 1726                     break;
>
> > This is the section of interest. So I get  ActivityThread
> > $H.handleMessage (handleMessage function of class H nested inside
> > ActivityThread).
>
> > However, I don't get ActivityThread.access$2500 for a couple reasons:
>
> > 1. Line number points to beginning of the ActivityClass
> > 2. ActivityThread.access seems to refer to a function name, but
> > there's no "access" function
> > 3. access$2500 (so is access a function or class) and I have no idea
> > what the number 2500 means
> > 4. I would also like to know how the number 2500 is generated (is it
> > random? depends on task #?)
>
> > I tried using DDMS on a similar code, thinking that maybe (IBinder)
> > msg.obj casting is referring to it. But when I stepped through a
> > similar code (object casting), I didn't see "access$2500" or anything
> > similar to it. It just jumped straight on to the function being
> > called.
>
> > I tried googling it, but to no avail...
>
> > On 8월25일, 오후1시08분, Streets Of Boston <[email protected]> wrote:
> > > The $ is used to seperate the inner class from the main class;
>
> > > Example:
>
> > > packager a.b.c
>
> > > public class MyClass {
> > >     ...
> > >     static class OtherClass {
> > >        void someMethod() {
> > >          ...
> > >          exception.printStackTrace();
> > >          ...
> > >        }
> > >        ...
> > >     }
> > >     ...
>
> > > }
>
> > > would print out as ' at a.b.c.MyClass$OtherClass.someMethod
> > > (MyClass.java:322)'
>
> > > I'm not sure about the '2500'. It could be an anonymous class..?
>
> > >   public void accessExample() {
> > >     Runnable r = new Runnable() {
> > >                    public void run() { ... }
> > >                  };
> > >     ...
> > >   }
>
> > > where the class of the instance 'r' is anonymous and compiled as
> > > '2500'.
>
> > > On Aug 25, 11:47 am, Brian <[email protected]> wrote:
>
> > > > Hi all,
>
> > > > I wanted to understand what the $ sign and the number after a $ sign
> > > > meant in a backtrace.
>
> > > > For example, consider the following backtrace:
>
> > > >   at android.app.ActivityThread.access$2500(ActivityThread.java:115)
> > > >   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:
> > > > 1745)
>
> > > > In the first line, what does the number 2500 refer to? In addition, I
> > > > couldn't find the function "access" in ActivityThread.java, and line
> > > > 115 is just the beginning of the class. Can anyone help clarify this?
> > > > Thanks!- 원본 텍스트 숨기기 -
>
> > > - 원본 텍스트 보기 -
>
> --
> Dianne Hackborn
> Android framework engineer
> [email protected]
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.- 원본 텍스트 숨기기 -
>
> - 원본 텍스트 보기 -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to