Skip to content

Commit 9488681

Browse files
author
jon.m.reid
committed
Indentation: Use four spaces, not tabs.
1 parent b906d8a commit 9488681

84 files changed

Lines changed: 1865 additions & 1878 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎hamcrest-core/src/main/java/org/hamcrest/BaseDescription.java‎

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ public Description appendText(String text) {
1919
}
2020

2121
public Description appendDescriptionOf(SelfDescribing value) {
22-
value.describeTo(this);
23-
return this;
22+
value.describeTo(this);
23+
return this;
2424
}
2525

2626
public Description appendValue(Object value) {
@@ -45,7 +45,7 @@ public Description appendValue(Object value) {
4545
append(valueOf(value));
4646
append("F>");
4747
} else if (value.getClass().isArray()) {
48-
appendValueList("[",", ","]", new ArrayIterator(value));
48+
appendValueList("[",", ","]", new ArrayIterator(value));
4949
} else {
5050
append('<');
5151
append(valueOf(value));
@@ -56,16 +56,16 @@ public Description appendValue(Object value) {
5656

5757
public <T> Description appendValueList(String start, String separator, String end, T... values) {
5858
return appendValueList(start, separator, end, Arrays.asList(values));
59-
}
59+
}
60+
61+
public <T> Description appendValueList(String start, String separator, String end, Iterable<T> values) {
62+
return appendValueList(start, separator, end, values.iterator());
63+
}
64+
65+
private <T> Description appendValueList(String start, String separator, String end, Iterator<T> values) {
66+
return appendList(start, separator, end, new SelfDescribingValueIterator<T>(values));
67+
}
6068

61-
public <T> Description appendValueList(String start, String separator, String end, Iterable<T> values) {
62-
return appendValueList(start, separator, end, values.iterator());
63-
}
64-
65-
private <T> Description appendValueList(String start, String separator, String end, Iterator<T> values) {
66-
return appendList(start, separator, end, new SelfDescribingValueIterator<T>(values));
67-
}
68-
6969
public Description appendList(String start, String separator, String end, Iterable<? extends SelfDescribing> values) {
7070
return appendList(start, separator, end, values.iterator());
7171
}
@@ -90,9 +90,9 @@ private Description appendList(String start, String separator, String end, Itera
9090
* Override in subclasses to provide an efficient implementation.
9191
*/
9292
protected void append(String str) {
93-
for (int i = 0; i < str.length(); i++) {
94-
append(str.charAt(i));
95-
}
93+
for (int i = 0; i < str.length(); i++) {
94+
append(str.charAt(i));
95+
}
9696
}
9797

9898
/**

‎hamcrest-core/src/main/java/org/hamcrest/Description.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ public interface Description {
2727
* Appends a list of values to the description.
2828
*/
2929
<T> Description appendValueList(String start, String separator, String end,
30-
T... values);
30+
T... values);
3131

3232
/**
3333
* Appends a list of values to the description.
3434
*/
3535
<T> Description appendValueList(String start, String separator, String end,
36-
Iterable<T> values);
36+
Iterable<T> values);
3737

3838
/**
3939
* Appends a list of {@link org.hamcrest.SelfDescribing} objects

‎hamcrest-core/src/main/java/org/hamcrest/SelfDescribing.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ public interface SelfDescribing {
1212
* @param description
1313
* The description to be built or appended to.
1414
*/
15-
void describeTo(Description description);
15+
void describeTo(Description description);
1616
}

