Skip to content
Browse files

isDirectory() or isFile() already check if the file exists

git-svn-id: https://svn.apache.org/repos/asf/tomcat/maven-plugin/trunk@1408643 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent 3ca7c1b commit ee308b434bc92fcf8aa66cbb7035e0f4d1c797a0 @olamy olamy committed
View
5 ...src/main/java/org/apache/tomcat/maven/common/run/DefaultClassLoaderEntriesCalculator.java
@@ -74,7 +74,7 @@ public ClassLoaderEntriesCalculatorResult calculateClassPathEntries( ClassLoader
for ( String classPathElement : classPathElements )
{
File classPathElementFile = new File( classPathElement );
- if ( classPathElementFile.exists() && classPathElementFile.isDirectory() )
+ if ( classPathElementFile.isDirectory() )
{
request.getLog().debug(
"adding classPathElementFile " + classPathElementFile.toURI().toString() );
@@ -115,8 +115,7 @@ public ClassLoaderEntriesCalculatorResult calculateClassPathEntries( ClassLoader
+ artifact.getVersion() + ":" + artifact.getScope() );
// we add artifact dependencies and projects from reactor if file (ie jar) as users can go to install/package phase
// so artifact.getFile is a file not a directory and not added when iterate on project.classPathElements
- if ( !isInProjectReferences( artifact, request.getMavenProject() ) || ( artifact.getFile().exists()
- && artifact.getFile().isFile() ) )
+ if ( !isInProjectReferences( artifact, request.getMavenProject() ) || artifact.getFile().isFile() )
{
String fileName = artifact.getFile().getName();
if ( !fileInClassLoaderEntries.contains( fileName ) )

0 comments on commit ee308b4

Please sign in to comment.
Something went wrong with that request. Please try again.