SpotBugs is getting confused by our use of checkArgument, not
understanding we will catch nulls. Refactor the code removing
the violation and remove enforcement override.
Change-Id: I787359c01f2761448cb4f3d33aea0baf5e642ed8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
*/
package org.opendaylight.yangtools.yang.model.export;
-import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Verify.verify;
import java.util.Map;
}
}
- checkArgument(prefix != null, "Failed to find prefix for statement %s", stmtName);
+ if (prefix == null) {
+ throw new IllegalArgumentException("Failed to find prefix for statement " + stmtName);
+ }
+
verify(!prefix.isEmpty(), "Empty prefix for statement %s", stmtName);
return Optional.of(prefix);
}