<artifactId>yang-validation-tool</artifactId>
<version>5.0.0-SNAPSHOT</version>
- <properties>
- <!-- FIXME: we have some violations here -->
- <odlparent.spotbugs.enforce>false</odlparent.spotbugs.enforce>
- </properties>
-
<dependencyManagement>
<dependencies>
<dependency>
import org.slf4j.LoggerFactory;
final class Params {
-
private static final Logger LOG = LoggerFactory.getLogger(Params.class);
+
@Arg(dest = "yang-source-dir")
private File yangSourceDir;
LOG.error("Yang source directory has to be readable");
return false;
}
- if (yangSourceDir.list().length == 0) {
+ final String[] listed = yangSourceDir.list();
+ if (listed == null) {
+ LOG.error("Yang source directory {} is not a directory or cannot be read", yangSourceDir.getPath());
+ return false;
+ }
+ if (listed.length == 0) {
LOG.error("Yang source directory {} doesn't contain any model", yangSourceDir.getPath());
return false;
}
*/
package org.opendaylight.yangtools.yang.validation.tool;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import net.sourceforge.argparse4j.inf.ArgumentParser;
import net.sourceforge.argparse4j.inf.ArgumentParserException;
}
- public static Params parseArgs(final String[] args, final ArgumentParser parser) {
+ @SuppressFBWarnings(value = "DM_EXIT", justification = "We do expect to terminate the JVM")
+ static Params parseArgs(final String[] args, final ArgumentParser parser) {
final Params params = new Params();
try {
parser.parseArgs(args, params);