You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Rahul Akolkar <ra...@gmail.com> on 2009/08/11 19:49:50 UTC
Re: [JEXL] svn commit: r803067
On Tue, Aug 11, 2009 at 7:40 AM, <se...@apache.org> wrote:
> Author: sebb
> Date: Tue Aug 11 11:40:08 2009
> New Revision: 803067
>
> URL: http://svn.apache.org/viewvc?rev=803067&view=rev
> Log:
> Boxing/unboxing
>
> Modified:
> commons/proper/jexl/branches/2.0/src/test/java/org/apache/commons/jexl/ArrayLiteralTest.java
> commons/proper/jexl/branches/2.0/src/test/java/org/apache/commons/jexl/examples/ArrayTest.java
> commons/proper/jexl/branches/2.0/src/test/java/org/apache/commons/jexl/examples/MethodPropertyTest.java
>
<snip/>
Don't need to do this for test classes (whats been done is fine) --
tests are easier to read with the autoboxing IMO.
-Rahul
> Modified: commons/proper/jexl/branches/2.0/src/test/java/org/apache/commons/jexl/ArrayLiteralTest.java
> URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/src/test/java/org/apache/commons/jexl/ArrayLiteralTest.java?rev=803067&r1=803066&r2=803067&view=diff
> ==============================================================================
> --- commons/proper/jexl/branches/2.0/src/test/java/org/apache/commons/jexl/ArrayLiteralTest.java (original)
> +++ commons/proper/jexl/branches/2.0/src/test/java/org/apache/commons/jexl/ArrayLiteralTest.java Tue Aug 11 11:40:08 2009
> @@ -47,7 +47,7 @@
> JexlContext jc = JexlHelper.createContext();
>
> Object o = e.evaluate( jc );
> - Object[] check = { 5, 10 };
> + Object[] check = { Integer.valueOf(5), Integer.valueOf(10) };
> assertTrue( Arrays.equals(check, (Object[])o) );
> }
>
>
> Modified: commons/proper/jexl/branches/2.0/src/test/java/org/apache/commons/jexl/examples/ArrayTest.java
> URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/src/test/java/org/apache/commons/jexl/examples/ArrayTest.java?rev=803067&r1=803066&r2=803067&view=diff
> ==============================================================================
> --- commons/proper/jexl/branches/2.0/src/test/java/org/apache/commons/jexl/examples/ArrayTest.java (original)
> +++ commons/proper/jexl/branches/2.0/src/test/java/org/apache/commons/jexl/examples/ArrayTest.java Tue Aug 11 11:40:08 2009
> @@ -57,7 +57,7 @@
> e = jexl.createExpression("array[0].length()");
> o = e.evaluate(jc);
>
> - out.print("The length of the string at location 0 is : ", o, 21);
> + out.print("The length of the string at location 0 is : ", o, Integer.valueOf(21));
> }
>
> /**
>
> Modified: commons/proper/jexl/branches/2.0/src/test/java/org/apache/commons/jexl/examples/MethodPropertyTest.java
> URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/src/test/java/org/apache/commons/jexl/examples/MethodPropertyTest.java?rev=803067&r1=803066&r2=803067&view=diff
> ==============================================================================
> --- commons/proper/jexl/branches/2.0/src/test/java/org/apache/commons/jexl/examples/MethodPropertyTest.java (original)
> +++ commons/proper/jexl/branches/2.0/src/test/java/org/apache/commons/jexl/examples/MethodPropertyTest.java Tue Aug 11 11:40:08 2009
> @@ -71,7 +71,7 @@
>
> e = jexl.createExpression("foo.convert(1+number)");
> o = e.evaluate(jc);
> - out.print("value of " + e.getExpression() + " is : ", o, foo.convert(1+number));
> + out.print("value of " + e.getExpression() + " is : ", o, foo.convert(1+number.intValue()));
>
> /*
> * access a property
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [JEXL] svn commit: r803067
Posted by sebb <se...@gmail.com>.
On 11/08/2009, Rahul Akolkar <ra...@gmail.com> wrote:
> On Tue, Aug 11, 2009 at 7:40 AM, <se...@apache.org> wrote:
> > Author: sebb
> > Date: Tue Aug 11 11:40:08 2009
> > New Revision: 803067
> >
> > URL: http://svn.apache.org/viewvc?rev=803067&view=rev
> > Log:
> > Boxing/unboxing
> >
> > Modified:
> > commons/proper/jexl/branches/2.0/src/test/java/org/apache/commons/jexl/ArrayLiteralTest.java
> > commons/proper/jexl/branches/2.0/src/test/java/org/apache/commons/jexl/examples/ArrayTest.java
> > commons/proper/jexl/branches/2.0/src/test/java/org/apache/commons/jexl/examples/MethodPropertyTest.java
> >
> <snip/>
>
> Don't need to do this for test classes (whats been done is fine) --
> tests are easier to read with the autoboxing IMO.
Since the tests are comparing Objects, I thought it was clearer to
make the boxed type clearer.
> -Rahul
>
>
> > Modified: commons/proper/jexl/branches/2.0/src/test/java/org/apache/commons/jexl/ArrayLiteralTest.java
> > URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/src/test/java/org/apache/commons/jexl/ArrayLiteralTest.java?rev=803067&r1=803066&r2=803067&view=diff
> > ==============================================================================
> > --- commons/proper/jexl/branches/2.0/src/test/java/org/apache/commons/jexl/ArrayLiteralTest.java (original)
> > +++ commons/proper/jexl/branches/2.0/src/test/java/org/apache/commons/jexl/ArrayLiteralTest.java Tue Aug 11 11:40:08 2009
> > @@ -47,7 +47,7 @@
> > JexlContext jc = JexlHelper.createContext();
> >
> > Object o = e.evaluate( jc );
> > - Object[] check = { 5, 10 };
> > + Object[] check = { Integer.valueOf(5), Integer.valueOf(10) };
> > assertTrue( Arrays.equals(check, (Object[])o) );
> > }
> >
> >
> > Modified: commons/proper/jexl/branches/2.0/src/test/java/org/apache/commons/jexl/examples/ArrayTest.java
> > URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/src/test/java/org/apache/commons/jexl/examples/ArrayTest.java?rev=803067&r1=803066&r2=803067&view=diff
> > ==============================================================================
> > --- commons/proper/jexl/branches/2.0/src/test/java/org/apache/commons/jexl/examples/ArrayTest.java (original)
> > +++ commons/proper/jexl/branches/2.0/src/test/java/org/apache/commons/jexl/examples/ArrayTest.java Tue Aug 11 11:40:08 2009
> > @@ -57,7 +57,7 @@
> > e = jexl.createExpression("array[0].length()");
> > o = e.evaluate(jc);
> >
> > - out.print("The length of the string at location 0 is : ", o, 21);
> > + out.print("The length of the string at location 0 is : ", o, Integer.valueOf(21));
> > }
> >
> > /**
> >
> > Modified: commons/proper/jexl/branches/2.0/src/test/java/org/apache/commons/jexl/examples/MethodPropertyTest.java
> > URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/src/test/java/org/apache/commons/jexl/examples/MethodPropertyTest.java?rev=803067&r1=803066&r2=803067&view=diff
> > ==============================================================================
> > --- commons/proper/jexl/branches/2.0/src/test/java/org/apache/commons/jexl/examples/MethodPropertyTest.java (original)
> > +++ commons/proper/jexl/branches/2.0/src/test/java/org/apache/commons/jexl/examples/MethodPropertyTest.java Tue Aug 11 11:40:08 2009
> > @@ -71,7 +71,7 @@
> >
> > e = jexl.createExpression("foo.convert(1+number)");
> > o = e.evaluate(jc);
> > - out.print("value of " + e.getExpression() + " is : ", o, foo.convert(1+number));
> > + out.print("value of " + e.getExpression() + " is : ", o, foo.convert(1+number.intValue()));
> >
> > /*
> > * access a property
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org