Skip to content

Commit

Permalink
fix: add a log warning in verifySourceClasspath (#1937)
Browse files Browse the repository at this point in the history
  • Loading branch information
surli authored and monperrus committed Apr 4, 2018
1 parent 7663d79 commit 0135b1f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/spoon/compiler/Environment.java
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ void report(Processor<?> processor, Level level,
/**
* Sets the source class path of the Spoon model.
* After the class path is set, it can be retrieved by
* {@link #getSourceClasspath()}. Only .jar files or directories
* are accepted.
* {@link #getSourceClasspath()}. Only .jar files or directories with *.class files are accepted.
* The *.jar or *.java files contained in given directories are ignored.
*
* @throws InvalidClassPathException if a given classpath does not exists or
* does not have the right format (.jar file or directory)
Expand Down
1 change: 1 addition & 0 deletions src/main/java/spoon/support/StandardEnvironment.java
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@ private void verifySourceClasspath(String[] sourceClasspath) throws InvalidClass
if (javaFiles.size() > 0) {
logger.warn("You're trying to give source code in the classpath, this should be given to " + "addInputSource " + javaFiles);
}
logger.warn("You specified the directory " + classOrJarFolder.getPath() + " in source classpath, please note that only class files will be considered. Jars and subdirectories will be ignored.");
} else if (classOrJarFolder.getName().endsWith(".class")) {
throw new InvalidClassPathException(".class files are not accepted in source classpath.");
}
Expand Down

0 comments on commit 0135b1f

Please sign in to comment.