velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nathan Bubna <nbu...@gmail.com>
Subject Re: iteration over a list broke from 1.4 - 1.6
Date Wed, 18 Feb 2009 00:13:10 GMT
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 <chadmichaeldavis@gmail.com> 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: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org


Mime
View raw message