From 6a630346a22f5647a04f8033ad0c1e50f65dfe37 Mon Sep 17 00:00:00 2001 From: Brett Leslie Porter Date: Mon, 23 May 2005 02:41:00 +0000 Subject: [PATCH] use primitive types git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@177873 13f79535-47bb-0310-9956-ffa450edef68 --- .../maven/plugin/AbstractCompilerMojo.java | 30 +++---------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/AbstractCompilerMojo.java b/maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/AbstractCompilerMojo.java index ec9da9da05..6859aea029 100644 --- a/maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/AbstractCompilerMojo.java +++ b/maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/AbstractCompilerMojo.java @@ -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. - *
- *
* 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 abstract class AbstractCompilerMojo 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 abstract class AbstractCompilerMojo 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 );