Java 8 provides and enquivalent, migrate to it.
Change-Id: I93e23cd7548e2135aae9ea20a2734347282901d4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
import com.google.common.annotations.Beta;
import com.google.common.base.Preconditions;
-import com.google.common.base.Supplier;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
* lock held, hence any code generation will end up being blocked on the
* javassist lock.
*/
- final String body = ClassLoaderUtils.withClassLoader(type.getClassLoader(),
- (Supplier<String>) () -> source.getSerializerBody().toString());
+ final String body = ClassLoaderUtils.getWithClassLoader(type.getClassLoader(),
+ source.getSerializerBody()::toString);
try {
product = javassist.instantiatePrototype(TreeNodeSerializerPrototype.class.getName(), serializerName,
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.mdsal.binding.javav2.dom.codec.impl.context.base;
import com.google.common.annotations.Beta;
-import com.google.common.base.Supplier;
+import java.util.function.Supplier;
import javax.annotation.Nonnull;
/**
import com.google.common.base.Joiner;
import com.google.common.base.Preconditions;
-import com.google.common.base.Supplier;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.locks.Lock;
+import java.util.function.Supplier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.mdsal.common.api;
-import com.google.common.base.Supplier;
-
+import java.util.function.Supplier;
import org.opendaylight.yangtools.yang.common.RpcError;
import org.opendaylight.yangtools.yang.common.RpcError.ErrorType;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
-
-
-
/**
* A type of TransactionCommitFailedException that indicates a situation that would result in a
* threading deadlock. This can occur if a caller that submits a write transaction tries to perform
*/
package org.opendaylight.mdsal.dom.spi.store;
-import com.google.common.base.Supplier;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Multimap;
import com.google.common.collect.Multimaps;
implements DOMStoreTreeChangePublisher {
private static final Logger LOG = LoggerFactory.getLogger(AbstractDOMStoreTreeChangePublisher.class);
- private static final Supplier<List<DataTreeCandidate>> LIST_SUPPLIER = ArrayList::new;
-
/**
* Callback for subclass to notify a specified registration of a list of candidates. This method is guaranteed
* to be only called from within {@link #processCandidateTree(DataTreeCandidate)}.
= takeSnapshot()) {
final List<PathArgument> toLookup = ImmutableList.copyOf(candidate.getRootPath().getPathArguments());
final Multimap<AbstractDOMDataTreeChangeListenerRegistration<?>, DataTreeCandidate> listenerChanges =
- Multimaps.newListMultimap(new IdentityHashMap<>(), LIST_SUPPLIER);
+ Multimaps.newListMultimap(new IdentityHashMap<>(), ArrayList::new);
lookupAndNotify(toLookup, 0, snapshot.getRootNode(), candidate, listenerChanges);
for (Map.Entry<AbstractDOMDataTreeChangeListenerRegistration<?>, Collection<DataTreeCandidate>> entry: