import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
-import com.google.common.collect.Maps;
import java.io.InputStream;
import java.util.Collections;
+import java.util.HashMap;
import java.util.Map;
import javax.annotation.Nonnull;
import org.opendaylight.yangtools.yang.common.QName;
* {@link AbstractDeviceTest#internalStorage} as asynchronized {@link Map}.
*/
public AbstractDeviceTest() {
- this.internalStorage = Collections.synchronizedMap(Maps.newHashMap());
+ this.internalStorage = Collections.synchronizedMap(new HashMap<>());
}
/**
*/
package org.opendaylight.transportpce.test;
+import static java.util.Objects.requireNonNull;
+
import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
import com.google.common.collect.Lists;
*
* @return the domDataBroker
*/
- public DOMDataBroker getDomDataBroker() {
+ public DOMDataBroker getDeviceDomDataBroker() {
return domDataBroker;
}
*/
public static DeviceWrapper createDeviceWrapper(@Nonnull String key, @Nonnull InputStream initialDataXmlInputStream,
@Nonnull QName intialDataQName) {
- Preconditions.checkNotNull(initialDataXmlInputStream, "Input stream cannot be null");
- Preconditions.checkNotNull(intialDataQName, "QName cannot be null");
+ requireNonNull(initialDataXmlInputStream, "Input stream cannot be null");
+ requireNonNull(intialDataQName, "QName cannot be null");
return createDeviceWrapper(key, Lists.newArrayList(
new AbstractMap.SimpleEntry<QName, InputStream>(intialDataQName, initialDataXmlInputStream)));
}
try {
writeOnlyTransaction.commit().get();
} catch (InterruptedException | ExecutionException e) {
- LOG.error("This should be not reached {}", e.getMessage(), e);
+ LOG.error("This should be not reached ", e);
throw new IllegalStateException(e);
}
}