Skip to content
Permalink
Browse files
Remove use of redundant String.substring() parameter.
  • Loading branch information
garydgregory committed Feb 28, 2021
1 parent a709258 commit 334f8e877df4dd75c542f311bb26d1f07c54a61c
Showing 71 changed files with 278 additions and 278 deletions.
@@ -343,7 +343,7 @@ else if ( ( parent == null || !ASTChain.class.isInstance( parent ) )
throw OgnlOps.castToRuntime( t );
}
}

public <R, P> R accept( NodeVisitor<? extends R, ? super P> visitor, P data )
throws OgnlException
{
@@ -230,7 +230,7 @@ public String toSetSourceString( OgnlContext context, Object target )

return result;
}

/* (non-Javadoc)
* @see org.apache.commons.ognl.Node#accept(org.apache.commons.ognl.NodeVisitor, java.lang.Object)
*/
@@ -142,7 +142,7 @@ public String toSetSourceString( OgnlContext context, Object target )

return result + value + ")";
}

public <R, P> R accept( NodeVisitor<? extends R, ? super P> visitor, P data )
throws OgnlException
{
@@ -60,7 +60,7 @@ public String coerceToNumeric( String source, OgnlContext context, Node child )
{
return "(long)" + super.coerceToNumeric( source, context, child );
}

public <R, P> R accept( NodeVisitor<? extends R, ? super P> visitor, P data )
throws OgnlException
{
@@ -54,7 +54,7 @@ public String toGetSourceString( OgnlContext context, Object target )
return "~(" + source + ")";
}
}

