StatementContextBase.addPhaseCompletedListener() is the heart of
inference and the checkNotNull() here is taking sourceReference().
Acquiring source reference is an indirection, which may actually
got through a forwarding chain. While we could use and if/throws,
let's just use plain requireNonNull.
JIRA: YANGTOOLS-652
Change-Id: I77d5b1dcc8b6b575d01ced0850d7081909b57964
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
cd04351669d5921088a73a275954ba78336c1a44)
package org.opendaylight.yangtools.yang.parser.stmt.reactor;
import static com.google.common.base.Preconditions.checkArgument;
package org.opendaylight.yangtools.yang.parser.stmt.reactor;
import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkState;
import static com.google.common.base.Verify.verify;
import static java.util.Objects.requireNonNull;
import static com.google.common.base.Preconditions.checkState;
import static com.google.common.base.Verify.verify;
import static java.util.Objects.requireNonNull;
* @throws NullPointerException if any of the arguments is null
*/
void addPhaseCompletedListener(final ModelProcessingPhase phase, final OnPhaseFinished listener) {
* @throws NullPointerException if any of the arguments is null
*/
void addPhaseCompletedListener(final ModelProcessingPhase phase, final OnPhaseFinished listener) {
- checkNotNull(phase, "Statement context processing phase cannot be null at: %s", getStatementSourceReference());
- checkNotNull(listener, "Statement context phase listener cannot be null at: %s", getStatementSourceReference());
+ requireNonNull(phase, "Statement context processing phase cannot be null");
+ requireNonNull(listener, "Statement context phase listener cannot be null");
ModelProcessingPhase finishedPhase = completedPhase;
while (finishedPhase != null) {
ModelProcessingPhase finishedPhase = completedPhase;
while (finishedPhase != null) {