Adopt odlparent-10, addressing a few issues flushed out.
Change-Id: I1b9f2500548ab6193e660cbef04ccaf9a0649679
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
65 files changed:
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<modelVersion>4.0.0</modelVersion>
<relativePath/>
</parent>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bnd-parent</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bnd-parent</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.Optional;
import java.util.function.BiFunction;
import org.eclipse.jdt.annotation.NonNull;
import java.util.Optional;
import java.util.function.BiFunction;
import org.eclipse.jdt.annotation.NonNull;
private final LoadingCache<EffectiveModelContext, JSONCodecFactory> precomputed;
// Weak keys to retire the entry when SchemaContext goes away and to force identity-based lookup
private final LoadingCache<EffectiveModelContext, JSONCodecFactory> precomputed;
// Weak keys to retire the entry when SchemaContext goes away and to force identity-based lookup
- private final LoadingCache<EffectiveModelContext, JSONCodecFactory> shared;
-
- JSONCodecFactorySupplier() {
- precomputed = CacheBuilder.newBuilder().weakKeys().build(new EagerCacheLoader(this::createFactory));
- shared = CacheBuilder.newBuilder().weakKeys().build(new CacheLoader<EffectiveModelContext, JSONCodecFactory>() {
+ private final LoadingCache<EffectiveModelContext, JSONCodecFactory> shared = CacheBuilder.newBuilder()
+ .weakKeys().build(new CacheLoader<EffectiveModelContext, JSONCodecFactory>() {
@Override
public JSONCodecFactory load(final EffectiveModelContext key) {
return createFactory(key, new SharedCodecCache<>());
}
});
@Override
public JSONCodecFactory load(final EffectiveModelContext key) {
return createFactory(key, new SharedCodecCache<>());
}
});
+
+ @SuppressFBWarnings(value = "MC_OVERRIDABLE_METHOD_CALL_IN_CONSTRUCTOR",
+ justification = "https://github.com/spotbugs/spotbugs/issues/1867")
+ JSONCodecFactorySupplier() {
+ precomputed = CacheBuilder.newBuilder().weakKeys().build(new EagerCacheLoader(this::createFactory));
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
package org.opendaylight.yangtools.util;
import static com.google.common.base.Preconditions.checkArgument;
package org.opendaylight.yangtools.util;
import static com.google.common.base.Preconditions.checkArgument;
+import static com.google.common.base.Verify.verifyNotNull;
import static java.util.Objects.requireNonNull;
import com.google.common.annotations.Beta;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.UnmodifiableIterator;
import static java.util.Objects.requireNonNull;
import com.google.common.annotations.Beta;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.UnmodifiableIterator;
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
}
final ImmutableMap<K, Integer> offsets = OffsetMapCache.orderedOffsets(map.keySet());
}
final ImmutableMap<K, Integer> offsets = OffsetMapCache.orderedOffsets(map.keySet());
- @SuppressWarnings("unchecked")
- final V[] array = (V[]) new Object[offsets.size()];
- for (Entry<K, V> e : map.entrySet()) {
- array[offsets.get(e.getKey())] = e.getValue();
- }
-
- return new Ordered<>(offsets, array);
+ return new Ordered<>(offsets, createArray(offsets, map));
}
final ImmutableMap<K, Integer> offsets = OffsetMapCache.unorderedOffsets(map.keySet());
}
final ImmutableMap<K, Integer> offsets = OffsetMapCache.unorderedOffsets(map.keySet());
+ return new Unordered<>(offsets, createArray(offsets, map));
+ }
+
+ private static <K, V> V[] createArray(final ImmutableMap<K, Integer> offsets, final Map<K, V> map) {
@SuppressWarnings("unchecked")
final V[] array = (V[]) new Object[offsets.size()];
for (Entry<K, V> e : map.entrySet()) {
@SuppressWarnings("unchecked")
final V[] array = (V[]) new Object[offsets.size()];
for (Entry<K, V> e : map.entrySet()) {
- array[offsets.get(e.getKey())] = e.getValue();
+ array[verifyNotNull(offsets.get(e.getKey()))] = e.getValue();
-
- return new Unordered<>(offsets, array);
}
private static <K, V> @Nullable Map<K, V> commonCopy(final @NonNull Map<K, V> map) {
}
private static <K, V> @Nullable Map<K, V> commonCopy(final @NonNull Map<K, V> map) {
- @SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD",
- justification = "https://github.com/spotbugs/spotbugs/issues/811")
private static void setField(final @NonNull ImmutableOffsetMap<?, ?> map, final @NonNull Field field,
final Object value) throws IOException {
try {
private static void setField(final @NonNull ImmutableOffsetMap<?, ?> map, final @NonNull Field field,
final Object value) throws IOException {
try {
import com.google.common.base.MoreObjects;
import com.google.common.collect.ImmutableMap;
import com.google.common.base.MoreObjects;
import com.google.common.collect.ImmutableMap;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.Arrays;
import java.util.Collection;
import java.util.Map;
import java.util.Arrays;
import java.util.Collection;
import java.util.Map;
final V[] objects = (V[]) new Object[size];
for (Entry<K, T> entry : fromMap.entrySet()) {
final K key = requireNonNull(entry.getKey());
final V[] objects = (V[]) new Object[size];
for (Entry<K, T> entry : fromMap.entrySet()) {
final K key = requireNonNull(entry.getKey());
- final Integer offset = offsets.get(key);
- checkArgument(offset != null, "Key %s present in input, but not in offsets %s", key, offsets);
-
- objects[offset.intValue()] = transformValue(key, entry.getValue(), valueTransformer);
+ objects[offsetOf(key)] = transformValue(key, entry.getValue(), valueTransformer);
}
return createMap(offsets, objects);
}
}
return createMap(offsets, objects);
}
+ @SuppressFBWarnings(value = "NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE",
+ justification = "SpotBugs does not grok checkArgument()")
+ private int offsetOf(final K key) {
+ final Integer offset = offsets.get(key);
+ checkArgument(offset != null, "Key %s present in input, but not in offsets %s", key, offsets);
+ return offset;
+ }
+
@Override
@SafeVarargs
public final <V> @NonNull ImmutableOffsetMap<K, V> instantiateWithValues(final V... values) {
@Override
@SafeVarargs
public final <V> @NonNull ImmutableOffsetMap<K, V> instantiateWithValues(final V... values) {
package org.opendaylight.yangtools.util;
import static com.google.common.base.Preconditions.checkState;
package org.opendaylight.yangtools.util;
import static com.google.common.base.Preconditions.checkState;
+import static com.google.common.base.Verify.verifyNotNull;
import static java.util.Objects.requireNonNull;
import com.google.common.annotations.Beta;
import static java.util.Objects.requireNonNull;
import com.google.common.annotations.Beta;
this(offsets, new Object[offsets.size()]);
for (Entry<K, V> e : source.entrySet()) {
this(offsets, new Object[offsets.size()]);
for (Entry<K, V> e : source.entrySet()) {
- objects[offsets.get(e.getKey())] = requireNonNull(e.getValue());
+ objects[verifyNotNull(offsets.get(e.getKey()))] = requireNonNull(e.getValue());
}
this.needClone = false;
}
this.needClone = false;
import com.google.common.annotations.Beta;
import com.google.common.collect.Iterators;
import com.google.common.annotations.Beta;
import com.google.common.collect.Iterators;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.Serializable;
import java.util.Collection;
import java.util.Iterator;
import java.io.Serializable;
import java.util.Collection;
import java.util.Iterator;
return s.size() == 1 && otherContains(s);
}
return s.size() == 1 && otherContains(s);
}
+ @SuppressFBWarnings(value = "DCN_NULLPOINTER_EXCEPTION",
+ justification = "https://github.com/spotbugs/spotbugs/issues/1954")
private boolean otherContains(final @NonNull Collection<?> other) {
try {
return other.contains(getElement());
private boolean otherContains(final @NonNull Collection<?> other) {
try {
return other.contains(getElement());
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
// Annotations
requires static transitive org.eclipse.jdt.annotation;
// Annotations
requires static transitive org.eclipse.jdt.annotation;
+ requires static com.github.spotbugs.annotations;
import static java.util.Objects.requireNonNull;
import com.google.common.annotations.Beta;
import static java.util.Objects.requireNonNull;
import com.google.common.annotations.Beta;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.IOException;
import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.yangtools.rfc8528.data.api.MountPointNode;
import java.io.IOException;
import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.yangtools.rfc8528.data.api.MountPointNode;
return new Filtering(writer);
}
return new Filtering(writer);
}
+ @SuppressFBWarnings(value = "NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE",
+ justification = "SpotBugs does not grok checkArgument()")
public static @NonNull MountPointNormalizedNodeWriter forwardingFor(final NormalizedNodeStreamWriter writer) {
final StreamWriterMountPointExtension mountWriter = writer.getExtensions()
.getInstance(StreamWriterMountPointExtension.class);
public static @NonNull MountPointNormalizedNodeWriter forwardingFor(final NormalizedNodeStreamWriter writer) {
final StreamWriterMountPointExtension mountWriter = writer.getExtensions()
.getInstance(StreamWriterMountPointExtension.class);
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.common.collect.Sets;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.common.collect.Sets;
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.Serializable;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.VarHandle;
import java.io.Serializable;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.VarHandle;
- @SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD",
- justification = "https://github.com/spotbugs/spotbugs/issues/811")
private static int hashCode(final Object value) {
if (value == null) {
return 0;
private static int hashCode(final Object value) {
if (value == null) {
return 0;
package org.opendaylight.yangtools.yang.data.impl.schema.builder.impl;
import com.google.common.collect.Iterables;
package org.opendaylight.yangtools.yang.data.impl.schema.builder.impl;
import com.google.common.collect.Iterables;
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedHashMap;
return children.equals(((ImmutableUserLeafSetNode<?>) other).children);
}
return children.equals(((ImmutableUserLeafSetNode<?>) other).children);
}
- @SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD",
- justification = "https://github.com/spotbugs/spotbugs/issues/811")
private Map<NodeWithValue, LeafSetEntryNode<T>> getChildren() {
return Collections.unmodifiableMap(children);
}
private Map<NodeWithValue, LeafSetEntryNode<T>> getChildren() {
return Collections.unmodifiableMap(children);
}
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Maps;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Maps;
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
* @param path Path to encode
* @return Encoded path.
*/
* @param path Path to encode
* @return Encoded path.
*/
- @SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD",
- justification = "https://github.com/spotbugs/spotbugs/issues/811")
private static Object encodePath(final List<NodeIdentifier> path) {
return path.size() == 1 ? path.get(0) : ImmutableList.copyOf(path);
}
private static Object encodePath(final List<NodeIdentifier> path) {
return path.size() == 1 ? path.get(0) : ImmutableList.copyOf(path);
}
: (ImmutableList<NodeIdentifier>) obj;
}
: (ImmutableList<NodeIdentifier>) obj;
}
- @SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD",
- justification = "https://github.com/spotbugs/spotbugs/issues/811")
private static @NonNull Descendant decodeDescendant(final Object obj) {
return Descendant.of(Collections2.transform(decodePath(obj), NodeIdentifier::getNodeType));
}
private static @NonNull Descendant decodeDescendant(final Object obj) {
return Descendant.of(Collections2.transform(decodePath(obj), NodeIdentifier::getNodeType));
}
* @param path Descendant path
* @return Value for the descendant
*/
* @param path Descendant path
* @return Value for the descendant
*/
- @SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD",
- justification = "https://github.com/spotbugs/spotbugs/issues/811")
private static @Nullable Object extractValue(final Map<List<NodeIdentifier>, Object> valueCache,
final DataContainerNode data, final List<NodeIdentifier> path) {
return valueCache.computeIfAbsent(path, key -> extractValue(data, key));
private static @Nullable Object extractValue(final Map<List<NodeIdentifier>, Object> valueCache,
final DataContainerNode data, final List<NodeIdentifier> path) {
return valueCache.computeIfAbsent(path, key -> extractValue(data, key));
<link>https://commons.apache.org/proper/commons-lang/javadocs/api-3.10/</link>
<link>https://commons.apache.org/proper/commons-codec/apidocs/</link>
<link>https://commons.apache.org/proper/commons-lang/javadocs/api-3.10/</link>
<link>https://commons.apache.org/proper/commons-codec/apidocs/</link>
- <link>https://www.javadoc.io/doc/org.opendaylight.odlparent/odlparent-docs/9.0.13/</link>
+ <link>https://www.javadoc.io/doc/org.opendaylight.odlparent/odlparent-docs/10.0.0/</link>
</links>
<groups>
<group>
</links>
<groups>
<group>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>feature-repo-parent</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>feature-repo-parent</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>feature-repo-parent</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>feature-repo-parent</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="odl-yangtools-codec">
<feature name="odl-yangtools-codec">
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="odl-yangtools-codec">
<feature name="odl-yangtools-codec">
- <feature version="[9,10)">odl-gson</feature>
- <feature version="[9,10)">odl-stax2-api</feature>
+ <feature version="[10,11)">odl-gson</feature>
+ <feature version="[10,11)">odl-stax2-api</feature>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="odl-yangtools-data">
<feature name="odl-yangtools-data">
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="odl-yangtools-data">
<feature name="odl-yangtools-data">
- <feature version="[9,10)">odl-antlr4</feature>
+ <feature version="[10,11)">odl-antlr4</feature>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="odl-yangtools-netty">
<feature name="odl-yangtools-netty">
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="odl-yangtools-netty">
<feature name="odl-yangtools-netty">
- <feature version="[9,10)">odl-netty-4</feature>
+ <feature version="[10,11)">odl-netty-4</feature>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="odl-yangtools-parser">
<feature name="odl-yangtools-parser">
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="odl-yangtools-parser">
<feature name="odl-yangtools-parser">
- <feature version="[9,10)">odl-antlr4</feature>
+ <feature version="[10,11)">odl-antlr4</feature>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="odl-yangtools-util">
<feature name="odl-yangtools-util">
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="odl-yangtools-util">
<feature name="odl-yangtools-util">
- <feature version="[9,10)">odl-guava</feature>
+ <feature version="[10,11)">odl-guava</feature>
<feature version="[1,2)">pt-triemap</feature>
</feature>
</features>
<feature version="[1,2)">pt-triemap</feature>
</feature>
</features>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="odl-yangtools-xpath">
<feature name="odl-yangtools-xpath">
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="odl-yangtools-xpath">
<feature name="odl-yangtools-xpath">
- <feature version="[9,10)">odl-antlr4</feature>
+ <feature version="[10,11)">odl-antlr4</feature>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>karaf4-parent</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>karaf4-parent</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Interner;
import com.google.common.collect.Interners;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Interner;
import com.google.common.collect.Interners;
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
return ids.size() < 2 ? ids : simplifyQNames(ids);
}
return ids.size() < 2 ? ids : simplifyQNames(ids);
}
- @SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD",
- justification = "https://github.com/spotbugs/spotbugs/issues/811")
private static ImmutableList<QName> checkQNames(final Collection<QName> qnames) {
final ImmutableList<QName> ret = ImmutableList.copyOf(qnames);
checkArgument(!ret.isEmpty(), "SchemaNodeIdentifier has to have at least one node identifier");
private static ImmutableList<QName> checkQNames(final Collection<QName> qnames) {
final ImmutableList<QName> ret = ImmutableList.copyOf(qnames);
checkArgument(!ret.isEmpty(), "SchemaNodeIdentifier has to have at least one node identifier");
import com.google.common.annotations.Beta;
import com.google.common.collect.Range;
import com.google.common.annotations.Beta;
import com.google.common.collect.Range;
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.yangtools.concepts.Immutable;
import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.yangtools.concepts.Immutable;
throw new UnsupportedOperationException();
}
throw new UnsupportedOperationException();
}
- @SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD",
- justification = "https://github.com/spotbugs/spotbugs/issues/811")
private static <T extends Number> T resolve(final T number) {
checkArgument(!(number instanceof UnresolvedNumber));
return number;
private static <T extends Number> T resolve(final T number) {
checkArgument(!(number instanceof UnresolvedNumber));
return number;
*/
package org.opendaylight.yangtools.yang.model.spi;
*/
package org.opendaylight.yangtools.yang.model.spi;
-import static com.google.common.base.Preconditions.checkArgument;
import static java.util.Objects.requireNonNull;
import com.google.common.collect.ImmutableMap;
import static java.util.Objects.requireNonNull;
import com.google.common.collect.ImmutableMap;
local = loadDerivedIdentities();
}
final ImmutableSet<IdentitySchemaNode> result = local.get(requireNonNull(identity));
local = loadDerivedIdentities();
}
final ImmutableSet<IdentitySchemaNode> result = local.get(requireNonNull(identity));
- checkArgument(result != null, "Identity %s not found", identity);
+ if (result == null) {
+ throw new IllegalArgumentException("Identity " + identity + " not found");
+ }
*/
package org.opendaylight.yangtools.yang.model.spi.meta;
*/
package org.opendaylight.yangtools.yang.model.spi.meta;
+import static com.google.common.base.Verify.verifyNotNull;
+
import com.google.common.annotations.Beta;
import com.google.common.base.Strings;
import com.google.common.collect.Collections2;
import com.google.common.annotations.Beta;
import com.google.common.base.Strings;
import com.google.common.collect.Collections2;
extends DocumentedNodeMixin.WithStatus<A, D>, CopyableMixin<A, D>, UnknownSchemaNode {
@Override
default String getNodeParameter() {
extends DocumentedNodeMixin.WithStatus<A, D>, CopyableMixin<A, D>, UnknownSchemaNode {
@Override
default String getNodeParameter() {
- return Strings.nullToEmpty(getDeclared().rawArgument());
+ return Strings.nullToEmpty(verifyNotNull(getDeclared()).rawArgument());
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
@Override
public String getPrefix() {
@Override
public String getPrefix() {
+ throw new UnsupportedOperationException();
static String safeStringArgument(final SourceIdentifier source, final IRStatement stmt, final String desc) {
final StatementSourceReference ref = getReference(source, stmt);
final IRArgument arg = stmt.argument();
static String safeStringArgument(final SourceIdentifier source, final IRStatement stmt, final String desc) {
final StatementSourceReference ref = getReference(source, stmt);
final IRArgument arg = stmt.argument();
- checkArgument(arg != null, "Missing %s at %s", desc, ref);
+ if (arg == null) {
+ throw new IllegalArgumentException("Missing " + desc + " at " + ref);
+ }
+
// TODO: we probably need to understand yang version first....
return ArgumentContextUtils.rfc6020().stringFromStringContext(arg, ref);
}
// TODO: we probably need to understand yang version first....
return ArgumentContextUtils.rfc6020().stringFromStringContext(arg, ref);
}
@Override
public String getPrefix() {
@Override
public String getPrefix() {
+ throw new UnsupportedOperationException();
import com.google.common.collect.Iterables;
import com.google.common.collect.Maps;
import com.google.common.collect.SetMultimap;
import com.google.common.collect.Iterables;
import com.google.common.collect.Maps;
import com.google.common.collect.SetMultimap;
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
- @SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD",
- justification = "https://github.com/spotbugs/spotbugs/issues/811")
private static void performDeviateAdd(final StmtContext<?, ?, ?> deviateStmtCtx,
final Mutable<?, ?, ?> targetCtx) {
for (StmtContext<?, ?, ?> originalStmtCtx : deviateStmtCtx.declaredSubstatements()) {
private static void performDeviateAdd(final StmtContext<?, ?, ?> deviateStmtCtx,
final Mutable<?, ?, ?> targetCtx) {
for (StmtContext<?, ?, ?> originalStmtCtx : deviateStmtCtx.declaredSubstatements()) {
copyStatement(stmtCtxToBeAdded, targetCtx);
}
copyStatement(stmtCtxToBeAdded, targetCtx);
}
- @SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD",
- justification = "https://github.com/spotbugs/spotbugs/issues/811")
private static void performDeviateReplace(final StmtContext<?, ?, ?> deviateStmtCtx,
final Mutable<?, ?, ?> targetCtx) {
for (StmtContext<?, ?, ?> originalStmtCtx : deviateStmtCtx.declaredSubstatements()) {
private static void performDeviateReplace(final StmtContext<?, ?, ?> deviateStmtCtx,
final Mutable<?, ?, ?> targetCtx) {
for (StmtContext<?, ?, ?> originalStmtCtx : deviateStmtCtx.declaredSubstatements()) {
stmtToBeReplaced.getStatementName(), targetCtx.argument());
}
stmtToBeReplaced.getStatementName(), targetCtx.argument());
}
- @SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD",
- justification = "https://github.com/spotbugs/spotbugs/issues/811")
private static void performDeviateDelete(final StmtContext<?, ?, ?> deviateStmtCtx,
final Mutable<?, ?, ?> targetCtx) {
for (StmtContext<?, ?, ?> originalStmtCtx : deviateStmtCtx.declaredSubstatements()) {
private static void performDeviateDelete(final StmtContext<?, ?, ?> deviateStmtCtx,
final Mutable<?, ?, ?> targetCtx) {
for (StmtContext<?, ?, ?> originalStmtCtx : deviateStmtCtx.declaredSubstatements()) {
import static org.opendaylight.yangtools.yang.parser.spi.meta.StmtContextUtils.firstAttributeOf;
import com.google.common.base.MoreObjects.ToStringHelper;
import static org.opendaylight.yangtools.yang.parser.spi.meta.StmtContextUtils.firstAttributeOf;
import com.google.common.base.MoreObjects.ToStringHelper;
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.Collection;
import java.util.Optional;
import org.opendaylight.yangtools.concepts.SemVer;
import java.util.Collection;
import java.util.Optional;
import org.opendaylight.yangtools.concepts.SemVer;
return Optional.ofNullable(stmt.getFromNamespace(SemanticVersionNamespace.class, stmt));
}
return Optional.ofNullable(stmt.getFromNamespace(SemanticVersionNamespace.class, stmt));
}
- @SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD",
- justification = "https://github.com/spotbugs/spotbugs/issues/811")
private static String getRequestedImportVersionString(final StmtContext<?, ?, ?> stmt) {
return getRequestedImportVersion(stmt).map(SemVer::toString).orElse("<any>");
}
private static String getRequestedImportVersionString(final StmtContext<?, ?, ?> stmt) {
return getRequestedImportVersion(stmt).map(SemVer::toString).orElse("<any>");
}
- @SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD",
- justification = "https://github.com/spotbugs/spotbugs/issues/811")
private static SemVerSourceIdentifier createSemVerModuleIdentifier(
final SourceIdentifier importedModuleIdentifier, final SemVer semVer) {
return SemVerSourceIdentifier.create(importedModuleIdentifier.getName(),
private static SemVerSourceIdentifier createSemVerModuleIdentifier(
final SourceIdentifier importedModuleIdentifier, final SemVer semVer) {
return SemVerSourceIdentifier.create(importedModuleIdentifier.getName(),
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedHashMap;
* @throws SourceException
* instance of SourceException
*/
* @throws SourceException
* instance of SourceException
*/
- @SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD",
- justification = "https://github.com/spotbugs/spotbugs/issues/811")
private static void copyFromSourceToTarget(final StmtContext<?, ?, ?> sourceGrpStmtCtx,
final Mutable<?, ?, ?> targetCtx, final Mutable<QName, UsesStatement, UsesEffectiveStatement> usesNode) {
final var declared = sourceGrpStmtCtx.declaredSubstatements();
private static void copyFromSourceToTarget(final StmtContext<?, ?, ?> sourceGrpStmtCtx,
final Mutable<?, ?, ?> targetCtx, final Mutable<QName, UsesStatement, UsesEffectiveStatement> usesNode) {
final var declared = sourceGrpStmtCtx.declaredSubstatements();
- @SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD",
- justification = "https://github.com/spotbugs/spotbugs/issues/811")
private static void resolveUsesNode(final Mutable<QName, UsesStatement, UsesEffectiveStatement> usesNode,
final StmtContext<?, ?, ?> targetNodeStmtCtx) {
for (Mutable<?, ?, ?> subStmtCtx : usesNode.mutableDeclaredSubstatements()) {
private static void resolveUsesNode(final Mutable<QName, UsesStatement, UsesEffectiveStatement> usesNode,
final StmtContext<?, ?, ?> targetNodeStmtCtx) {
for (Mutable<?, ?, ?> subStmtCtx : usesNode.mutableDeclaredSubstatements()) {
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.MoreExecutors;
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
- @SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD",
- justification = "https://github.com/spotbugs/spotbugs/issues/811")
private synchronized <T extends SchemaSourceRepresentation> void removeSource(final PotentialSchemaSource<?> source,
final SchemaSourceRegistration<?> reg) {
final Multimap<Class<? extends SchemaSourceRepresentation>, AbstractSchemaSourceRegistration<?>> m =
private synchronized <T extends SchemaSourceRepresentation> void removeSource(final PotentialSchemaSource<?> source,
final SchemaSourceRegistration<?> reg) {
final Multimap<Class<? extends SchemaSourceRepresentation>, AbstractSchemaSourceRegistration<?>> m =