o Enabled access to non-public methods

git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@810194 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-09-01 19:46:20 +00:00
parent c8c274aea6
commit 99e67b151d
1 changed files with 5 additions and 0 deletions

View File

@ -161,6 +161,7 @@ class ExpressionUtil
try try
{ {
Method method = type.getMethod( property, NO_PARAMS ); Method method = type.getMethod( property, NO_PARAMS );
method.setAccessible( true );
value = method.invoke( context, NO_ARGS ); value = method.invoke( context, NO_ARGS );
} }
catch ( NoSuchMethodException e ) catch ( NoSuchMethodException e )
@ -169,6 +170,7 @@ class ExpressionUtil
{ {
String name = "get" + Character.toUpperCase( property.charAt( 0 ) ) + property.substring( 1 ); String name = "get" + Character.toUpperCase( property.charAt( 0 ) ) + property.substring( 1 );
Method method = type.getMethod( name, NO_PARAMS ); Method method = type.getMethod( name, NO_PARAMS );
method.setAccessible( true );
value = method.invoke( context, NO_ARGS ); value = method.invoke( context, NO_ARGS );
} }
catch ( NoSuchMethodException e1 ) catch ( NoSuchMethodException e1 )
@ -177,6 +179,7 @@ class ExpressionUtil
{ {
String name = "is" + Character.toUpperCase( property.charAt( 0 ) ) + property.substring( 1 ); String name = "is" + Character.toUpperCase( property.charAt( 0 ) ) + property.substring( 1 );
Method method = type.getMethod( name, NO_PARAMS ); Method method = type.getMethod( name, NO_PARAMS );
method.setAccessible( true );
value = method.invoke( context, NO_ARGS ); value = method.invoke( context, NO_ARGS );
} }
catch ( NoSuchMethodException e2 ) catch ( NoSuchMethodException e2 )
@ -192,6 +195,7 @@ class ExpressionUtil
{ {
method = type.getMethod( "get", OBJECT_PARAM ); method = type.getMethod( "get", OBJECT_PARAM );
} }
method.setAccessible( true );
value = method.invoke( context, new Object[] { property } ); value = method.invoke( context, new Object[] { property } );
} }
catch ( NoSuchMethodException e3 ) catch ( NoSuchMethodException e3 )
@ -199,6 +203,7 @@ class ExpressionUtil
try try
{ {
Field field = type.getField( property ); Field field = type.getField( property );
field.setAccessible( true );
value = field.get( context ); value = field.get( context );
} }
catch ( NoSuchFieldException e4 ) catch ( NoSuchFieldException e4 )