Skip to content
Permalink
Browse files
OGNL-232 Removes deprecated classes
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/ognl/trunk@1461014 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
lukaszlenart committed Mar 26, 2013
1 parent 882f4fb commit fd35fd24cc02d4397a5b9cff94bbfe302c7dd843
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 371 deletions.
@@ -79,75 +79,68 @@ protected Object getValueBody( OgnlContext context, Object source )
{
Object result, root = context.getRoot();
int count = jjtGetNumChildren();
Object[] args = OgnlRuntime.getObjectArrayPool().create( count );
Object[] args = new Object[count];

try
for ( int i = 0; i < count; ++i )
{
for ( int i = 0; i < count; ++i )
{
args[i] = children[i].getValue( context, root );
}
if ( isArray )
args[i] = children[i].getValue( context, root );
}
if ( isArray )
{
if ( args.length == 1 )
{
if ( args.length == 1 )
try
{
try
Class componentClass = OgnlRuntime.classForName( context, className );
List sourceList = null;
int size;

if ( args[0] instanceof List )
{
Class componentClass = OgnlRuntime.classForName( context, className );
List sourceList = null;
int size;
sourceList = (List) args[0];
size = sourceList.size();
}
else
{
size = (int) OgnlOps.longValue( args[0] );
}
result = Array.newInstance( componentClass, size );
if ( sourceList != null )
{
TypeConverter converter = context.getTypeConverter();

if ( args[0] instanceof List )
{
sourceList = (List) args[0];
size = sourceList.size();
}
else
{
size = (int) OgnlOps.longValue( args[0] );
}
result = Array.newInstance( componentClass, size );
if ( sourceList != null )
for ( int i = 0, icount = sourceList.size(); i < icount; i++ )
{
TypeConverter converter = context.getTypeConverter();
Object o = sourceList.get( i );

for ( int i = 0, icount = sourceList.size(); i < icount; i++ )
if ( ( o == null ) || componentClass.isInstance( o ) )
{
Object o = sourceList.get( i );

if ( ( o == null ) || componentClass.isInstance( o ) )
{
Array.set( result, i, o );
}
else
{
Array.set( result, i,
converter.convertValue( context, null, null, null, o, componentClass ) );
}
Array.set( result, i, o );
}
else
{
Array.set( result, i,
converter.convertValue( context, null, null, null, o, componentClass ) );
}
}
}
catch ( ClassNotFoundException ex )
{
throw new OgnlException( "array component class '" + className + "' not found", ex );
}
}
else
catch ( ClassNotFoundException ex )
{
throw new OgnlException( "only expect array size or fixed initializer list" );
throw new OgnlException( "array component class '" + className + "' not found", ex );
}
}
else
{
result = OgnlRuntime.callConstructor( context, className, args );
throw new OgnlException( "only expect array size or fixed initializer list" );
}

return result;
}
finally
else
{
OgnlRuntime.getObjectArrayPool().recycle( args );
result = OgnlRuntime.callConstructor( context, className, args );
}

return result;
}


@@ -75,32 +75,24 @@ public String getMethodName()
protected Object getValueBody( OgnlContext context, Object source )
throws OgnlException
{
Object[] args = OgnlRuntime.getObjectArrayPool().create( jjtGetNumChildren() );
Object[] args = new Object[jjtGetNumChildren()];

try
{
Object result, root = context.getRoot();

for ( int i = 0; i < args.length; ++i )
{
args[i] = children[i].getValue( context, root );
}

result = OgnlRuntime.callMethod( context, source, methodName, args );
Object result, root = context.getRoot();

if ( result == null )
{
NullHandler nullHandler = OgnlRuntime.getNullHandler( OgnlRuntime.getTargetClass( source ) );
result = nullHandler.nullMethodResult( context, source, methodName, args );
}
for ( int i = 0; i < args.length; ++i )
{
args[i] = children[i].getValue( context, root );
}

return result;
result = OgnlRuntime.callMethod( context, source, methodName, args );

}
finally
if ( result == null )
{
OgnlRuntime.getObjectArrayPool().recycle( args );
NullHandler nullHandler = OgnlRuntime.getNullHandler( OgnlRuntime.getTargetClass( source ) );
result = nullHandler.nullMethodResult( context, source, methodName, args );
}

return result;
}

public String getLastExpression()
@@ -61,23 +61,15 @@ void init( String className, String methodName )
protected Object getValueBody( OgnlContext context, Object source )
throws OgnlException
{
ObjectArrayPool objectArrayPool = OgnlRuntime.getObjectArrayPool();
Object[] args = objectArrayPool.create( jjtGetNumChildren() );
Object[] args = new Object[jjtGetNumChildren()];
Object root = context.getRoot();

try
for ( int i = 0, icount = args.length; i < icount; ++i )
{
for ( int i = 0, icount = args.length; i < icount; ++i )
{
args[i] = children[i].getValue( context, root );
}

return OgnlRuntime.callStaticMethod( context, className, methodName, args );
}
finally
{
objectArrayPool.recycle( args );
args[i] = children[i].getValue( context, root );
}

return OgnlRuntime.callStaticMethod( context, className, methodName, args );
}

public Class getGetterClass()

This file was deleted.

0 comments on commit fd35fd2

Please sign in to comment.