Fix Assert deprecation warnings

- Fixes #346
This commit is contained in:
Janne Valkealahti
2017-04-11 19:59:44 +01:00
parent 69c0146d80
commit 7cd5f3c069
2 changed files with 6 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015 the original author or authors.
* Copyright 2015-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -39,7 +39,7 @@ public abstract class AbstractIterator<T> implements Iterator<T> {
@Override
public final boolean hasNext() {
Assert.state(state != State.FAILED);
Assert.state(state != State.FAILED, "State should not be FAILED");
switch (state) {
case DONE:
return false;

View File

@@ -24,14 +24,14 @@ public abstract class TreeTraverser<T> {
/**
* Returns the children of the specified node. Must not contain null.
*
*
* @param root the node
* @return child iterables
*/
public abstract Iterable<T> children(T root);
public final Iterable<T> postOrderTraversal(final T root) {
Assert.notNull(root);
Assert.notNull(root, "root should not be null");
return new Iterable<T>() {
@Override
public Iterator<T> iterator() {
@@ -49,8 +49,8 @@ public abstract class TreeTraverser<T> {
final Iterator<T> childIterator;
PostOrderNode(T root, Iterator<T> childIterator) {
Assert.notNull(root);
Assert.notNull(childIterator);
Assert.notNull(root, "root should not be null");
Assert.notNull(childIterator, "childIterator should not be null");
this.root = root;
this.childIterator = childIterator;
}