Josh, But it is documented--at least for normal beans. The notes section paragraph of the BeanEditForm documentation discusses the reorder parameter and then says:
>You can accomplish the same thing by changing the order of the getter methods >in the bean class. The default order for properties is not alphabetical, it is >the order of the getter methods. I understand that this doesn't necessarily mean it is going to work in transformed or injected classes, but the idea of ordering things by the getter method is covered in the documentation. Mark On Mon, Feb 21, 2011 at 1:02 PM, Josh Canfield <[email protected]> wrote: >> 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 <[email protected]> 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 <[email protected]> >> 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 <[email protected]> wrote: >>>> On Sun, Feb 20, 2011 at 9:33 AM, Ulrich Stärk <[email protected]> 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: [email protected] >>>> For additional commands, e-mail: [email protected] >>>> >>>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: [email protected] >>> For additional commands, e-mail: [email protected] >>> >>> >> >> >> >> -- >> 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: [email protected] >> For additional commands, e-mail: [email protected] >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
