Index: maven-core/src/main/java/org/apache/maven/plugin/DebugConfigurationListener.java =================================================================== --- maven-core/src/main/java/org/apache/maven/plugin/DebugConfigurationListener.java (revision 651051) +++ maven-core/src/main/java/org/apache/maven/plugin/DebugConfigurationListener.java (working copy) @@ -19,6 +19,8 @@ * under the License. */ +import java.lang.reflect.Array; + import org.codehaus.plexus.component.configurator.ConfigurationListener; import org.codehaus.plexus.logging.Logger; @@ -42,7 +44,7 @@ { if ( logger.isDebugEnabled() ) { - logger.debug( " (s) " + fieldName + " = " + value ); + logger.debug( " (s) " + fieldName + " = " + toString( value ) ); } } @@ -50,7 +52,50 @@ { if ( logger.isDebugEnabled() ) { - logger.debug( " (f) " + fieldName + " = " + value ); + logger.debug( " (f) " + fieldName + " = " + toString( value ) ); } } + + /** + * Creates a human-friendly string represenation of the specified object. + * + * @param obj The object to create a string representation for, may be null. + * @return The string representation, never null. + */ + private String toString( Object obj ) + { + String str; + if ( obj != null && obj.getClass().isArray() ) + { + int n = Array.getLength( obj ); + if ( n <= 0 ) + { + str = "[]"; + } + else + { + StringBuffer buf = new StringBuffer( 256 ); + for ( int i = 0; i < n; i++ ) + { + if ( i == 0 ) + { + buf.append( '[' ); + } + else + { + buf.append( ", " ); + } + buf.append( String.valueOf( Array.get( obj, i ) ) ); + } + buf.append( ']' ); + str = buf.toString(); + } + } + else + { + str = String.valueOf( obj ); + } + return str; + } + }