You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by gi...@apache.org on 2018/05/11 09:38:33 UTC
ant git commit: Checkstyle: indentation/whitespace (cf master)
Repository: ant
Updated Branches:
refs/heads/1.9.x 857095da5 -> 1909e147e
Checkstyle: indentation/whitespace (cf master)
Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/1909e147
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/1909e147
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/1909e147
Branch: refs/heads/1.9.x
Commit: 1909e147eef504b349518a1e78d89beb28df4a31
Parents: 857095d
Author: Gintas Grigelionis <gi...@apache.org>
Authored: Fri May 11 11:38:21 2018 +0200
Committer: Gintas Grigelionis <gi...@apache.org>
Committed: Fri May 11 11:38:21 2018 +0200
----------------------------------------------------------------------
.../org/apache/tools/ant/taskdefs/MacroDef.java | 2 +-
.../taskdefs/optional/junit/Enumerations.java | 177 +++++++++----------
.../org/apache/tools/ant/BuildFileRule.java | 2 +-
3 files changed, 89 insertions(+), 92 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ant/blob/1909e147/src/main/org/apache/tools/ant/taskdefs/MacroDef.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/MacroDef.java b/src/main/org/apache/tools/ant/taskdefs/MacroDef.java
index 95757b6..937cdd1 100644
--- a/src/main/org/apache/tools/ant/taskdefs/MacroDef.java
+++ b/src/main/org/apache/tools/ant/taskdefs/MacroDef.java
@@ -670,7 +670,7 @@ public class MacroDef extends AntlibDefinition {
*/
public boolean equals(Object obj) {
if (obj == this) {
- return true;
+ return true;
}
if (obj == null || !obj.getClass().equals(getClass())) {
return false;
http://git-wip-us.apache.org/repos/asf/ant/blob/1909e147/src/main/org/apache/tools/ant/taskdefs/optional/junit/Enumerations.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/junit/Enumerations.java b/src/main/org/apache/tools/ant/taskdefs/optional/junit/Enumerations.java
index 327547e..c6a014d 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/junit/Enumerations.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/junit/Enumerations.java
@@ -28,77 +28,76 @@ import java.util.NoSuchElementException;
*/
public final class Enumerations {
- private Enumerations() {
- }
+ private Enumerations() {
+ }
- /**
- * creates an enumeration from an array of objects.
- * @param array the array of object to enumerate.
- * @return the enumeration over the array of objects.
- */
- public static Enumeration fromArray(Object[] array) {
- return new ArrayEnumeration(array);
- }
+ /**
+ * creates an enumeration from an array of objects.
+ * @param array the array of object to enumerate.
+ * @return the enumeration over the array of objects.
+ */
+ public static Enumeration fromArray(Object[] array) {
+ return new ArrayEnumeration(array);
+ }
- /**
- * creates an enumeration from an array of enumeration. The created enumeration
- * will sequentially enumerate over all elements of each enumeration and skip
- * <tt>null</tt> enumeration elements in the array.
- * @param enums the array of enumerations.
- * @return the enumeration over the array of enumerations.
- */
- public static Enumeration fromCompound(Enumeration[] enums) {
- return new CompoundEnumeration(enums);
- }
+ /**
+ * creates an enumeration from an array of enumeration. The created enumeration
+ * will sequentially enumerate over all elements of each enumeration and skip
+ * <tt>null</tt> enumeration elements in the array.
+ * @param enums the array of enumerations.
+ * @return the enumeration over the array of enumerations.
+ */
+ public static Enumeration fromCompound(Enumeration[] enums) {
+ return new CompoundEnumeration(enums);
+ }
}
-
/**
* Convenient enumeration over an array of objects.
*/
class ArrayEnumeration implements Enumeration {
- /** object array */
- private Object[] array;
+ /** object array */
+ private Object[] array;
- /** current index */
- private int pos;
+ /** current index */
+ private int pos;
- /**
- * Initialize a new enumeration that wraps an array.
- * @param array the array of object to enumerate.
- */
- public ArrayEnumeration(Object[] array) {
- this.array = array;
- this.pos = 0;
- }
- /**
- * Tests if this enumeration contains more elements.
- *
- * @return <code>true</code> if and only if this enumeration object
- * contains at least one more element to provide;
- * <code>false</code> otherwise.
- */
- public boolean hasMoreElements() {
- return (pos < array.length);
- }
+ /**
+ * Initialize a new enumeration that wraps an array.
+ * @param array the array of object to enumerate.
+ */
+ public ArrayEnumeration(Object[] array) {
+ this.array = array;
+ this.pos = 0;
+ }
+ /**
+ * Tests if this enumeration contains more elements.
+ *
+ * @return <code>true</code> if and only if this enumeration object
+ * contains at least one more element to provide;
+ * <code>false</code> otherwise.
+ */
+ public boolean hasMoreElements() {
+ return (pos < array.length);
+ }
- /**
- * Returns the next element of this enumeration if this enumeration
- * object has at least one more element to provide.
- *
- * @return the next element of this enumeration.
- * @throws NoSuchElementException if no more elements exist.
- */
- public Object nextElement() throws NoSuchElementException {
- if (hasMoreElements()) {
- Object o = array[pos];
- pos++;
- return o;
- }
- throw new NoSuchElementException();
+ /**
+ * Returns the next element of this enumeration if this enumeration
+ * object has at least one more element to provide.
+ *
+ * @return the next element of this enumeration.
+ * @throws NoSuchElementException if no more elements exist.
+ */
+ public Object nextElement() throws NoSuchElementException {
+ if (hasMoreElements()) {
+ Object o = array[pos];
+ pos++;
+ return o;
}
+ throw new NoSuchElementException();
+ }
}
/**
* Convenient enumeration over an array of enumeration. For example:
@@ -130,48 +129,46 @@ class ArrayEnumeration implements Enumeration {
* }
* </pre>
*/
- class CompoundEnumeration implements Enumeration {
+class CompoundEnumeration implements Enumeration {
- /** enumeration array */
- private Enumeration[] enumArray;
+ /** enumeration array */
+ private Enumeration[] enumArray;
- /** index in the enums array */
- private int index = 0;
+ /** index in the enums array */
+ private int index = 0;
public CompoundEnumeration(Enumeration[] enumarray) {
- this.enumArray = enumarray;
+ this.enumArray = enumarray;
}
- /**
- * Tests if this enumeration contains more elements.
- *
- * @return <code>true</code> if and only if this enumeration object
- * contains at least one more element to provide;
- * <code>false</code> otherwise.
- */
+ /**
+ * Tests if this enumeration contains more elements.
+ *
+ * @return <code>true</code> if and only if this enumeration object
+ * contains at least one more element to provide;
+ * <code>false</code> otherwise.
+ */
public boolean hasMoreElements() {
- while (index < enumArray.length) {
- if (enumArray[index] != null && enumArray[index].hasMoreElements()) {
- return true;
- }
- index++;
- }
- return false;
+ while (index < enumArray.length) {
+ if (enumArray[index] != null && enumArray[index].hasMoreElements()) {
+ return true;
+ }
+ index++;
+ }
+ return false;
}
- /**
- * Returns the next element of this enumeration if this enumeration
- * object has at least one more element to provide.
- *
- * @return the next element of this enumeration.
- * @throws NoSuchElementException if no more elements exist.
- */
+ /**
+ * Returns the next element of this enumeration if this enumeration
+ * object has at least one more element to provide.
+ *
+ * @return the next element of this enumeration.
+ * @throws NoSuchElementException if no more elements exist.
+ */
public Object nextElement() throws NoSuchElementException {
- if (hasMoreElements()) {
- return enumArray[index].nextElement();
- }
- throw new NoSuchElementException();
+ if (hasMoreElements()) {
+ return enumArray[index].nextElement();
+ }
+ throw new NoSuchElementException();
}
}
-
-
http://git-wip-us.apache.org/repos/asf/ant/blob/1909e147/src/tests/junit/org/apache/tools/ant/BuildFileRule.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/BuildFileRule.java b/src/tests/junit/org/apache/tools/ant/BuildFileRule.java
index c5a71c7..a444109 100644
--- a/src/tests/junit/org/apache/tools/ant/BuildFileRule.java
+++ b/src/tests/junit/org/apache/tools/ant/BuildFileRule.java
@@ -170,7 +170,7 @@ public class BuildFileRule extends ExternalResource {
*
* @param targetName the target in the currently configured build file to run.
*/
- public void executeTarget(String targetName) {
+ public void executeTarget(String targetName) {
outputBuffer = new StringBuffer();
PrintStream out = new PrintStream(new AntOutputStream(outputBuffer));
errorBuffer = new StringBuffer();