fixing one errorprone error, ATM configure it to generate warning and not errors, let see if we can collect in jenkins

Signed-off-by: olivier lamy <olamy@webtide.com>
This commit is contained in:
olivier lamy 2018-02-19 13:37:28 +10:00
parent 41b40dc97d
commit bd0b440da9
2 changed files with 31 additions and 27 deletions

View File

@ -50,6 +50,7 @@ import java.util.Scanner;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.TimeUnit;
import java.util.function.Predicate;
import java.util.stream.Stream;
import org.eclipse.jetty.util.component.AbstractLifeCycle;
import org.eclipse.jetty.util.log.Log;
@ -1029,35 +1030,34 @@ public class PathWatcher extends AbstractLifeCycle implements Runnable
register(dir,config);
final MultiException me = new MultiException();
Files.list(dir).forEach(p->
{
if (LOG.isDebugEnabled())
LOG.debug("registerTree? {}",p);
try (Stream<Path> stream = Files.list( dir)) {
stream.forEach( p -> {
if ( LOG.isDebugEnabled() ) LOG.debug( "registerTree? {}", p );
try
{
if (notify && config.test(p))
pending.put(p,new PathWatchEvent(p,PathWatchEventType.ADDED,config));
switch(config.handleDir(p))
try
{
case ENTER:
registerTree(p,config.asSubConfig(p),notify);
break;
case WATCH:
registerDir(p,config);
break;
case IGNORE:
default:
break;
if ( notify && config.test( p ) )
pending.put( p, new PathWatchEvent( p, PathWatchEventType.ADDED, config ) );
switch ( config.handleDir( p ) )
{
case ENTER:
registerTree( p, config.asSubConfig( p ), notify );
break;
case WATCH:
registerDir( p, config );
break;
case IGNORE:
default:
break;
}
}
}
catch(IOException e)
{
me.add(e);
}
});
catch ( IOException e )
{
me.add( e );
}
} );
}
try
{
me.ifExceptionThrow();

View File

@ -406,16 +406,20 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.2</version>
<configuration>
<showWarnings>true</showWarnings>
<compilerId>javac-with-errorprone</compilerId>
<forceJavacCompilerUse>true</forceJavacCompilerUse>
<source>1.8</source>
<target>1.8</target>
<compilerArgs>
<arg>-XepAllErrorsAsWarnings</arg>
</compilerArgs>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-javac-errorprone</artifactId>
<version>2.8</version>
<version>2.8.2</version>
</dependency>
<!-- override plexus-compiler-javac-errorprone's dependency on
Error Prone with the latest version -->