use primitive types

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@177873 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-05-23 02:41:00 +00:00
parent eeb42ca316
commit 6a630346a2
1 changed files with 4 additions and 26 deletions

View File

@ -38,16 +38,13 @@ public abstract class AbstractCompilerMojo
private Compiler compiler = new JavacCompiler();
// TODO: use boolean when supported
/**
* Whether to include debugging information in the compiled class files.
* <br/>
* <br/>
* The default value is true.
*
* @parameter expression="${maven.compiler.debug}"
*/
private String debug = Boolean.TRUE.toString();
private boolean debug = true;
/**
* The -source argument for the Java compiler
@ -63,14 +60,13 @@ public abstract class AbstractCompilerMojo
*/
private String target;
// TODO: Use long when supported
/**
* The granularity in milliseconds of the last modification
* date for testing whether a source needs recompilation
*
* @parameter alias="${lastModGranularityMs}"
*/
private String staleMillis = "0";
private int staleMillis = 0;
protected abstract List getClasspathElements();
@ -121,10 +117,7 @@ public void execute()
compilerConfiguration.addCompilerOption( "-target", target );
}
if ( debug != null && Boolean.valueOf( debug ).booleanValue() )
{
compilerConfiguration.setDebug( true );
}
compilerConfiguration.setDebug( debug );
List messages = null;
try
@ -158,24 +151,9 @@ public void execute()
private Set computeStaleSources()
throws MojoExecutionException
{
long staleTime = 0;
if ( staleMillis != null && staleMillis.length() > 0 )
{
try
{
staleTime = Long.parseLong( staleMillis );
}
catch ( NumberFormatException e )
{
throw new MojoExecutionException( "Invalid staleMillis plugin parameter value: \'" + staleMillis
+ "\'", e );
}
}
SuffixMapping mapping = new SuffixMapping( ".java", ".class" );
SourceInclusionScanner scanner = new StaleSourceScanner( staleTime );
SourceInclusionScanner scanner = new StaleSourceScanner( staleMillis );
scanner.addSourceMapping( mapping );