From aa21694b843e9ee674441ba986a0c8c3ffa9d21c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Mat=C3=A8rne?= Date: Sat, 28 Jun 2014 21:43:03 +0200 Subject: [PATCH] checkstyle --- .../apache/tools/ant/util/CollectionUtils.java | 15 ++++++++++++++- src/main/org/apache/tools/ant/util/DateUtils.java | 4 ++-- .../org/apache/tools/ant/util/DeweyDecimal.java | 7 +++++++ 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/main/org/apache/tools/ant/util/CollectionUtils.java b/src/main/org/apache/tools/ant/util/CollectionUtils.java index 65735ae7e..03c48d937 100644 --- a/src/main/org/apache/tools/ant/util/CollectionUtils.java +++ b/src/main/org/apache/tools/ant/util/CollectionUtils.java @@ -107,6 +107,8 @@ public class CollectionUtils { * Creates a comma separated list of all values held in the given * collection. * + * @param c collection to transform + * @return string representation of the collection * @since Ant 1.8.0 */ public static String flattenToString(Collection c) { @@ -124,6 +126,8 @@ public class CollectionUtils { * Dictionary does not know the putAll method. Please use Map.putAll(). * @param m1 the to directory. * @param m2 the from directory. + * @param type of the key + * @param type of the value * @since Ant 1.6 * @deprecated since 1.6.x. */ @@ -164,6 +168,7 @@ public class CollectionUtils { * Elements are evaluated lazily. * @param e1 the first enumeration. * @param e2 the subsequent enumeration. + * @param element type * @return an enumeration representing e1 followed by e2. * @since Ant 1.6.3 */ @@ -174,6 +179,7 @@ public class CollectionUtils { /** * Adapt the specified Iterator to the Enumeration interface. * @param iter the Iterator to adapt. + * @param element type * @return an Enumeration. */ public static Enumeration asEnumeration(final Iterator iter) { @@ -190,6 +196,7 @@ public class CollectionUtils { /** * Adapt the specified Enumeration to the Iterator interface. * @param e the Enumeration to adapt. + * @param element type * @return an Iterator. */ public static Iterator asIterator(final Enumeration e) { @@ -209,6 +216,9 @@ public class CollectionUtils { /** * Returns a collection containing all elements of the iterator. * + * @param iter the Iterator to convert + * @param element type + * @return the collection * @since Ant 1.8.0 */ public static Collection asCollection(final Iterator iter) { @@ -246,13 +256,16 @@ public class CollectionUtils { * Counts how often the given Object occurs in the given * collection using equals() for comparison. * + * @param c collection in which to search + * @param o object to search + * @return frequency * @since Ant 1.8.0 */ public static int frequency(Collection c, Object o) { // same as Collections.frequency introduced with JDK 1.5 int freq = 0; if (c != null) { - for (Iterator i = c.iterator(); i.hasNext(); ) { + for (Iterator i = c.iterator(); i.hasNext();) { Object test = i.next(); if (o == null ? test == null : o.equals(test)) { freq++; diff --git a/src/main/org/apache/tools/ant/util/DateUtils.java b/src/main/org/apache/tools/ant/util/DateUtils.java index 17beaa3e0..1ed95ecbf 100644 --- a/src/main/org/apache/tools/ant/util/DateUtils.java +++ b/src/main/org/apache/tools/ant/util/DateUtils.java @@ -71,8 +71,8 @@ public final class DateUtils { private static final DateFormat DATE_HEADER_FORMAT_INT = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss ", Locale.US); - - + + // code from Magesh moved from DefaultLogger and slightly modified private static final MessageFormat MINUTE_SECONDS = new MessageFormat("{0}{1}"); diff --git a/src/main/org/apache/tools/ant/util/DeweyDecimal.java b/src/main/org/apache/tools/ant/util/DeweyDecimal.java index c4012a0a6..8e9cc44ea 100644 --- a/src/main/org/apache/tools/ant/util/DeweyDecimal.java +++ b/src/main/org/apache/tools/ant/util/DeweyDecimal.java @@ -207,6 +207,13 @@ public class DeweyDecimal implements Comparable { return sb.toString(); } + /** + * Compares this DeweyDecimal with another one. + * + * @param other another DeweyDecimal to compare with + * @return result + * @see java.lang.Comparable#compareTo() + */ public int compareTo(DeweyDecimal other) { final int max = Math.max(other.components.length, components.length); for (int i = 0; i < max; i++) {