> Acutally, Tapestry 5.2 uses Javassist to get at attribute information
> for the methods, including the line numbers where available.

The getMethods in CtClass is not documented as being ordered, so I
peeked at the code and unless I'm looking at the wrong spot it comes
from an un-ordered HashMap.

 public CtMethod[] getMethods() {
        HashMap h = new HashMap();
        getMethods0(h, this);
        return (CtMethod[])h.values().toArray(new CtMethod[h.size()]);
    }

I haven't tried to chase down what Tapestry is doing in transformed
classes, but I'm pretty sure counting on the undocumented ordering of
methods is a bad idea.

Josh

On Mon, Feb 21, 2011 at 10:14 AM, Howard Lewis Ship <hls...@gmail.com> wrote:
> Acutally, Tapestry 5.2 uses Javassist to get at attribute information
> for the methods, including the line numbers where available. However,
> I'm honestly not sure what happens in a transformed component class.
> Certainly, if the @Property annotation is used, there is no line
> number information to be had.
>
> On Mon, Feb 21, 2011 at 10:03 AM, Josh Canfield <joshcanfi...@gmail.com> 
> wrote:
>> http://download.oracle.com/javase/6/docs/api/java/lang/Class.html#getDeclaredMethods()
>>
>> "The elements in the array returned are not sorted and are not in any
>> particular order."
>>
>> Java's reflection mechanism doesn't guarantee the order of methods
>> returned so it would be hard for Tapestry to do much about that given
>> the current architecture. It's possible that the behavior you were
>> seeing previously was particular to a specific JVM implementation.
>>
>> Josh
>>
>> On Sun, Feb 20, 2011 at 2:06 PM, Mark <mark-li...@xeric.net> wrote:
>>> On Sun, Feb 20, 2011 at 9:33 AM, Ulrich Stärk <u...@spielviel.de> wrote:
>>>> I'm just guessing, but Tapestry might reorder accessor methods 
>>>> alphabetically when enhancing the
>>>> page class.
>>>
>>> Hm. I'm also seeing this behavior on Java Beans now if they implement
>>> an interface and are Injected into the page.  Should I file this as a
>>> bug or is it intentional.
>>>
>>> Mark
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>
>
>
> --
> Howard M. Lewis Ship
>
> Creator of Apache Tapestry
>
> The source for Tapestry training, mentoring and support. Contact me to
> learn how I can get you up and productive in Tapestry fast!
>
> (971) 678-5210
> http://howardlewisship.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to