Skip to content

Commit

Permalink
deleted dead common code
Browse files Browse the repository at this point in the history
  • Loading branch information
maciejmikosik committed Feb 21, 2018
1 parent e286d6e commit af7e1b3
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 321 deletions.
20 changes: 3 additions & 17 deletions main/java/org/testory/common/Classes.java
@@ -1,6 +1,6 @@
package org.testory.common;

import static java.util.Arrays.asList;
import static java.util.Collections.unmodifiableMap;
import static java.util.Objects.requireNonNull;
import static org.testory.common.Checks.checkArgument;

Expand All @@ -9,7 +9,6 @@
import java.lang.reflect.Modifier;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

Expand All @@ -24,19 +23,6 @@ public Void run() {
});
}

public static boolean hasMethod(String name, Class<?>[] parameters, Class<?> type) {
requireNonNull(name);
requireNonNull(parameters);
checkArgument(!asList(parameters).contains(null));
requireNonNull(type);
try {
type.getMethod(name, parameters);
return true;
} catch (NoSuchMethodException e) {
return false;
}
}

public static boolean canAssign(@Nullable Object instance, Class<?> type) {
requireNonNull(type);
return type.isPrimitive()
Expand Down Expand Up @@ -130,7 +116,7 @@ private static Map<Class<?>, Object> defaultValues() {
map.put(long.class, 0L);
map.put(float.class, 0f);
map.put(double.class, 0.0);
return Collections.unmodifiableMap(map);
return unmodifiableMap(map);
}

public static Class<?> tryWrap(Class<?> type) {
Expand All @@ -153,6 +139,6 @@ private static Map<Class<?>, Class<?>> wrapping() {
map.put(long.class, Long.class);
map.put(float.class, Float.class);
map.put(double.class, Double.class);
return Collections.unmodifiableMap(map);
return unmodifiableMap(map);
}
}
14 changes: 0 additions & 14 deletions main/java/org/testory/common/Closeables.java

This file was deleted.

6 changes: 0 additions & 6 deletions main/java/org/testory/common/Collections.java
Expand Up @@ -27,10 +27,4 @@ public static <E> List<E> immutable(List<? extends E> list) {
public static <E> Set<E> immutable(Set<? extends E> set) {
return java.util.Collections.unmodifiableSet(new HashSet<>(set));
}

public static <T> List<T> reverse(List<T> list) {
ArrayList<T> result = new ArrayList<>(list);
java.util.Collections.reverse(result);
return result;
}
}
28 changes: 0 additions & 28 deletions main/java/org/testory/common/Strings.java

This file was deleted.

86 changes: 0 additions & 86 deletions test/java/org/testory/common/TestClassesHasMethod.java

This file was deleted.

54 changes: 0 additions & 54 deletions test/java/org/testory/common/TestCloseables.java

This file was deleted.

60 changes: 0 additions & 60 deletions test/java/org/testory/common/TestCollectionsReverse.java

This file was deleted.

56 changes: 0 additions & 56 deletions test/java/org/testory/common/TestStringsJoin.java

This file was deleted.

0 comments on commit af7e1b3

Please sign in to comment.