Skip to content

Commit cb26ae5

Browse files
committed
removed deprecated methods
1 parent 6f59fa8 commit cb26ae5

4 files changed

Lines changed: 9 additions & 54 deletions

File tree

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

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -66,23 +66,6 @@ public static <T> Matcher<T> is(T value) {
6666
return is(equalTo(value));
6767
}
6868

69-
/**
70-
* A shortcut to the frequently used <code>is(instanceOf(SomeClass.class))</code>.
71-
* <p/>
72-
* For example:
73-
* <pre>assertThat(cheese, is(Cheddar.class))</pre>
74-
* instead of:
75-
* <pre>assertThat(cheese, is(instanceOf(Cheddar.class)))</pre>
76-
*
77-
* @deprecated use isA(Class<T> type) instead.
78-
*/
79-
@Factory
80-
@Deprecated
81-
public static <T> Matcher<T> is(Class<T> type) {
82-
final Matcher<T> typeMatcher = instanceOf(type);
83-
return is(typeMatcher);
84-
}
85-
8669
/**
8770
* A shortcut to the frequently used <code>is(instanceOf(SomeClass.class))</code>.
8871
* <p/>

‎hamcrest-library/src/main/java/org/hamcrest/collection/IsIterableContainingInAnyOrder.java‎

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
package org.hamcrest.collection;
22

3-
import org.hamcrest.Description;
4-
import org.hamcrest.Factory;
5-
import org.hamcrest.Matcher;
6-
import org.hamcrest.TypeSafeDiagnosingMatcher;
7-
83
import java.util.ArrayList;
94
import java.util.Arrays;
105
import java.util.Collection;
116
import java.util.List;
127

13-
import static java.util.Arrays.asList;
8+
import org.hamcrest.Description;
9+
import org.hamcrest.Factory;
10+
import org.hamcrest.Matcher;
11+
import org.hamcrest.TypeSafeDiagnosingMatcher;
12+
1413
import static org.hamcrest.core.IsEqual.equalTo;
1514

1615
public class IsIterableContainingInAnyOrder<T> extends TypeSafeDiagnosingMatcher<Iterable<? extends T>> {
@@ -80,28 +79,6 @@ private boolean isMatched(S item) {
8079
mismatchDescription.appendText("Not matched: ").appendValue(item);
8180
return false;
8281
}
83-
84-
}
85-
86-
/**
87-
* Creates a matcher for {@link Iterable}s that matches when a single pass over the
88-
* examined {@link Iterable} yields a single item that satisfies the specified matcher.
89-
* For a positive match, the examined iterable must only yield one item.
90-
* <p/>
91-
* For example:
92-
* <pre>assertThat(Arrays.asList("foo"), containsInAnyOrder(equalTo("foo")))</pre>
93-
*
94-
* @deprecated use contains(Matcher<? super E> itemMatcher) instead
95-
*
96-
* @param itemMatcher
97-
* the matcher that must be satisfied by the single item provided by an
98-
* examined {@link Iterable}
99-
*/
100-
@SuppressWarnings("unchecked")
101-
@Deprecated
102-
@Factory
103-
public static <E> Matcher<Iterable<? extends E>> containsInAnyOrder(final Matcher<? super E> itemMatcher) {
104-
return containsInAnyOrder(new ArrayList<Matcher<? super E>>(asList(itemMatcher)));
10582
}
10683

10784
/**

‎hamcrest-unit-test/src/main/java/org/hamcrest/collection/IsIterableContainingInAnyOrderTest.java‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,4 @@ public void testDoesNotMatchIfThereAreMoreMatchersThanElements() {
5151
public void testHasAReadableDescription() {
5252
assertDescription("iterable over [<1>, <2>] in any order", containsInAnyOrder(1, 2));
5353
}
54-
55-
public void testDoesNotMatchIfSingleItemMismatches() throws Exception {
56-
assertMismatchDescription("Not matched: <WithValue 3>", containsInAnyOrder(value(4)), asList(make(3)));
57-
}
58-
59-
6054
}

‎hamcrest-unit-test/src/main/java/org/hamcrest/core/IsTest.java‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import static org.hamcrest.core.IsEqual.equalTo;
44
import static org.hamcrest.core.Is.is;
5+
import static org.hamcrest.core.Is.isA;
56
import org.hamcrest.AbstractMatcherTest;
67
import org.hamcrest.Matcher;
78

@@ -32,8 +33,8 @@ public void testProvidesConvenientShortcutForIsEqualTo() {
3233
}
3334

3435
public void testProvidesConvenientShortcutForIsInstanceOf() {
35-
assertTrue("should match", is(String.class).matches("A"));
36-
assertFalse("should not match", is(Integer.class).matches(new Object()));
37-
assertFalse("should not match", is(Integer.class).matches(null));
36+
assertTrue("should match", isA(String.class).matches("A"));
37+
assertFalse("should not match", isA(Integer.class).matches(new Object()));
38+
assertFalse("should not match", isA(Integer.class).matches(null));
3839
}
3940
}

0 commit comments

Comments
 (0)