Skip to content

Commit

Permalink
fixing travis errors (java 8)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kajetan Fuchsberger authored and Kajetan Fuchsberger committed Mar 19, 2021
1 parent f257380 commit ada444b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
10 changes: 3 additions & 7 deletions src/java/org/tensorics/core/tensor/Positions.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,8 @@
import java.util.function.Function;
import java.util.stream.Collectors;

import org.mockito.internal.util.collections.Iterables;

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMultimap;
import com.google.common.collect.ImmutableSet;
Expand Down Expand Up @@ -389,12 +386,11 @@ public static Set<Position> cartesianProduct(Iterable<Set<?>> coordinateSets) {
public static <T> Set<Position> from(Collection<T> coordinates) {
return coordinates.stream().map(t -> Position.of(t)).collect(toSet());
}
public static <T> Set<Position> from(T ... coordinates) {

public static <T> Set<Position> from(T... coordinates) {
return from(ImmutableSet.copyOf(coordinates));
}



/**
* Returns a position which contains the coordinates which are contained in the left position but not in the right
* position. The right position might also contain coordinates not contained in the left position, which are simply
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,10 @@ public static <V, T extends Tensorbacked<V>> T create(Class<T> tensorbackedType,
}

public static <V, T extends Tensorbacked<V>> Optional<Class<T>> tensorbackedInterfaceFrom(T object) {
return invokationHandlerFrom(object).map(h -> h.intfc);
return invokationHandlerFrom(object).map(h -> (Class<T>) h.intfc);
}

private static <V, T extends Tensorbacked<V>> Optional<DelegatingInvocationHandler<V, T>> invokationHandlerFrom(
T object) {
private static Optional<DelegatingInvocationHandler<?, ?>> invokationHandlerFrom(Object object) {
if (!(object instanceof Proxy)) {
return Optional.empty();
}
Expand All @@ -46,7 +45,7 @@ private static <V, T extends Tensorbacked<V>> Optional<DelegatingInvocationHandl
return Optional.empty();
}

return Optional.of((DelegatingInvocationHandler<V, T>) handler);
return Optional.of((DelegatingInvocationHandler<?, ?>) handler);
}

private final static class DelegatingInvocationHandler<V, T extends Tensorbacked<V>> implements InvocationHandler {
Expand Down Expand Up @@ -100,7 +99,7 @@ public boolean equals(Object obj) {
if (!(obj instanceof Tensorbacked)) {
return false;
}
Optional<DelegatingInvocationHandler<?, ?>> otherIh = invokationHandlerFrom((Tensorbacked) obj);
Optional<DelegatingInvocationHandler<?, ?>> otherIh = invokationHandlerFrom(obj);
if (!otherIh.isPresent()) {
return false;
}
Expand Down

0 comments on commit ada444b

Please sign in to comment.