Use isDirectory() instead of exists()

This commit is contained in:
Sam Harwell 2012-12-01 14:08:05 -06:00
parent 124f5eb30d
commit 9be06f92e7
1 changed files with 2 additions and 2 deletions

View File

@ -211,7 +211,7 @@ public class Antlr4Mojo extends AbstractMojo {
// //
} }
if (!sourceDirectory.exists()) { if (!sourceDirectory.isDirectory()) {
log.info("No ANTLR 4 grammars to compile in " + sourceDirectory.getAbsolutePath()); log.info("No ANTLR 4 grammars to compile in " + sourceDirectory.getAbsolutePath());
return; return;
} }
@ -273,7 +273,7 @@ public class Antlr4Mojo extends AbstractMojo {
} }
// Where do we want ANTLR to look for .tokens and import grammars? // Where do we want ANTLR to look for .tokens and import grammars?
if (getLibDirectory() != null && getLibDirectory().exists()) { if (getLibDirectory() != null && getLibDirectory().isDirectory()) {
args.add("-lib"); args.add("-lib");
args.add(libDirectory.getAbsolutePath()); args.add(libDirectory.getAbsolutePath());
} }