[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 Michael Osipov
parent 6f5c3d57a6
commit 01780c0ff3
5 changed files with 11 additions and 11 deletions

View File

@ -138,7 +138,7 @@ public class ArtifactRepositoryPolicy
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 @@ public class ArtifactRepositoryPolicy
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 final class ModelUtils
String inherited = plugin.getInherited();
if ( ( inherited != null ) && !Boolean.valueOf( inherited ) )
if ( ( inherited != null ) && !Boolean.parseBoolean( inherited ) )
{
it.remove();
}
@ -97,7 +97,7 @@ public final class ModelUtils
// 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 final class ModelUtils
// 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 final class ModelUtils
String inherited = parentExecution.getInherited();
boolean parentExecInherited =
parentIsInherited && ( ( inherited == null ) || Boolean.valueOf( inherited ) );
parentIsInherited && ( ( inherited == null ) || Boolean.parseBoolean( inherited ) );
if ( !handleAsInheritance || parentExecInherited )
{

View File

@ -386,7 +386,7 @@ public class DefaultModelInheritanceAssembler
{
String parentInherited = parentPlugin.getInherited();
if ( !handleAsInheritance || ( parentInherited == null ) || Boolean.valueOf( parentInherited ) )
if ( !handleAsInheritance || ( parentInherited == null ) || Boolean.parseBoolean( parentInherited ) )
{
ReportPlugin assembledPlugin = parentPlugin;
@ -474,7 +474,7 @@ public class DefaultModelInheritanceAssembler
// 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 @@ public final class CLIReportingUtils
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

@ -1600,7 +1600,7 @@ public class MavenCli
}
else
{
request.setDegreeOfConcurrency( Integer.valueOf( threadConfiguration ) );
request.setDegreeOfConcurrency( Integer.parseInt( threadConfiguration ) );
}
}
@ -1618,7 +1618,7 @@ public class MavenCli
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 );
}
// ----------------------------------------------------------------------