[MNG-6853] - Don't box primitives where it's not needed

Closes #318
This commit is contained in:
Rostislav Krasny 2020-01-22 20:50:14 +02:00 committed by Sylwester Lachiewicz
parent a6f113abce
commit ce35eff448
5 changed files with 11 additions and 11 deletions

View File

@ -138,7 +138,7 @@ else if ( UPDATE_POLICY_DAILY.equals( updatePolicy ) )
else if ( updatePolicy.startsWith( UPDATE_POLICY_INTERVAL ) )
{
String s = updatePolicy.substring( UPDATE_POLICY_INTERVAL.length() + 1 );
int minutes = Integer.valueOf( s );
int minutes = Integer.parseInt( s );
Calendar cal = Calendar.getInstance();
cal.add( Calendar.MINUTE, -minutes );
if ( cal.getTime().after( lastModified ) )
@ -212,7 +212,7 @@ else if ( ArtifactRepositoryPolicy.UPDATE_POLICY_ALWAYS.equals( policy ) )
else if ( policy != null && policy.startsWith( ArtifactRepositoryPolicy.UPDATE_POLICY_INTERVAL ) )
{
String s = policy.substring( UPDATE_POLICY_INTERVAL.length() + 1 );
return Integer.valueOf( s );
return Integer.parseInt( s );
}
else
{

View File

@ -76,7 +76,7 @@ public static void mergePluginLists( PluginContainer childContainer, PluginConta
String inherited = plugin.getInherited();
if ( ( inherited != null ) && !Boolean.valueOf( inherited ) )
if ( ( inherited != null ) && !Boolean.parseBoolean( inherited ) )
{
it.remove();
}
@ -97,7 +97,7 @@ public static void mergePluginLists( PluginContainer childContainer, PluginConta
// 2. the parent's <inherited/> flag is not set
// 3. the parent's <inherited/> flag is set to true
if ( !handleAsInheritance || ( parentInherited == null )
|| Boolean.valueOf( parentInherited ) )
|| Boolean.parseBoolean( parentInherited ) )
{
Plugin childPlugin = childPlugins.get( parentPlugin.getKey() );
@ -217,7 +217,7 @@ public static void mergePluginDefinitions( Plugin child, Plugin parent, boolean
// from here to the end of the method is dealing with merging of the <executions/> section.
String parentInherited = parent.getInherited();
boolean parentIsInherited = ( parentInherited == null ) || Boolean.valueOf( parentInherited );
boolean parentIsInherited = ( parentInherited == null ) || Boolean.parseBoolean( parentInherited );
List<PluginExecution> parentExecutions = parent.getExecutions();
@ -234,7 +234,7 @@ public static void mergePluginDefinitions( Plugin child, Plugin parent, boolean
String inherited = parentExecution.getInherited();
boolean parentExecInherited =
parentIsInherited && ( ( inherited == null ) || Boolean.valueOf( inherited ) );
parentIsInherited && ( ( inherited == null ) || Boolean.parseBoolean( inherited ) );
if ( !handleAsInheritance || parentExecInherited )
{

View File

@ -382,7 +382,7 @@ private static void mergeReportPluginLists( Reporting child, Reporting parent, b
{
String parentInherited = parentPlugin.getInherited();
if ( !handleAsInheritance || ( parentInherited == null ) || Boolean.valueOf( parentInherited ) )
if ( !handleAsInheritance || ( parentInherited == null ) || Boolean.parseBoolean( parentInherited ) )
{
ReportPlugin assembledPlugin = parentPlugin;
@ -470,7 +470,7 @@ public static void mergeReportPluginDefinitions( ReportPlugin child, ReportPlugi
// from here to the end of the method is dealing with merging of the <executions/> section.
String parentInherited = parent.getInherited();
boolean parentIsInherited = ( parentInherited == null ) || Boolean.valueOf( parentInherited );
boolean parentIsInherited = ( parentInherited == null ) || Boolean.parseBoolean( parentInherited );
List<ReportSet> parentReportSets = parent.getReportSets();

View File

@ -96,7 +96,7 @@ static String createMavenVersionString( Properties buildProperties )
msg += ( rev != null ? rev : "" );
if ( StringUtils.isNotBlank( timestamp ) )
{
String ts = formatTimestamp( Long.valueOf( timestamp ) );
String ts = formatTimestamp( Long.parseLong( timestamp ) );
msg += ( rev != null ? "; " : "" ) + ts;
}
msg += ")";

View File

@ -1613,7 +1613,7 @@ else if ( commandLine.hasOption( CLIManager.ALSO_MAKE ) && commandLine.hasOption
}
else
{
request.setDegreeOfConcurrency( Integer.valueOf( threadConfiguration ) );
request.setDegreeOfConcurrency( Integer.parseInt( threadConfiguration ) );
}
}
@ -1631,7 +1631,7 @@ else if ( commandLine.hasOption( CLIManager.ALSO_MAKE ) && commandLine.hasOption
int calculateDegreeOfConcurrencyWithCoreMultiplier( String threadConfiguration )
{
int procs = Runtime.getRuntime().availableProcessors();
return (int) ( Float.valueOf( threadConfiguration.replace( "C", "" ) ) * procs );
return (int) ( Float.parseFloat( threadConfiguration.replace( "C", "" ) ) * procs );
}
// ----------------------------------------------------------------------