diff --git a/spring-statemachine-core/src/main/java/org/springframework/statemachine/support/tree/AbstractIterator.java b/spring-statemachine-core/src/main/java/org/springframework/statemachine/support/tree/AbstractIterator.java index 598e3f7a..7fd88a54 100644 --- a/spring-statemachine-core/src/main/java/org/springframework/statemachine/support/tree/AbstractIterator.java +++ b/spring-statemachine-core/src/main/java/org/springframework/statemachine/support/tree/AbstractIterator.java @@ -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 implements Iterator { @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; diff --git a/spring-statemachine-core/src/main/java/org/springframework/statemachine/support/tree/TreeTraverser.java b/spring-statemachine-core/src/main/java/org/springframework/statemachine/support/tree/TreeTraverser.java index 77bf9584..9199e54e 100644 --- a/spring-statemachine-core/src/main/java/org/springframework/statemachine/support/tree/TreeTraverser.java +++ b/spring-statemachine-core/src/main/java/org/springframework/statemachine/support/tree/TreeTraverser.java @@ -24,14 +24,14 @@ public abstract class TreeTraverser { /** * Returns the children of the specified node. Must not contain null. - * + * * @param root the node * @return child iterables */ public abstract Iterable children(T root); public final Iterable postOrderTraversal(final T root) { - Assert.notNull(root); + Assert.notNull(root, "root should not be null"); return new Iterable() { @Override public Iterator iterator() { @@ -49,8 +49,8 @@ public abstract class TreeTraverser { final Iterator childIterator; PostOrderNode(T root, Iterator 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; }