No, it still doesn't work with 1.6.2. I'll put the Jira in. On Tue, Feb 17, 2009 at 5:13 PM, Nathan Bubna <[email protected]> wrote: > Yeah, that is interesting. Have you tried this with 1.6.2 perchance? > There were a few fixes to method mapping. I'm guessing this will > still be broken, but i could be wrong. > > Here's the latest 1.6.2 test build: > http://people.apache.org/~cbrisson/velocity/engine/1.6.2/ > > If it is still failing in 1.6.2, you (or i) can open a JIRA issue for > this, and i'll see if this is a fixable regression (keeping in mind > that Velocity 1.x is still build against jdk 1.4). > > On Tue, Feb 17, 2009 at 4:03 PM, ChadDavis <[email protected]> wrote: >> This is interesting. I just migrated from 1.4 to 1.6 and broke an >> existing template. >> >> That template iterated over a List returned by an Enum object. The >> following pseudo code shows what I'm doing. Note, the getter that >> returns the list >> is an abstract member of the Thing enum. Each of the defined >> instances of this enum implement it. This worked on velocity 1.4, but >> doesn't on 1.6. To get it to work on 1.6, I had to change the >> abstract method to a normal method that each of the enum's override. >> It guess this is some sort of reflection API issue. Seems like it >> should work as it did before to me. Thoughts? >> >> >> public enum Thing { >> >> NUMBER_ONE( ){ >> public List<String> getInnerThings() { >> //initialize innerThings if this is first time >> if ( this.innerThings == null ) { >> innerThings = new ArrayList<String>(); >> innerThings.add( "blah blah" ); >> innerThings.add("blah blah" ); >> >> } >> return innerThings; >> } >> }, >> NUMBER_TWO( ){ >> public List<String> getinnerThings() { >> //initialize innerThings if this is first time >> if ( this.innerThings == null ) { >> innerThings = new ArrayList<String>(); >> innerThings.add( "blah blah" ); >> innerThings.add("blah blah" ); >> >> } >> return innerThings; >> >> } >> }, >> NUMBER_THREE( ){ >> public List<String> getinnerThings() { >> if ( this.innerThings == null ) { >> innerThings = new ArrayList<String>(); >> innerThings.add( "blah blah" ); >> innerThings.add("blah blah" ); >> >> } >> return innerThings; >> >> } >> }; >> >> >> List<String> innerThings; >> >> //This was an abstract method, but Velocity 1.6 quite working with it. >> public abstract List<String> getinnerThings(); >> >> >> } >> >> --------------------------------------------------------------------- >> 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]
