[MCOMPILER-479] Clarify compiler arguments Javadoc by hisener · Pull Request #90 · apache/maven-compiler-plugin (original) (raw)

Map<String, String> effectiveCompilerArguments = getCompilerArguments();
String effectiveCompilerArgument = getCompilerArgument();
if ( ( effectiveCompilerArguments != null ) |
|
{
if ( effectiveCompilerArguments != null )
{
for ( Map.Entry<String, String> me : effectiveCompilerArguments.entrySet() )
{
String key = me.getKey();
String value = me.getValue();
if ( !key.startsWith( "-" ) )
{
key = "-" + key;
}
if ( key.startsWith( "-A" ) && StringUtils.isNotEmpty( value ) )
{
compilerConfiguration.addCompilerCustomArgument( key + "=" + value, null );
}
else
{
compilerConfiguration.addCompilerCustomArgument( key, value );
}
}
}
if ( !StringUtils.isEmpty( effectiveCompilerArgument ) )
{
compilerConfiguration.addCompilerCustomArgument( effectiveCompilerArgument, null );
}
if ( compilerArgs != null )
{
for ( String arg : compilerArgs )
{
compilerConfiguration.addCompilerCustomArgument( arg, null );
}
}
}