public <R, P> R accept( NodeVisitor<? extends R, ? super P> visitor, P data )
throws OgnlException
{
@@ -55,7 +55,7 @@ public String getExpressionOperator( int index )
{
return "|";
}

public <R, P> R accept( NodeVisitor<? extends R, ? super P> visitor, P data )
throws OgnlException
{
@@ -131,7 +131,7 @@ protected Object getValueBody( OgnlContext context, Object source )
if ( !handled )
{
result =
OgnlRuntime.getIndexedProperty(
OgnlRuntime.getIndexedProperty(
context,
result,
propertyNode.getProperty( context, result ).toString(),
@@ -221,7 +221,7 @@ protected void setValueBody( OgnlContext context, Object target, Object value )
else if ( !handled )
{
target =
OgnlRuntime.getIndexedProperty(
OgnlRuntime.getIndexedProperty(
context,
target,
propertyNode.getProperty( context, target ).toString(),
@@ -395,7 +395,7 @@ public String toSetSourceString( OgnlContext context, Object target )
{
throw new UnsupportedCompilationException( "Can't compile nested chain expressions." );
}

if ( target != null )
{
context.setCurrentObject( target );
@@ -433,7 +433,7 @@ public String toSetSourceString( OgnlContext context, Object target )
{
constructor = true;
}

if ( NodeType.class.isInstance( children[i] )
&& ( (NodeType) children[i] ).getGetterClass() != null )
{
@@ -467,7 +467,7 @@ public String toSetSourceString( OgnlContext context, Object target )
{
result += value;
}

context.put( "_currentChain", result );
}
}
@@ -484,10 +484,10 @@ public String toSetSourceString( OgnlContext context, Object target )
{
setterClass = lastType.getSetterClass();
}

return result;
}

public <R, P> R accept( NodeVisitor<? extends R, ? super P> visitor, P data )
throws OgnlException
{
@@ -43,9 +43,9 @@ public ASTConst( OgnlParser p, int id )
super( p, id );
}

/**
/**
* Called from parser actions.
* @param value the value to set
* @param value the value to set
*/
public void setValue( Object value )
{
@@ -75,7 +75,7 @@ public Class getGetterClass()
{
return null;
}

return getterClass;
}

@@ -114,7 +114,7 @@ else if ( value != null && Number.class.isAssignableFrom( value.getClass() ) )
return value.toString();
}
else if ( !( parent != null
&& value != null
&& value != null
&& NumericExpression.class.isAssignableFrom( parent.getClass() ) )
&& String.class.isAssignableFrom( value.getClass() ) )
{
@@ -140,7 +140,7 @@ else if ( Character.class.isInstance( value ) )
{
retval = "'" + OgnlOps.getEscapedChar( ( (Character) value ).charValue() ) + "'";
}

context.setCurrentObject( retval );
return retval.toString();
}
@@ -164,10 +164,10 @@ public String toSetSourceString( OgnlContext context, Object target )
{
throw new UnsupportedCompilationException( "Can't modify constant values." );
}

return toGetSourceString( context, target );
}

public <R, P> R accept( NodeVisitor<? extends R, ? super P> visitor, P data )
throws OgnlException
{
@@ -238,12 +238,12 @@ else if ( ASTChain.class.isInstance( children[0] ) )
{
cast = "";
}

if ( !ASTConst.class.isInstance( children[i] ) )
{
value = cast + value;
}

values[i] = objValue;
expressions[i] = value;
types[i] = context.getCurrentType();
@@ -274,8 +274,8 @@ else if ( ASTChain.class.isInstance( children[0] ) )
OgnlRuntime.getConstructors( clazz ), values,
new Object[values.length] );
}
if ( ctor == null )

if ( ctor == null )
{
throw new NoSuchMethodException(
"Unable to find constructor appropriate for arguments in class: " + clazz );
@@ -322,7 +322,7 @@ else if ( !ASTConst.class.isInstance( children[i] )
{
value =
"new "
+ ExpressionCompiler.getCastString(
+ ExpressionCompiler.getCastString(
OgnlRuntime.getPrimitiveWrapperClass( types[i] ) )
+ "(" + value + ")";
}
@@ -48,7 +48,7 @@ public String getExpressionOperator( int index )
return "/";
}


public <R, P> R accept( NodeVisitor<? extends R, ? super P> visitor, P data )
throws OgnlException
{
@@ -52,7 +52,7 @@ public String getComparisonFunction()
{
return "org.apache.commons.ognl.OgnlOps.equal";
}

public <R, P> R accept( NodeVisitor<? extends R, ? super P> visitor, P data )
throws OgnlException
{
@@ -86,7 +86,7 @@ public String toSetSourceString( OgnlContext context, Object target )
{
throw new UnsupportedCompilationException( "Map expressions not supported as native java yet." );
}

public <R, P> R accept( NodeVisitor<? extends R, ? super P> visitor, P data )
throws OgnlException
{
@@ -53,7 +53,7 @@ public String getComparisonFunction()
{
return "org.apache.commons.ognl.OgnlOps.greater";
}

public <R, P> R accept( NodeVisitor<? extends R, ? super P> visitor, P data )
throws OgnlException
{
@@ -52,7 +52,7 @@ public String getComparisonFunction()
{
return "!org.apache.commons.ognl.OgnlOps.less";
}

public <R, P> R accept( NodeVisitor<? extends R, ? super P> visitor, P data )
throws OgnlException
{
@@ -91,7 +91,7 @@ public String toSetSourceString( OgnlContext context, Object target )
{
throw new UnsupportedCompilationException( "Map expressions not supported as native java yet." );
}

public <R, P> R accept( NodeVisitor<? extends R, ? super P> visitor, P data )
throws OgnlException
{
@@ -43,7 +43,7 @@ void setTargetType( String targetType )
this.targetType = targetType;
}

String getTargetType()
String getTargetType()
{
return targetType;
}
@@ -95,7 +95,7 @@ public String toSetSourceString( OgnlContext context, Object target )
{
return toGetSourceString( context, target );
}

public <R, P> R accept( NodeVisitor<? extends R, ? super P> visitor, P data )
throws OgnlException
{
@@ -53,7 +53,7 @@ public String getComparisonFunction()
{
return "org.apache.commons.ognl.OgnlOps.less";
}

public <R, P> R accept( NodeVisitor<? extends R, ? super P> visitor, P data )
throws OgnlException
{
@@ -53,7 +53,7 @@ public String getComparisonFunction()
return "!org.apache.commons.ognl.OgnlOps.greater";
}


public <R, P> R accept( NodeVisitor<? extends R, ? super P> visitor, P data )
throws OgnlException
{
@@ -123,7 +123,7 @@ public String toGetSourceString( OgnlContext context, Object target )
{
cast = "";
}

if ( !ASTConst.class.isInstance( children[i] ) )
{
value = cast + value;
@@ -219,7 +219,7 @@ public String toSetSourceString( OgnlContext context, Object target )
{
throw new UnsupportedCompilationException( "Can't generate setter for ASTList." );
}

public <R, P> R accept( NodeVisitor<? extends R, ? super P> visitor, P data )
throws OgnlException
{
@@ -56,7 +56,7 @@ public String getExpressionOperator( int index )
{
return "*";
}

public <R, P> R accept( NodeVisitor<? extends R, ? super P> visitor, P data )
throws OgnlException
{
@@ -54,7 +54,7 @@ public String toGetSourceString( OgnlContext context, Object target )
return "-(" + source + ")";
}
}

public <R, P> R accept( NodeVisitor<? extends R, ? super P> visitor, P data )
throws OgnlException
{
@@ -57,7 +57,7 @@ public String toGetSourceString( OgnlContext context, Object target )
{
srcString = "null";
}

context.setCurrentType( Boolean.TYPE );

return "(! org.apache.commons.ognl.OgnlOps.booleanValue(" + srcString + ") )";
@@ -68,7 +68,7 @@ public String toGetSourceString( OgnlContext context, Object target )
throw OgnlOps.castToRuntime( t );
}
}

public <R, P> R accept( NodeVisitor<? extends R, ? super P> visitor, P data )
throws OgnlException
{
@@ -53,7 +53,7 @@ public String getComparisonFunction()
{
return "!org.apache.commons.ognl.OgnlOps.equal";
}

public <R, P> R accept( NodeVisitor<? extends R, ? super P> visitor, P data )
throws OgnlException
{
@@ -85,7 +85,7 @@ public String toGetSourceString( OgnlContext context, Object target )
throw OgnlOps.castToRuntime( t );
}
}

public <R, P> R accept( NodeVisitor<? extends R, ? super P> visitor, P data )
throws OgnlException
{

0 comments on commit 334f8e8

Please sign in to comment.