You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by eb...@apache.org on 2007/04/25 14:23:03 UTC

svn commit: r532336 - in /jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration: ./ event/ interpol/ plist/

Author: ebourg
Date: Wed Apr 25 05:23:01 2007
New Revision: 532336

URL: http://svn.apache.org/viewvc?view=rev&rev=532336
Log:
Fixed several checkstyle warnings

Modified:
    jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/ConfigurationBuilder.java
    jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/DataConfiguration.java
    jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/DatabaseConfiguration.java
    jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/HierarchicalConfiguration.java
    jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/PropertyConverter.java
    jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/event/EventSource.java
    jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/interpol/ConfigurationInterpolator.java
    jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/plist/PropertyListConfiguration.java
    jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/plist/XMLPropertyListConfiguration.java

Modified: jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/ConfigurationBuilder.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/ConfigurationBuilder.java?view=diff&rev=532336&r1=532335&r2=532336
==============================================================================
--- jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/ConfigurationBuilder.java (original)
+++ jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/ConfigurationBuilder.java Wed Apr 25 05:23:01 2007
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.configuration;
 
 /**
@@ -28,9 +29,7 @@
  * configuration constructed by this builder.
  * </p>
  *
- * @author <a
- * href="http://jakarta.apache.org/commons/configuration/team-list.html">Commons
- * Configuration team</a>
+ * @author <a href="http://jakarta.apache.org/commons/configuration/team-list.html">Commons Configuration team</a>
  * @version $Id$
  */
 public interface ConfigurationBuilder

