commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nia...@apache.org
Subject svn commit: r911986 - in /commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang: Entities.java StringUtils.java builder/IDKey.java math/JVMRandom.java reflect/MethodUtils.java text/StrBuilder.java time/DateUtils.java
Date Fri, 19 Feb 2010 21:19:07 GMT
Author: niallp
Date: Fri Feb 19 21:19:05 2010
New Revision: 911986

URL: http://svn.apache.org/viewvc?rev=911986&view=rev
Log:
Checkstyle changes only

Modified:
    commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/Entities.java
    commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/StringUtils.java
    commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/builder/IDKey.java
    commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/math/JVMRandom.java
    commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/reflect/MethodUtils.java
    commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/text/StrBuilder.java
    commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/time/DateUtils.java

Modified: commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/Entities.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/Entities.java?rev=911986&r1=911985&r2=911986&view=diff
==============================================================================
--- commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/Entities.java
(original)
+++ commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/Entities.java
Fri Feb 19 21:19:05 2010
@@ -742,11 +742,18 @@
 
     private final EntityMap map;
 
+    /**
+     * Default constructor.
+     */
     public Entities(){
         map = new Entities.LookupEntityMap();
     }
 
-    // package scoped for testing
+    /**
+     * package scoped constructor for testing.
+     *
+     * @param emap entity map.
+     */
     Entities(EntityMap emap){
         map = emap;
     }

Modified: commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/StringUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/StringUtils.java?rev=911986&r1=911985&r2=911986&view=diff
==============================================================================
--- commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/StringUtils.java
(original)
+++ commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/StringUtils.java
Fri Feb 19 21:19:05 2010
@@ -807,6 +807,19 @@
         return ordinalIndexOf(str, searchStr, ordinal, false);
     }
 
+    /**
+     * <p>Finds the n-th index within a String, handling <code>null</code>.
+     * This method uses {@link String#indexOf(String)}.</p>
+     *
+     * <p>A <code>null</code> String will return <code>-1</code>.</p>
+     *
+     * @param str  the String to check, may be null
+     * @param searchStr  the String to find, may be null
+     * @param ordinal  the n-th <code>searchStr</code> to find
+     * @param lastIndex true if lastOrdinalIndexOf() otherwise false if ordinalIndexOf()
+     * @return the n-th index of the search String,
+     *  <code>-1</code> (<code>INDEX_NOT_FOUND</code>) if no match
or <code>null</code> string input
+     */
     // Shared code between ordinalIndexOf(String,String,int) and lastOrdinalIndexOf(String,String,int)
     private static int ordinalIndexOf(String str, String searchStr, int ordinal, boolean
lastIndex) {
         if (str == null || searchStr == null || ordinal <= 0) {

Modified: commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/builder/IDKey.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/builder/IDKey.java?rev=911986&r1=911985&r2=911986&view=diff
==============================================================================
--- commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/builder/IDKey.java
(original)
+++ commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/builder/IDKey.java
Fri Feb 19 21:19:05 2010
@@ -35,7 +35,7 @@
 
         /**
          * Constructor for IDKey
-         * @param _value
+         * @param _value The value
          */ 
         public IDKey(Object _value) {
             // This is the Object hashcode 
@@ -56,7 +56,7 @@
 
         /**
          * checks if instances are equal
-         * @param other
+         * @param other The other object to compare to
          * @return if the instances are for the same object
          */ 
         public boolean equals(Object other) {

Modified: commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/math/JVMRandom.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/math/JVMRandom.java?rev=911986&r1=911985&r2=911986&view=diff
==============================================================================
--- commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/math/JVMRandom.java
(original)
+++ commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/math/JVMRandom.java
Fri Feb 19 21:19:05 2010
@@ -214,8 +214,12 @@
         int n=0; // number of leading zeros found
         while(true){
             // 64 = number of bits in a long
-            if (num < 0) return 64-n; // no leading zeroes left
-            if (y == 0) return n; // no bits left to check
+            if (num < 0) {
+                return 64-n; // no leading zeroes left
+            }
+            if (y == 0) {
+                return n; // no bits left to check
+            }
             n++;
             num=num << 1; // check leading bits
             y=y >> 1; // check trailing bits

Modified: commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/reflect/MethodUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/reflect/MethodUtils.java?rev=911986&r1=911985&r2=911986&view=diff
==============================================================================
--- commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/reflect/MethodUtils.java
(original)
+++ commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/reflect/MethodUtils.java
Fri Feb 19 21:19:05 2010
@@ -549,6 +549,7 @@
      * @param cls Class to be checked
      * @param methodName Method name of the method we wish to call
      * @param parameterTypes The parameter type signatures
+     * @return the accessible method or <code>null</code> if not found
      */
     private static Method getAccessibleMethodFromSuperclass(Class cls,
             String methodName, Class[] parameterTypes) {
@@ -579,6 +580,7 @@
      * @param cls Parent class for the interfaces to be checked
      * @param methodName Method name of the method we wish to call
      * @param parameterTypes The parameter type signatures
+     * @return the accessible method or <code>null</code> if not found
      */
     private static Method getAccessibleMethodFromInterfaceNest(Class cls,
             String methodName, Class[] parameterTypes) {

Modified: commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/text/StrBuilder.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/text/StrBuilder.java?rev=911986&r1=911985&r2=911986&view=diff
==============================================================================
--- commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/text/StrBuilder.java
(original)
+++ commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/text/StrBuilder.java
Fri Feb 19 21:19:05 2010
@@ -2618,6 +2618,9 @@
      */
     class StrBuilderTokenizer extends StrTokenizer {
 
+        /**
+         * Default constructor.
+         */
         StrBuilderTokenizer() {
             super();
         }
@@ -2652,6 +2655,9 @@
         /** The last mark position. */
         private int mark;
 
+        /**
+         * Default constructor.
+         */
         StrBuilderReader() {
             super();
         }
@@ -2728,6 +2734,9 @@
      */
     class StrBuilderWriter extends Writer {
 
+        /**
+         * Default constructor.
+         */
         StrBuilderWriter() {
             super();
         }

Modified: commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/time/DateUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/time/DateUtils.java?rev=911986&r1=911985&r2=911986&view=diff
==============================================================================
--- commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/time/DateUtils.java
(original)
+++ commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/time/DateUtils.java
Fri Feb 19 21:19:05 2010
@@ -80,9 +80,6 @@
      */
     public static final long MILLIS_PER_DAY = 24 * MILLIS_PER_HOUR;
 
-    /** Sign characters */
-    private static final char[] SIGN_CHARS = new char[] {'+', '-'};
-
     /**
      * This is half a month, so this represents whether a date is in the top
      * or bottom half of the month.
@@ -361,6 +358,14 @@
         }
         throw new ParseException("Unable to parse the date: " + str, -1);
     }
+
+    /**
+     * Index of sign charaters (i.e. '+' or '-').
+     * 
+     * @param str The string to search
+     * @param startPos The start position
+     * @return the index of the first sign character or -1 if not found
+     */
     private static int indexOfSignChars(String str, int startPos) {
         int idx = StringUtils.indexOf(str, '+', startPos);
         if (idx < 0) {



Mime
View raw message