Skip to content
Permalink
Browse files
Use varargs.
  • Loading branch information
garydgregory committed Feb 28, 2021
1 parent b33a4a6 commit 718f3d2111c5e0ab1649cc43065df33c882e1a7c
Showing 8 changed files with 13 additions and 13 deletions.
@@ -90,7 +90,7 @@ public Object setPossibleProperty( Map<String, Object> context, Object target, S
Method m = OgnlRuntime.getWriteMethod( target.getClass(), name );
if ( m != null )
{
result = m.invoke( target, new Object[] { value } );
result = m.invoke( target, value );
}
}
}
@@ -37,7 +37,7 @@
{
try
{
initCause = OgnlException.class.getMethod( "initCause", new Class[] { Throwable.class } );
initCause = OgnlException.class.getMethod( "initCause", Throwable.class );
}
catch ( NoSuchMethodException e )
{
@@ -61,7 +61,7 @@
{ "true", Boolean.TRUE },
{ "false", Boolean.FALSE },
{ "{ false, true, null, 0, 1. }",
Arrays.asList( new Object[] { Boolean.FALSE, Boolean.TRUE, null, new Integer( 0 ), new Double( 1 ) } ) },
Arrays.asList( Boolean.FALSE, Boolean.TRUE, null, new Integer( 0 ), new Double( 1 ) ) },
{ "'HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\"'",
"HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\"" }, };

@@ -42,7 +42,7 @@
{ null, "#fact=:[#this<=1? 1 : #fact(#this-1) * #this], #fact(30h)",
new BigInteger( "265252859812191058636308480000000" ) },
{ null, "#bump = :[ #this.{ #this + 1 } ], (#bump)({ 1, 2, 3 })",
new ArrayList( Arrays.asList( new Integer[] { new Integer( 2 ), new Integer( 3 ), new Integer( 4 ) } ) ) },
new ArrayList( Arrays.asList( new Integer( 2 ), new Integer( 3 ), new Integer( 4 ) ) ) },
{ null, "#call = :[ \"calling \" + [0] + \" on \" + [1] ], (#call)({ \"x\", \"y\" })", "calling x on y" },

};
@@ -275,7 +275,7 @@ public Performance( String name, String expressionString, String javaMethodName,

try
{
_method = getClass().getMethod( javaMethodName, new Class[] {} );
_method = getClass().getMethod( javaMethodName );
}
catch ( Exception ex )
{
@@ -38,10 +38,10 @@
private static final Object[][] TESTS = {
// Projection, selection
{ ROOT, "array.{class}",
Arrays.asList( new Class[] { Integer.class, Integer.class, Integer.class, Integer.class } ) },
{ ROOT, "map.array.{? #this > 2 }", Arrays.asList( new Integer[] { new Integer( 3 ), new Integer( 4 ) } ) },
{ ROOT, "map.array.{^ #this > 2 }", Arrays.asList( new Integer[] { new Integer( 3 ) } ) },
{ ROOT, "map.array.{$ #this > 2 }", Arrays.asList( new Integer[] { new Integer( 4 ) } ) },
Arrays.asList( Integer.class, Integer.class, Integer.class, Integer.class ) },
{ ROOT, "map.array.{? #this > 2 }", Arrays.asList( new Integer( 3 ), new Integer( 4 ) ) },
{ ROOT, "map.array.{^ #this > 2 }", Arrays.asList( new Integer( 3 ) ) },
{ ROOT, "map.array.{$ #this > 2 }", Arrays.asList( new Integer( 4 ) ) },
{ ROOT, "map.array[*].{?true} instanceof java.util.Collection", Boolean.TRUE },
{ null, "#fact=1, 30H.{? #fact = #fact * (#this+1), false }, #fact",
new BigInteger( "265252859812191058636308480000000" ) }, };
@@ -81,9 +81,9 @@
{ ROOT, "map[$].(#root == null ? 'empty' : #root)", ROOT },
{ ROOT, "((selected != null) && (currLocale.toString() == selected.toString())) ? 'first' : 'second'",
"first" },
{ ROOT, "{stringValue, getMap()}", Arrays.asList( new Object[] { ROOT.getStringValue(), ROOT.getMap() } ) },
{ ROOT, "{stringValue, getMap()}", Arrays.asList( ROOT.getStringValue(), ROOT.getMap() ) },
{ ROOT, "{'stringValue', map[\"test\"].map[\"size\"]}",
Arrays.asList( new Object[] { "stringValue", ROOT.getMap().get( "size" ) } ) },
Arrays.asList( "stringValue", ROOT.getMap().get( "size" ) ) },
{ ROOT, "property.bean3.value + '(this.checked)'", "100(this.checked)" },
{ ROOT, "getIndexedProperty(property.bean3.map[\"bar\"])", ROOT.getArray() },
{ ROOT, "getProperty().getBean3()", ( (Bean2) ROOT.getProperty() ).getBean3() },
@@ -41,9 +41,9 @@

private final MyMap myMap = new MyMapImpl();

private final List list = Arrays.asList( new Object[] { null, this, array } );
private final List list = Arrays.asList( null, this, array );

private final List settableList = new ArrayList( Arrays.asList( new Object[] { "foo", "bar", "baz" } ) );
private final List settableList = new ArrayList( Arrays.asList( "foo", "bar", "baz" ) );

private final int index = 1;

0 comments on commit 718f3d2

Please sign in to comment.