Skip to content

Commit

Permalink
Issue 54
Browse files Browse the repository at this point in the history
  • Loading branch information
bsorrentino committed Jun 14, 2013
1 parent 01341da commit e92be42
Showing 1 changed file with 30 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import java.util.zip.ZipFile;
import javax.tools.JavaCompiler.CompilationTask;
import javax.tools.*;
import javax.tools.Diagnostic.Kind;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
Expand Down Expand Up @@ -223,9 +224,9 @@ private String buildProcessor()

StringBuilder result = new StringBuilder();

int i = 0;
int i;

for (i = 0; i < processors.length - 1; ++i)
for ( i = 0; i < processors.length - 1; ++i)
{
result.append(processors[i]).append(',');
}
Expand Down Expand Up @@ -391,35 +392,40 @@ private void executeWithExceptionsHandled() throws Exception

if( getLog().isDebugEnabled() ) {
for (String option : options) {
getLog().debug("javac option: " + option);
getLog().debug(String.format("javac option: %s", option));
}
}

DiagnosticListener<JavaFileObject> dl = null;
if (outputDiagnostics)
final DiagnosticListener<JavaFileObject> dl = new DiagnosticListener<JavaFileObject>()
{
dl = new DiagnosticListener<JavaFileObject>()
{

public void report(Diagnostic< ? extends JavaFileObject> diagnostic)
{
getLog().debug("diagnostic " + diagnostic);
public void report(Diagnostic< ? extends JavaFileObject> diagnostic) {

if (!outputDiagnostics) {
return;
}

final Kind kind = diagnostic.getKind();

};
}
else
{
dl = new DiagnosticListener<JavaFileObject>()
{
if (Kind.ERROR == kind) {

getLog().error(String.format("diagnostic: %s", diagnostic));

} else if (Kind.MANDATORY_WARNING == kind || Kind.WARNING == kind) {

getLog().warn(String.format("diagnostic: %s", diagnostic));

} else if (Kind.NOTE == kind) {

getLog().debug(String.format("diagnostic: %s", diagnostic));

} else if (Kind.OTHER == kind) {

getLog().info(String.format("diagnostic: %s", diagnostic));

public void report(Diagnostic< ? extends JavaFileObject> diagnostic)
{
}

};
}
}
};

if (systemProperties != null)
{
Expand Down Expand Up @@ -578,7 +584,7 @@ private void addCompilerArguments(List<String> options)
if (!StringUtils.isEmpty(arg))
{
arg = arg.trim();
getLog().debug("Adding compiler arg: " + arg);
getLog().debug(String.format("Adding compiler arg: %s", arg));
options.add(arg);
}
}
Expand All @@ -589,7 +595,7 @@ private void addCompilerArguments(List<String> options)
if( !StringUtils.isEmpty(e.getKey()) && e.getValue()!=null ) {
String opt = String.format("-A%s=%s", e.getKey().trim(), e.getValue().toString().trim());
options.add( opt );
getLog().debug("Adding compiler arg: " + opt);
getLog().debug(String.format("Adding compiler arg: %s", opt));
}
}

Expand All @@ -601,7 +607,7 @@ private void addOutputToSourcesIfNeeded()
final Boolean add = addOutputDirectoryToCompilationSources;
if (add == null || add.booleanValue())
{
getLog().debug("Source directory: " + outputDirectory + " added");
getLog().debug(String.format("Source directory: %s added", outputDirectory));
addCompileSourceRoot(project, outputDirectory.getAbsolutePath());
}
}
Expand Down

0 comments on commit e92be42

Please sign in to comment.