Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 82DF29A4C for ; Thu, 8 Dec 2011 08:06:15 +0000 (UTC) Received: (qmail 4914 invoked by uid 500); 8 Dec 2011 08:06:15 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 4862 invoked by uid 500); 8 Dec 2011 08:06:14 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 4853 invoked by uid 99); 8 Dec 2011 08:06:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Dec 2011 08:06:14 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Dec 2011 08:06:12 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 889542388A9B for ; Thu, 8 Dec 2011 08:05:51 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1211779 - /commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/RecordedInvocation.java Date: Thu, 08 Dec 2011 08:05:51 -0000 To: commits@commons.apache.org From: simonetripodi@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111208080551.889542388A9B@eris.apache.org> Author: simonetripodi Date: Thu Dec 8 08:05:51 2011 New Revision: 1211779 URL: http://svn.apache.org/viewvc?rev=1211779&view=rev Log: minofr format, fixed checkstyle rules Modified: commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/RecordedInvocation.java Modified: commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/RecordedInvocation.java URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/RecordedInvocation.java?rev=1211779&r1=1211778&r2=1211779&view=diff ============================================================================== --- commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/RecordedInvocation.java (original) +++ commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/RecordedInvocation.java Thu Dec 8 08:05:51 2011 @@ -1,3 +1,5 @@ +package org.apache.commons.digester3; + /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -15,8 +17,6 @@ * limitations under the License. */ -package org.apache.commons.digester3; - import java.lang.reflect.Method; /** @@ -26,19 +26,22 @@ import java.lang.reflect.Method; */ public class RecordedInvocation { -//********************************************************************************************************************** -// Fields -//********************************************************************************************************************** + + //********************************************************************************************************************** + // Fields + //********************************************************************************************************************** private final Method invokedMethod; + private final Object[] arguments; - //********************************************************************************************************************** - // Constructors - //********************************************************************************************************************** + //********************************************************************************************************************** + // Constructors + //********************************************************************************************************************** /** * Create a new RecordedInvocation instance. + * * @param invokedMethod * @param arguments */ @@ -48,23 +51,27 @@ public class RecordedInvocation this.arguments = arguments; } - //********************************************************************************************************************** - // Canonical Methods - //********************************************************************************************************************** + //********************************************************************************************************************** + // Canonical Methods + //********************************************************************************************************************** /** * Get the invokedMethod. + * * @return Method */ - public Method getInvokedMethod() { + public Method getInvokedMethod() + { return invokedMethod; } /** * Get the arguments. + * * @return Object[] */ - public Object[] getArguments() { + public Object[] getArguments() + { return arguments; } @@ -74,62 +81,64 @@ public class RecordedInvocation public String toString() { StringBuffer buffer = new StringBuffer(); - buffer.append(invokedMethod.getDeclaringClass().getName()); - buffer.append("."); - buffer.append(invokedMethod.getName()); - buffer.append("("); + buffer.append( invokedMethod.getDeclaringClass().getName() ); + buffer.append( "." ); + buffer.append( invokedMethod.getName() ); + buffer.append( "(" ); int count = arguments.length; - for( int i = 0; i < count; i++ ) + for ( int i = 0; i < count; i++ ) { Object arg = arguments[i]; - if( i > 0 ) + if ( i > 0 ) { - buffer.append(", "); + buffer.append( ", " ); } - convert(buffer, arg); + convert( buffer, arg ); } - buffer.append(")"); + buffer.append( ")" ); return buffer.toString(); } /** * Add a string representation of input to buffer. + * * @param buffer * @param input */ protected void convert( StringBuffer buffer, Object input ) { - if( input == null ) + if ( input == null ) { - buffer.append(""); + buffer.append( "" ); return; } // Primitive types, and non-object arrays // use toString(). - if( !( input instanceof Object[] ) ) + if ( !( input instanceof Object[] ) ) { - buffer.append(input.toString()); + buffer.append( input.toString() ); return; } else { - buffer.append("("); - buffer.append(input.getClass().getSimpleName()); - buffer.append("){"); - Object[] array = ( Object[] ) input; + buffer.append( "(" ); + buffer.append( input.getClass().getSimpleName() ); + buffer.append( "){" ); + Object[] array = (Object[]) input; int count = array.length; - for( int i = 0; i < count; i++ ) + for ( int i = 0; i < count; i++ ) { - if( i > 0 ) + if ( i > 0 ) { - buffer.append(", "); + buffer.append( ", " ); } // We use convert() again, because it could be a multi-dimensional array // where each element must be converted. - convert(buffer, array[i]); + convert( buffer, array[i] ); } - buffer.append("}"); + buffer.append( "}" ); } } + }