Skip to content

Commit

Permalink
Java Code Style <format,whitespace>
Browse files Browse the repository at this point in the history
  • Loading branch information
nhojpatrick committed Feb 13, 2022
1 parent d298634 commit 5d2da07
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
*/
public class HasPropertyWithValue<T> extends TypeSafeDiagnosingMatcher<T> {

private static final Condition.Step<PropertyDescriptor,Method> WITH_READ_METHOD = withReadMethod();
private static final Condition.Step<PropertyDescriptor, Method> WITH_READ_METHOD = withReadMethod();
private final String propertyName;
private final Matcher<Object> valueMatcher;
private final String messageFormat;
Expand Down Expand Up @@ -136,7 +136,7 @@ private static Matcher<Object> nastyGenericsWorkaround(Matcher<?> valueMatcher)
return (Matcher<Object>) valueMatcher;
}

private static Condition.Step<PropertyDescriptor,Method> withReadMethod() {
private static Condition.Step<PropertyDescriptor, Method> withReadMethod() {
return new Condition.Step<PropertyDescriptor, java.lang.reflect.Method>() {
@Override
public Condition<Method> apply(PropertyDescriptor property, Description mismatch) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import static org.hamcrest.core.IsAnything.anything;
import static org.hamcrest.core.IsEqual.equalTo;

public class IsMapContaining<K,V> extends TypeSafeMatcher<Map<? extends K, ? extends V>> {
public class IsMapContaining<K, V> extends TypeSafeMatcher<Map<? extends K, ? extends V>> {

private final Matcher<? super K> keyMatcher;
private final Matcher<? super V> valueMatcher;
Expand Down Expand Up @@ -61,7 +61,7 @@ public void describeTo(Description description) {
* the value matcher that, in combination with the keyMatcher, must be satisfied by at least one entry
* @return The matcher.
*/
public static <K,V> Matcher<Map<? extends K,? extends V>> hasEntry(Matcher<? super K> keyMatcher, Matcher<? super V> valueMatcher) {
public static <K, V> Matcher<Map<? extends K, ? extends V>> hasEntry(Matcher<? super K> keyMatcher, Matcher<? super V> valueMatcher) {
return new IsMapContaining<>(keyMatcher, valueMatcher);
}

Expand All @@ -82,7 +82,7 @@ public static <K,V> Matcher<Map<? extends K,? extends V>> hasEntry(Matcher<? sup
* the value that, in combination with the key, must be describe at least one entry
* @return The matcher.
*/
public static <K,V> Matcher<Map<? extends K,? extends V>> hasEntry(K key, V value) {
public static <K, V> Matcher<Map<? extends K, ? extends V>> hasEntry(K key, V value) {
return new IsMapContaining<>(equalTo(key), equalTo(value));
}

Expand Down
2 changes: 1 addition & 1 deletion hamcrest/src/main/java/org/hamcrest/xml/HasXPath.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class HasXPath extends TypeSafeDiagnosingMatcher<Node> {

public static final NamespaceContext NO_NAMESPACE_CONTEXT = null;
private static final IsAnything<String> WITH_ANY_CONTENT = new IsAnything<String>("");
private static final Condition.Step<Object,String> NODE_EXISTS = nodeExists();
private static final Condition.Step<Object, String> NODE_EXISTS = nodeExists();
private final Matcher<String> valueMatcher;
private final XPathExpression compiledXPath;
private final String xpathString;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ protected Matcher<?> createMatcher() {
}

public void testMatchesSingletonMapContainingKey() {
Map<String,Integer> map = new HashMap<String, Integer>();
Map<String, Integer> map = new HashMap<String, Integer>();
map.put("a", 1);

assertMatches("Matches single key", hasKey("a"), map);
}

public void testMatchesMapContainingKey() {
Map<String,Integer> map = new HashMap<String, Integer>();
Map<String, Integer> map = new HashMap<String, Integer>();
map.put("a", 1);
map.put("b", 2);
map.put("c", 3);
Expand Down Expand Up @@ -69,11 +69,11 @@ public void testHasReadableDescription() {
}

public void testDoesNotMatchEmptyMap() {
assertMismatchDescription("map was []", hasKey("Foo"), new HashMap<String,Integer>());
assertMismatchDescription("map was []", hasKey("Foo"), new HashMap<String, Integer>());
}

public void testDoesNotMatchMapMissingKey() {
Map<String,Integer> map = new TreeMap<String, Integer>();
Map<String, Integer> map = new TreeMap<String, Integer>();
map.put("a", 1);
map.put("b", 2);
map.put("c", 3);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ protected Matcher<?> createMatcher() {
}

public void testMatchesMapContainingMatchingKeyAndValue() {
Map<String,Integer> map = new TreeMap<>();
Map<String, Integer> map = new TreeMap<>();
map.put("a", 1);
map.put("b", 2);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ public void testHasReadableDescription() {
}

public void testDoesNotMatchEmptyMap() {
Map<String,Integer> map = new HashMap<String,Integer>();
Map<String, Integer> map = new HashMap<String, Integer>();
assertMismatchDescription("map was []", hasValue(1), map);
}

public void testMatchesSingletonMapContainingValue() {
Map<String,Integer> map = new HashMap<String,Integer>();
Map<String, Integer> map = new HashMap<String, Integer>();
map.put("a", 1);

assertMatches("Singleton map", hasValue(1), map);
}

public void testMatchesMapContainingValue() {
Map<String,Integer> map = new TreeMap<String,Integer>();
Map<String, Integer> map = new TreeMap<String, Integer>();
map.put("a", 1);
map.put("b", 2);
map.put("c", 3);
Expand Down

0 comments on commit 5d2da07

Please sign in to comment.