Skip to content

Commit

Permalink
fix TraversalStrategyProxy() compile error on java 11 (#1982)
Browse files Browse the repository at this point in the history
compile error on java 11:
  Cannot infer type arguments for new TraversalStrategyProxy<>(strategy)

Change-Id: I6a31cb24d4f37cc6af9ae9769a986593301ea1ff
  • Loading branch information
javeme authored Oct 27, 2022
1 parent 0781024 commit 1fbd5ff
Showing 1 changed file with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1659,16 +1659,14 @@ public Iterator<TraversalStrategy<?>> iterator() {
return Collections.emptyIterator();

}
return new MapperIterator<TraversalStrategy<?>,
TraversalStrategy<?>>(
return new MapperIterator<TraversalStrategy<?>, TraversalStrategy<?>>(
this.strategies.iterator(), (strategy) -> {
return new TraversalStrategyProxy<>(strategy);
});
}

@Override
public TraversalStrategies addStrategies(TraversalStrategy<?>...
strategies) {
public TraversalStrategies addStrategies(TraversalStrategy<?>... strategies) {
return this.strategies.addStrategies(strategies);
}

Expand Down Expand Up @@ -1709,8 +1707,10 @@ private final class TraversalStrategyProxy<T extends TraversalStrategy<?>>

private final TraversalStrategy<T> origin;

public TraversalStrategyProxy(TraversalStrategy<T> origin) {
this.origin = origin;
public TraversalStrategyProxy(TraversalStrategy<?> origin) {
@SuppressWarnings({ "rawtypes", "unchecked" })
TraversalStrategy<T> strategy = (TraversalStrategy) origin;
this.origin = strategy;
}

@Override
Expand Down Expand Up @@ -1768,8 +1768,8 @@ public Configuration getConfiguration() {

@Override
public int compareTo(@SuppressWarnings("rawtypes")
Class<? extends TraversalStrategy> otherCategory) {
return this.origin.compareTo(otherCategory);
Class<? extends TraversalStrategy> other) {
return this.origin.compareTo(other);
}

@Override
Expand All @@ -1788,8 +1788,7 @@ public String toString() {
}
}

private static final ThreadLocal<Context> CONTEXTS =
new InheritableThreadLocal<>();
private static final ThreadLocal<Context> CONTEXTS = new InheritableThreadLocal<>();

protected static final Context setContext(Context context) {
Context old = CONTEXTS.get();
Expand Down

0 comments on commit 1fbd5ff

Please sign in to comment.