‎hamcrest-core/src/main/java/org/hamcrest/StringDescription.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public StringDescription(Appendable out) {
2525
* The description of the object.
2626
*/
2727
public static String toString(SelfDescribing selfDescribing) {
28-
return new StringDescription().appendDescriptionOf(selfDescribing).toString();
28+
return new StringDescription().appendDescriptionOf(selfDescribing).toString();
2929
}
3030

3131
/**

‎hamcrest-core/src/main/java/org/hamcrest/core/AllOf.java‎

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public static <T> Matcher<T> allOf(Iterable<Matcher<? super T>> matchers) {
3636
return new AllOf<T>(matchers);
3737
}
3838

39-
/**
39+
/**
4040
* Evaluates to true only if ALL of the passed in matchers evaluate to true.
4141
*/
4242
@Factory
@@ -49,9 +49,9 @@ public static <T> Matcher<T> allOf(Matcher<? super T>... matchers) {
4949
*/
5050
@Factory
5151
public static <T> Matcher<T> allOf(Matcher<T> first, Matcher<? super T> second) {
52-
List<Matcher<? super T>> matchers = new ArrayList<Matcher<? super T>>(2);
53-
matchers.add(first);
54-
matchers.add(second);
52+
List<Matcher<? super T>> matchers = new ArrayList<Matcher<? super T>>(2);
53+
matchers.add(first);
54+
matchers.add(second);
5555
return allOf(matchers);
5656
}
5757

@@ -60,10 +60,10 @@ public static <T> Matcher<T> allOf(Matcher<T> first, Matcher<? super T> second)
6060
*/
6161
@Factory
6262
public static <T> Matcher<T> allOf(Matcher<T> first, Matcher<? super T> second, Matcher<? super T> third) {
63-
List<Matcher<? super T>> matchers = new ArrayList<Matcher<? super T>>(3);
64-
matchers.add(first);
65-
matchers.add(second);
66-
matchers.add(third);
63+
List<Matcher<? super T>> matchers = new ArrayList<Matcher<? super T>>(3);
64+
matchers.add(first);
65+
matchers.add(second);
66+
matchers.add(third);
6767
return allOf(matchers);
6868
}
6969

@@ -72,11 +72,11 @@ public static <T> Matcher<T> allOf(Matcher<T> first, Matcher<? super T> second,
7272
*/
7373
@Factory
7474
public static <T> Matcher<T> allOf(Matcher<T> first, Matcher<? super T> second, Matcher<? super T> third, Matcher<? super T> fourth) {
75-
List<Matcher<? super T>> matchers = new ArrayList<Matcher<? super T>>(4);
76-
matchers.add(first);
77-
matchers.add(second);
78-
matchers.add(third);
79-
matchers.add(fourth);
75+
List<Matcher<? super T>> matchers = new ArrayList<Matcher<? super T>>(4);
76+
matchers.add(first);
77+
matchers.add(second);
78+
matchers.add(third);
79+
matchers.add(fourth);
8080
return allOf(matchers);
8181
}
8282

@@ -85,12 +85,12 @@ public static <T> Matcher<T> allOf(Matcher<T> first, Matcher<? super T> second,
8585
*/
8686
@Factory
8787
public static <T> Matcher<T> allOf(Matcher<T> first, Matcher<? super T> second, Matcher<? super T> third, Matcher<? super T> fourth, Matcher<? super T> fifth) {
88-
List<Matcher<? super T>> matchers = new ArrayList<Matcher<? super T>>(5);
89-
matchers.add(first);
90-
matchers.add(second);
91-
matchers.add(third);
92-
matchers.add(fourth);
93-
matchers.add(fifth);
88+
List<Matcher<? super T>> matchers = new ArrayList<Matcher<? super T>>(5);
89+
matchers.add(first);
90+
matchers.add(second);
91+
matchers.add(third);
92+
matchers.add(fourth);
93+
matchers.add(fifth);
9494
return allOf(matchers);
9595
}
9696

@@ -99,12 +99,12 @@ public static <T> Matcher<T> allOf(Matcher<T> first, Matcher<? super T> second,
9999
*/
100100
@Factory
101101
public static <T> Matcher<T> allOf(Matcher<T> first, Matcher<? super T> second, Matcher<? super T> third, Matcher<? super T> fourth, Matcher<? super T> fifth, Matcher<? super T> sixth) {
102-
List<Matcher<? super T>> matchers = new ArrayList<Matcher<? super T>>(6);
103-
matchers.add(first);
104-
matchers.add(second);
105-
matchers.add(third);
106-
matchers.add(fourth);
107-
matchers.add(sixth);
102+
List<Matcher<? super T>> matchers = new ArrayList<Matcher<? super T>>(6);
103+
matchers.add(first);
104+
matchers.add(second);
105+
matchers.add(third);
106+
matchers.add(fourth);
107+
matchers.add(sixth);
108108
return allOf(matchers);
109109
}
110110
}

‎hamcrest-core/src/main/java/org/hamcrest/core/AnyOf.java‎

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public static <T> Matcher<T> anyOf(Iterable<Matcher<? super T>> matchers) {
3636
return new AnyOf<T>(matchers);
3737
}
3838

39-
/**
39+
/**
4040
* Evaluates to true if ANY of the passed in matchers evaluate to true.
4141
*/
4242
@Factory
@@ -49,9 +49,9 @@ public static <T> Matcher<T> anyOf(Matcher<? super T>... matchers) {
4949
*/
5050
@Factory
5151
public static <T> Matcher<T> anyOf(Matcher<T> first, Matcher<? super T> second) {
52-
List<Matcher<? super T>> matchers = new ArrayList<Matcher<? super T>>();
53-
matchers.add(first);
54-
matchers.add(second);
52+
List<Matcher<? super T>> matchers = new ArrayList<Matcher<? super T>>();
53+
matchers.add(first);
54+
matchers.add(second);
5555
return anyOf(matchers);
5656
}
5757

@@ -60,10 +60,10 @@ public static <T> Matcher<T> anyOf(Matcher<T> first, Matcher<? super T> second)
6060
*/
6161
@Factory
6262
public static <T> Matcher<T> anyOf(Matcher<T> first, Matcher<? super T> second, Matcher<? super T> third) {
63-
List<Matcher<? super T>> matchers = new ArrayList<Matcher<? super T>>();
64-
matchers.add(first);
65-
matchers.add(second);
66-
matchers.add(third);
63+
List<Matcher<? super T>> matchers = new ArrayList<Matcher<? super T>>();
64+
matchers.add(first);
65+
matchers.add(second);
66+
matchers.add(third);
6767
return anyOf(matchers);
6868
}
6969

@@ -72,25 +72,25 @@ public static <T> Matcher<T> anyOf(Matcher<T> first, Matcher<? super T> second,
7272
*/
7373
@Factory
7474
public static <T> Matcher<T> anyOf(Matcher<T> first, Matcher<? super T> second, Matcher<? super T> third, Matcher<? super T> fourth) {
75-
List<Matcher<? super T>> matchers = new ArrayList<Matcher<? super T>>();
76-
matchers.add(first);
77-
matchers.add(second);
78-
matchers.add(third);
79-
matchers.add(fourth);
80-
return anyOf(matchers);
75+
List<Matcher<? super T>> matchers = new ArrayList<Matcher<? super T>>();
76+
matchers.add(first);
77+
matchers.add(second);
78+
matchers.add(third);
79+
matchers.add(fourth);
80+
return anyOf(matchers);
8181
}
8282

8383
/**
8484
* Evaluates to true if ANY of the passed in matchers evaluate to true.
8585
*/
8686
@Factory
8787
public static <T> Matcher<T> anyOf(Matcher<T> first, Matcher<? super T> second, Matcher<? super T> third, Matcher<? super T> fourth, Matcher<? super T> fifth) {
88-
List<Matcher<? super T>> matchers = new ArrayList<Matcher<? super T>>();
89-
matchers.add(first);
90-
matchers.add(second);
91-
matchers.add(third);
92-
matchers.add(fourth);
93-
matchers.add(fifth);
88+
List<Matcher<? super T>> matchers = new ArrayList<Matcher<? super T>>();
89+
matchers.add(first);
90+
matchers.add(second);
91+
matchers.add(third);
92+
matchers.add(fourth);
93+
matchers.add(fifth);
9494
return anyOf(matchers);
9595
}
9696

@@ -99,13 +99,13 @@ public static <T> Matcher<T> anyOf(Matcher<T> first, Matcher<? super T> second,
9999
*/
100100
@Factory
101101
public static <T> Matcher<T> anyOf(Matcher<T> first, Matcher<? super T> second, Matcher<? super T> third, Matcher<? super T> fourth, Matcher<? super T> fifth, Matcher<? super T> sixth) {
102-
List<Matcher<? super T>> matchers = new ArrayList<Matcher<? super T>>();
103-
matchers.add(first);
104-
matchers.add(second);
105-
matchers.add(third);
106-
matchers.add(fourth);
107-
matchers.add(fifth);
108-
matchers.add(sixth);
102+
List<Matcher<? super T>> matchers = new ArrayList<Matcher<? super T>>();
103+
matchers.add(first);
104+
matchers.add(second);
105+
matchers.add(third);
106+
matchers.add(fourth);
107+
matchers.add(fifth);
108+
matchers.add(sixth);
109109
return anyOf(matchers);
110110
}
111111
}

‎hamcrest-core/src/main/java/org/hamcrest/core/IsEqual.java‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public void describeTo(Description description) {
2929
description.appendValue(object);
3030
}
3131

32-
private static boolean areEqual(Object o1, Object o2) {
32+
private static boolean areEqual(Object o1, Object o2) {
3333
if (o1 == null) {
3434
return o2 == null;
3535
} else if (isArray(o1)) {
@@ -67,5 +67,4 @@ private static boolean isArray(Object o) {
6767
public static <T> Matcher<T> equalTo(T operand) {
6868
return new IsEqual<T>(operand);
6969
}
70-
7170
}

‎hamcrest-core/src/main/java/org/hamcrest/core/IsInstanceOf.java‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,11 @@ public void describeTo(Description description) {
3333
.appendText(theClass.getName());
3434
}
3535

36-
/**
36+
/**
3737
* Is the value an instance of a particular type?
3838
*/
3939
@Factory
4040
public static Matcher<Object> instanceOf(Class<?> type) {
4141
return new IsInstanceOf(type);
4242
}
43-
4443
}

‎hamcrest-core/src/main/java/org/hamcrest/core/IsSame.java‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public void describeTo(Description description) {
2828
.appendText(")");
2929
}
3030

31-
/**
31+
/**
3232
* Creates a new instance of IsSame
3333
*
3434
* @param object The predicate evaluates to true only when the argument is
@@ -38,5 +38,4 @@ public void describeTo(Description description) {
3838
public static <T> Matcher<T> sameInstance(T object) {
3939
return new IsSame<T>(object);
4040
}
41-
4241
}

‎hamcrest-core/src/main/java/org/hamcrest/internal/ArrayIterator.java‎

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,25 @@
44
import java.util.Iterator;
55

66
public class ArrayIterator implements Iterator<Object> {
7-
private final Object array;
8-
private int currentIndex = 0;
9-
10-
public ArrayIterator(Object array) {
11-
if (!array.getClass().isArray()) {
12-
throw new IllegalArgumentException("not an array");
13-
}
14-
this.array = array;
15-
}
16-
17-
public boolean hasNext() {
18-
return currentIndex < Array.getLength(array);
19-
}
7+
private final Object array;
8+
private int currentIndex = 0;
9+
10+
public ArrayIterator(Object array) {
11+
if (!array.getClass().isArray()) {
12+
throw new IllegalArgumentException("not an array");
13+
}
14+
this.array = array;
15+
}
16+
17+
public boolean hasNext() {
18+
return currentIndex < Array.getLength(array);
19+
}
2020

21-
public Object next() {
22-
return Array.get(array, currentIndex++);
23-
}
24-
25-
public void remove() {
26-
throw new UnsupportedOperationException("cannot remove items from an array");
27-
}
21+
public Object next() {
22+
return Array.get(array, currentIndex++);
23+
}
24+
25+
public void remove() {
26+
throw new UnsupportedOperationException("cannot remove items from an array");
27+
}
2828
}

0 commit comments

Comments
 (0)