Return-Path: Delivered-To: apmail-commons-commits-archive@locus.apache.org Received: (qmail 44932 invoked from network); 22 Feb 2008 14:55:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Feb 2008 14:55:20 -0000 Received: (qmail 46427 invoked by uid 500); 22 Feb 2008 14:55:15 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 46010 invoked by uid 500); 22 Feb 2008 14:55: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 45990 invoked by uid 99); 22 Feb 2008 14:55:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Feb 2008 06:55:14 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Feb 2008 14:54:48 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 1B3961A9832; Fri, 22 Feb 2008 06:54:57 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r630221 - in /commons/proper/configuration/branches/configuration2_experimental: ./ conf/ src/main/java/org/apache/commons/configuration2/ src/main/java/org/apache/commons/configuration2/plist/ Date: Fri, 22 Feb 2008 14:54:56 -0000 To: commits@commons.apache.org From: ebourg@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080222145458.1B3961A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ebourg Date: Fri Feb 22 06:54:53 2008 New Revision: 630221 URL: http://svn.apache.org/viewvc?rev=630221&view=rev Log: Configured the Maven 2 Checkstyle plugin Changed the Checkstyle settings to avoid false positives with the Java 5 syntax Fixed some checkstyle warnings Modified: commons/proper/configuration/branches/configuration2_experimental/conf/checkstyle.xml commons/proper/configuration/branches/configuration2_experimental/pom.xml commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/INIConfiguration.java commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/Base64.java commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/Hex.java commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/PropertyListConfiguration.java commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/XMLPropertyListConfiguration.java Modified: commons/proper/configuration/branches/configuration2_experimental/conf/checkstyle.xml URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/conf/checkstyle.xml?rev=630221&r1=630220&r2=630221&view=diff ============================================================================== --- commons/proper/configuration/branches/configuration2_experimental/conf/checkstyle.xml (original) +++ commons/proper/configuration/branches/configuration2_experimental/conf/checkstyle.xml Fri Feb 22 06:54:53 2008 @@ -58,7 +58,7 @@ - + @@ -93,7 +93,10 @@ - + + + + Modified: commons/proper/configuration/branches/configuration2_experimental/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/pom.xml?rev=630221&r1=630220&r2=630221&view=diff ============================================================================== --- commons/proper/configuration/branches/configuration2_experimental/pom.xml (original) +++ commons/proper/configuration/branches/configuration2_experimental/pom.xml Fri Feb 22 06:54:53 2008 @@ -359,6 +359,13 @@ src/main/java + + org.apache.maven.plugins + maven-checkstyle-plugin + + conf/checkstyle.xml + + Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/INIConfiguration.java URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/INIConfiguration.java?rev=630221&r1=630220&r2=630221&view=diff ============================================================================== --- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/INIConfiguration.java (original) +++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/INIConfiguration.java Fri Feb 22 06:54:53 2008 @@ -245,7 +245,7 @@ Object value = subset.getProperty(key); if (value instanceof Collection) { - for (Object val : ((Collection) value)) + for (Object val : (Collection) value) { out.print(key); out.print(" = "); @@ -397,7 +397,7 @@ } String v = result.toString(); - if(!quoted) + if (!quoted) { v = v.trim(); } Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/Base64.java URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/Base64.java?rev=630221&r1=630220&r2=630221&view=diff ============================================================================== --- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/Base64.java (original) +++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/Base64.java Fri Feb 22 06:54:53 2008 @@ -34,35 +34,35 @@ /** The current value being converted. */ private String value; - private Base64() - { - super(null, ""); - } + private Base64() + { + super(null, ""); + } - public static synchronized String encodeBase64(byte[] array) - { - instance.putByteArray(null, array); - return instance.get(null, null); - } + public static synchronized String encodeBase64(byte[] array) + { + instance.putByteArray(null, array); + return instance.get(null, null); + } - public static synchronized byte[] decodeBase64(String base64String) - { - instance.put(null, base64String); - return instance.getByteArray(null, null); - } + public static synchronized byte[] decodeBase64(String base64String) + { + instance.put(null, base64String); + return instance.getByteArray(null, null); + } - public String get(String key, String defaultValue) - { - return value; - } + public String get(String key, String defaultValue) + { + return value; + } /** * Overrides the default implementation to avoid the constraint on the length of the value. */ public void put(String key, String value) - { - this.value = value; - } + { + this.value = value; + } protected void putSpi(String key, String value) { Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/Hex.java URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/Hex.java?rev=630221&r1=630220&r2=630221&view=diff ============================================================================== --- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/Hex.java (original) +++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/Hex.java Fri Feb 22 06:54:53 2008 @@ -18,14 +18,14 @@ package org.apache.commons.configuration2.plist; /** - * Hex encoder and decoder. This is a modified copy of the Hex class in Commons Codec + * Hex encoder and decoder. This is a modified copy of the Hex class in Commons Codec * - * @since 2.0 * @author Apache Software Foundation * @version $Id$ + * @since 2.0 */ -class Hex { - +class Hex +{ /** * Used to build output as Hex */ @@ -43,18 +43,21 @@ * the supplied char array. * @throws Exception Thrown if an odd number or illegal of characters is supplied */ - public static byte[] decodeHex(char[] data) throws Exception { + public static byte[] decodeHex(char[] data) throws Exception + { int len = data.length; - if ((len & 0x01) != 0) { + if ((len & 0x01) != 0) + { throw new Exception("Odd number of characters."); } byte[] out = new byte[len >> 1]; // two characters form the hex value. - for (int i = 0, j = 0; j < len; i++) { + for (int i = 0, j = 0; j < len; i++) + { int f = toDigit(data[j], j) << 4; j++; f = f | toDigit(data[j], j); @@ -68,14 +71,16 @@ /** * Converts a hexadecimal character to an integer. * - * @param ch A character to convert to an integer digit + * @param ch A character to convert to an integer digit * @param index The index of the character in the source * @return An integer * @throws Exception Thrown if ch is an illegal hex character */ - protected static int toDigit(char ch, int index) throws Exception { + protected static int toDigit(char ch, int index) throws Exception + { int digit = Character.digit(ch, 16); - if (digit == -1) { + if (digit == -1) + { throw new Exception("Illegal hexadecimal charcter " + ch + " at index " + index); } return digit; @@ -86,23 +91,23 @@ * The returned array will be double the length of the passed array, as it takes two characters to represent any * given byte. * - * @param data - * a byte[] to convert to Hex characters + * @param data a byte[] to convert to Hex characters * @return A char[] containing hexidecimal characters */ - public static char[] encodeHex(byte[] data) { + public static char[] encodeHex(byte[] data) + { int l = data.length; - char[] out = new char[l << 1]; + char[] out = new char[l << 1]; - // two characters form the hex value. - for (int i = 0, j = 0; i < l; i++) { - out[j++] = DIGITS[(0xF0 & data[i]) >>> 4 ]; - out[j++] = DIGITS[ 0x0F & data[i] ]; - } + // two characters form the hex value. + for (int i = 0, j = 0; i < l; i++) + { + out[j++] = DIGITS[(0xF0 & data[i]) >>> 4]; + out[j++] = DIGITS[0x0F & data[i]]; + } - return out; + return out; } } - Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/PropertyListConfiguration.java URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/PropertyListConfiguration.java?rev=630221&r1=630220&r2=630221&view=diff ============================================================================== --- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/PropertyListConfiguration.java (original) +++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/PropertyListConfiguration.java Fri Feb 22 06:54:53 2008 @@ -86,17 +86,17 @@ /** The default date format, its use must be synchronized */ private static final SimpleDateFormat DEFAULT_DATE_FORMAT = new SimpleDateFormat("<*'D'yyyy-MM-dd HH:mm:ss Z>"); - /** - * Instance specific format that can be used to format a date in differents time zones. - * Its use must be synchronized - */ - final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat(DEFAULT_DATE_FORMAT.toPattern()); - /** The serial version UID. */ private static final long serialVersionUID = 3227248503779092127L; /** Size of the indentation for the generated file. */ private static final int INDENT_SIZE = 4; + + /** + * Instance specific format that can be used to format a date in differents time zones. + * Its use must be synchronized + */ + final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat(DEFAULT_DATE_FORMAT.toPattern()); /** * Creates an empty PropertyListConfiguration object which can be Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/XMLPropertyListConfiguration.java URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/XMLPropertyListConfiguration.java?rev=630221&r1=630220&r2=630221&view=diff ============================================================================== --- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/XMLPropertyListConfiguration.java (original) +++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/XMLPropertyListConfiguration.java Fri Feb 22 06:54:53 2008 @@ -350,7 +350,7 @@ else if (value instanceof List) { out.println(padding + ""); - for (Object val : ((List) value)) + for (Object val : (List) value) { printValue(out, indentLevel + 1, val); }