Modified: jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/DataConfiguration.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/DataConfiguration.java?view=diff&rev=532336&r1=532335&r2=532336
==============================================================================
--- jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/DataConfiguration.java (original)
+++ jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/DataConfiguration.java Wed Apr 25 05:23:01 2007
@@ -223,7 +223,7 @@
             {
                 if (Date.class.equals(cls) || Calendar.class.equals(cls))
                 {
-                    return PropertyConverter.to(cls, interpolate(value), new String[] { getDefaultDateFormat() });
+                    return PropertyConverter.to(cls, interpolate(value), new String[] {getDefaultDateFormat()});
                 }
                 else
                 {
@@ -289,7 +289,7 @@
             Object[] params = null;
             if (cls.equals(Date.class) || cls.equals(Calendar.class))
             {
-                params = new Object[] { getDefaultDateFormat() };
+                params = new Object[] {getDefaultDateFormat()};
             }
 
             try
@@ -300,7 +300,8 @@
                     Class arrayType = valueClass.getComponentType();
                     int length = Array.getLength(value);
 
-                    if (arrayType.equals(cls) || (arrayType.isPrimitive() && cls.equals(ClassUtils.primitiveToWrapper(arrayType))))
+                    if (arrayType.equals(cls)
+                            || (arrayType.isPrimitive() && cls.equals(ClassUtils.primitiveToWrapper(arrayType))))
                     {
                         // the value is an array of the specified type, or an array
                         // of the primitive type derived from the specified type
@@ -381,7 +382,8 @@
         // check the type of the default value
         if (defaultValue != null && (!defaultValue.getClass().isArray() || !cls.isAssignableFrom(defaultValue.getClass().getComponentType())))
         {
-            throw new IllegalArgumentException("The type of the default value (" + defaultValue.getClass() + ") is not an array of the specified class (" + cls + ")");
+            throw new IllegalArgumentException("The type of the default value (" + defaultValue.getClass() + ")"
+                    + " is not an array of the specified class (" + cls + ")");
         }
 
         if (cls.isPrimitive())
@@ -451,7 +453,8 @@
                 }
                 else
                 {
-                    throw new ConversionException('\'' + key + "' (" + arrayType + ") doesn't map to a compatible array of " + cls);
+                    throw new ConversionException('\'' + key + "' (" + arrayType + ")"
+                            + " doesn't map to a compatible array of " + cls);
                 }
             }
             else if (value instanceof Collection)

Modified: jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/DatabaseConfiguration.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/DatabaseConfiguration.java?view=diff&rev=532336&r1=532335&r2=532336
==============================================================================
--- jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/DatabaseConfiguration.java (original)
+++ jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/DatabaseConfiguration.java Wed Apr 25 05:23:01 2007
@@ -587,7 +587,7 @@
         {
             getLogger().error("An error occured on closing the statement", e);
         }
-        
+
         try
         {
             if (conn != null)

Modified: jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/HierarchicalConfiguration.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/HierarchicalConfiguration.java?view=diff&rev=532336&r1=532335&r2=532336
==============================================================================
--- jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/HierarchicalConfiguration.java (original)
+++ jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/HierarchicalConfiguration.java Wed Apr 25 05:23:01 2007
@@ -117,7 +117,7 @@
  * <dt><em>EVENT_SUBNODE_CHANGED</em></dt><dd>A <code>SubnodeConfiguration</code>
  * that was created from this configuration has been changed. The value property
  * of the event object contains the original event object as it was sent by the
- * subnode configuration.</dd></dl></p> 
+ * subnode configuration.</dd></dl></p>
  *
  * @author Oliver Heger
  * @version $Id$

Modified: jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/PropertyConverter.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/PropertyConverter.java?view=diff&rev=532336&r1=532335&r2=532336
==============================================================================
--- jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/PropertyConverter.java (original)
+++ jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/PropertyConverter.java Wed Apr 25 05:23:01 2007
@@ -63,11 +63,12 @@
     /** Constant for the radix of hex numbers.*/
     private static final int HEX_RADIX = 16;
 
-    /** Constant for the argument classes of the Number constructor that takes
-     * a String.
-     */
+    /** Constant for the argument classes of the Number constructor that takes a String. */
     private static final Class[] CONSTR_ARGS = {String.class};
 
+    /** The fully qualified name of {@link javax.mail.internet.InternetAddress} */
+    private static final String INTERNET_ADDRESS_CLASSNAME = "javax.mail.internet.InternetAddress";
+
     /**
      * Private constructor prevents instances from being created.
      */
@@ -154,7 +155,7 @@
         {
             return toColor(value);
         }
-        else if (cls.getName().equals("javax.mail.internet.InternetAddress"))
+        else if (cls.getName().equals(INTERNET_ADDRESS_CLASSNAME))
         {
             return toInternetAddress(value);
         }
@@ -163,7 +164,8 @@
             return toInetAddress(value);
         }
 
-        throw new ConversionException("The value '" + value + "' (" + value.getClass() + ") can't be converted to a " + cls.getName() + " object");
+        throw new ConversionException("The value '" + value + "' (" + value.getClass() + ")"
+                + " can't be converted to a " + cls.getName() + " object");
     }
 
     /**
@@ -671,7 +673,7 @@
      */
     static Object toInternetAddress(Object value) throws ConversionException
     {
-        if (value.getClass().getName().equals("javax.mail.internet.InternetAddress"))
+        if (value.getClass().getName().equals(INTERNET_ADDRESS_CLASSNAME))
         {
             return value;
         }
@@ -679,8 +681,8 @@
         {
             try
             {
-                Constructor ctor = Class.forName("javax.mail.internet.InternetAddress").getConstructor(new Class[] { String.class });
-                return ctor.newInstance(new Object[] { value });
+                Constructor ctor = Class.forName(INTERNET_ADDRESS_CLASSNAME).getConstructor(new Class[] {String.class});
+                return ctor.newInstance(new Object[] {value});
             }
             catch (Exception e)
             {
@@ -735,8 +737,8 @@
         {
             try
             {
-                Method valueOfMethod = cls.getMethod("valueOf", new Class[] { String.class });
-                return valueOfMethod.invoke(null, new Object[] { value });
+                Method valueOfMethod = cls.getMethod("valueOf", new Class[] {String.class});
+                return valueOfMethod.invoke(null, new Object[] {value});
             }
             catch (Exception e)
             {

Modified: jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/event/EventSource.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/event/EventSource.java?view=diff&rev=532336&r1=532335&r2=532336
==============================================================================
--- jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/event/EventSource.java (original)
+++ jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/event/EventSource.java Wed Apr 25 05:23:01 2007
@@ -63,9 +63,7 @@
  * notifications about errors to registered observers.
  * </p>
  *
- * @author <a
- * href="http://jakarta.apache.org/commons/configuration/team-list.html">Commons
- * Configuration team</a>
+ * @author <a href="http://jakarta.apache.org/commons/configuration/team-list.html">Commons Configuration team</a>
  * @version $Id$
  * @since 1.3
  */
@@ -229,8 +227,7 @@
      * @param propValue the value of the affected property (can be <b>null</b>)
      * @param before the before update flag
      */
-    protected void fireEvent(int type, String propName, Object propValue,
-            boolean before)
+    protected void fireEvent(int type, String propName, Object propValue, boolean before)
     {
         Collection listenersToCall = null;
 
@@ -246,8 +243,7 @@
 
         if (listenersToCall != null)
         {
-            ConfigurationEvent event = createEvent(type, propName, propValue,
-                    before);
+            ConfigurationEvent event = createEvent(type, propName, propValue, before);
             for (Iterator it = listenersToCall.iterator(); it.hasNext();)
             {
                 ((ConfigurationListener) it.next()).configurationChanged(event);
@@ -266,8 +262,7 @@
      * @param before the before update flag
      * @return the newly created event object
      */
-    protected ConfigurationEvent createEvent(int type, String propName,
-            Object propValue, boolean before)
+    protected ConfigurationEvent createEvent(int type, String propName, Object propValue, boolean before)
     {
         return new ConfigurationEvent(this, type, propName, propValue, before);
     }
@@ -279,12 +274,10 @@
      * @param type the event's type
      * @param propName the name of the affected property (can be <b>null</b>)
      * @param propValue the value of the affected property (can be <b>null</b>)
-     * @param ex the <code>Throwable</code> object that caused this error
-     * event
+     * @param ex the <code>Throwable</code> object that caused this error event
      * @since 1.4
      */
-    protected void fireError(int type, String propName, Object propValue,
-            Throwable ex)
+    protected void fireError(int type, String propName, Object propValue, Throwable ex)
     {
         Collection listenersToCall = null;
 
@@ -300,12 +293,10 @@
 
         if (listenersToCall != null)
         {
-            ConfigurationErrorEvent event = createErrorEvent(type, propName,
-                    propValue, ex);
+            ConfigurationErrorEvent event = createErrorEvent(type, propName, propValue, ex);
             for (Iterator it = listenersToCall.iterator(); it.hasNext();)
             {
-                ((ConfigurationErrorListener) it.next())
-                        .configurationError(event);
+                ((ConfigurationErrorListener) it.next()).configurationError(event);
             }
         }
     }
@@ -323,8 +314,7 @@
      * @return the event object
      * @since 1.4
      */
-    protected ConfigurationErrorEvent createErrorEvent(int type,
-            String propName, Object propValue, Throwable ex)
+    protected ConfigurationErrorEvent createErrorEvent(int type, String propName, Object propValue, Throwable ex)
     {
         return new ConfigurationErrorEvent(this, type, propName, propValue, ex);
     }

Modified: jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/interpol/ConfigurationInterpolator.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/interpol/ConfigurationInterpolator.java?view=diff&rev=532336&r1=532335&r2=532336
==============================================================================
--- jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/interpol/ConfigurationInterpolator.java (original)
+++ jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/interpol/ConfigurationInterpolator.java Wed Apr 25 05:23:01 2007
@@ -276,14 +276,14 @@
         {
             return null;
         }
-        
+
         int prefixPos = var.indexOf(PREFIX_SEPARATOR);
         if (prefixPos >= 0)
         {
             String prefix = var.substring(0, prefixPos);
             String name = var.substring(prefixPos + 1);
             String value = fetchLookupForPrefix(prefix).lookup(name);
-            if (value != null) 
+            if (value != null)
             {
                 return value;
             }
@@ -301,8 +301,7 @@
      */
     protected StrLookup fetchNoPrefixLookup()
     {
-        return (getDefaultLookup() != null) ? getDefaultLookup() : StrLookup
-                .noneLookup();
+        return (getDefaultLookup() != null) ? getDefaultLookup() : StrLookup.noneLookup();
     }
 
     /**
@@ -328,8 +327,7 @@
     static
     {
         globalLookups = new HashMap();
-        globalLookups.put(PREFIX_SYSPROPERTIES, StrLookup
-                .systemPropertiesLookup());
+        globalLookups.put(PREFIX_SYSPROPERTIES, StrLookup.systemPropertiesLookup());
         globalLookups.put(PREFIX_CONSTANTS, new ConstantLookup());
     }
 }

Modified: jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/plist/PropertyListConfiguration.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/plist/PropertyListConfiguration.java?view=diff&rev=532336&r1=532335&r2=532336
==============================================================================
--- jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/plist/PropertyListConfiguration.java (original)
+++ jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/plist/PropertyListConfiguration.java Wed Apr 25 05:23:01 2007
@@ -78,14 +78,14 @@
  */
 public class PropertyListConfiguration extends AbstractHierarchicalFileConfiguration
 {
+    /** The format used for the date objects in the plist files. */
+    static final DateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z");
+
     /** 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;
-
-    /** The format used for the date objects in the plist files. */
-    static final DateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z");
 
     /**
      * Creates an empty PropertyListConfiguration object which can be

Modified: jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/plist/XMLPropertyListConfiguration.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/plist/XMLPropertyListConfiguration.java?view=diff&rev=532336&r1=532335&r2=532336
==============================================================================
--- jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/plist/XMLPropertyListConfiguration.java (original)
+++ jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/plist/XMLPropertyListConfiguration.java Wed Apr 25 05:23:01 2007
@@ -405,8 +405,10 @@
      */
     private class XMLPropertyListHandler extends DefaultHandler
     {
+        /** The buffer containing the text node being read */
         private StringBuffer buffer = new StringBuffer();
 
+        /** The stack of configuration nodes */
         private List stack = new ArrayList();
 
         public XMLPropertyListHandler(Node root)
@@ -537,7 +539,7 @@
             buffer.setLength(0);
         }
 
-        public void characters(char ch[], int start, int length) throws SAXException
+        public void characters(char[] ch, int start, int length) throws SAXException
         {
             buffer.append(ch, start, length);
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org