You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by jh...@apache.org on 2014/06/28 21:43:32 UTC
git commit: checkstyle
Repository: ant
Updated Branches:
refs/heads/master 66329f7fe -> aa21694b8
checkstyle
Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/aa21694b
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/aa21694b
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/aa21694b
Branch: refs/heads/master
Commit: aa21694b843e9ee674441ba986a0c8c3ffa9d21c
Parents: 66329f7
Author: Jan Mat�rne <jh...@apache.org>
Authored: Sat Jun 28 21:43:03 2014 +0200
Committer: Jan Mat�rne <jh...@apache.org>
Committed: Sat Jun 28 21:43:03 2014 +0200
----------------------------------------------------------------------
.../org/apache/tools/ant/util/CollectionUtils.java | 15 ++++++++++++++-
src/main/org/apache/tools/ant/util/DateUtils.java | 4 ++--
src/main/org/apache/tools/ant/util/DeweyDecimal.java | 7 +++++++
3 files changed, 23 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ant/blob/aa21694b/src/main/org/apache/tools/ant/util/CollectionUtils.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/util/CollectionUtils.java b/src/main/org/apache/tools/ant/util/CollectionUtils.java
index 65735ae..03c48d9 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 <K> type of the key
+ * @param <V> 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 <E> 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 <E> element type
* @return an Enumeration.
*/
public static <E> Enumeration<E> asEnumeration(final Iterator<E> iter) {
@@ -190,6 +196,7 @@ public class CollectionUtils {
/**
* Adapt the specified Enumeration to the Iterator interface.
* @param e the Enumeration to adapt.
+ * @param <E> element type
* @return an Iterator.
*/
public static <E> Iterator<E> asIterator(final Enumeration<E> e) {
@@ -209,6 +216,9 @@ public class CollectionUtils {
/**
* Returns a collection containing all elements of the iterator.
*
+ * @param iter the Iterator to convert
+ * @param <T> element type
+ * @return the collection
* @since Ant 1.8.0
*/
public static <T> Collection<T> asCollection(final Iterator<? extends T> 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++;
http://git-wip-us.apache.org/repos/asf/ant/blob/aa21694b/src/main/org/apache/tools/ant/util/DateUtils.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/util/DateUtils.java b/src/main/org/apache/tools/ant/util/DateUtils.java
index 17beaa3..1ed95ec 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}");
http://git-wip-us.apache.org/repos/asf/ant/blob/aa21694b/src/main/org/apache/tools/ant/util/DeweyDecimal.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/util/DeweyDecimal.java b/src/main/org/apache/tools/ant/util/DeweyDecimal.java
index c4012a0..8e9cc44 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<DeweyDecimal> {
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++) {