@Override
protected boolean valueEquals(final AbstractImmutableNormalizedNode<?, ?> other) {
// We can not call directly getValue.equals because of Empty Type
- // RequireInstanceStatementSupport leaves which allways have NULL value
-
- if (!Objects.deepEquals(value(), other.getValue())) {
- return false;
- }
+ // RequireInstanceStatementSupport leaves which always have NULL value
// FIXME: are attributes part of hashCode/equals?
- return true;
+ return Objects.deepEquals(value(), other.getValue());
}
}
*/
package org.opendaylight.yangtools.yang.data.impl.schema.tree;
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkArgument;
+import static java.util.Objects.requireNonNull;
+
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
}
final DataSchemaNode child = schema.getDataChildByName(key.getNodeType());
- Preconditions.checkArgument(child != null, "Schema %s does not have a node for child %s", schema,
+ checkArgument(child != null, "Schema %s does not have a node for child %s", schema,
key.getNodeType());
return SchemaAwareApplyOperation.from(child, treeConfig);
}
protected AbstractDataNodeContainerModificationStrategy(final T schema,
final Class<? extends NormalizedNode<?, ?>> nodeClass, final DataTreeConfiguration treeConfig) {
super(nodeClass, treeConfig);
- this.schema = Preconditions.checkNotNull(schema,"schema");
- this.treeConfig = Preconditions.checkNotNull(treeConfig,"treeConfig");
+ this.schema = requireNonNull(schema,"schema");
+ this.treeConfig = requireNonNull(treeConfig,"treeConfig");
}
protected final T getSchema() {
return Optional.ofNullable(childCache.get(identifier));
} catch (ExecutionException | UncheckedExecutionException e) {
LOG.trace("Child {} not present in container schema {} children {}", identifier, this,
- schema.getChildNodes(), e.getCause());
+ schema.getChildNodes(), e);
return Optional.empty();
}
}
* it should not cause transaction to fail, since result of this merge
* leads to same data.
*/
- if (!original.get().getData().equals(current.get().getData())) {
- checkNotConflicting(path, original.get(), current.get());
+ final TreeNode orig = original.get();
+ final TreeNode cur = current.get();
+ if (!orig.getData().equals(cur.getData())) {
+ checkNotConflicting(path, orig, cur);
}
}
}