[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 @@ public class ArtifactRepositoryPolicy
else if ( updatePolicy.startsWith( UPDATE_POLICY_INTERVAL ) ) else if ( updatePolicy.startsWith( UPDATE_POLICY_INTERVAL ) )
{ {
String s = updatePolicy.substring( UPDATE_POLICY_INTERVAL.length() + 1 ); String s = updatePolicy.substring( UPDATE_POLICY_INTERVAL.length() + 1 );
int minutes = Integer.valueOf( s ); int minutes = Integer.parseInt( s );
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
cal.add( Calendar.MINUTE, -minutes ); cal.add( Calendar.MINUTE, -minutes );
if ( cal.getTime().after( lastModified ) ) if ( cal.getTime().after( lastModified ) )
@ -212,7 +212,7 @@ public class ArtifactRepositoryPolicy
else if ( policy != null && policy.startsWith( ArtifactRepositoryPolicy.UPDATE_POLICY_INTERVAL ) ) else if ( policy != null && policy.startsWith( ArtifactRepositoryPolicy.UPDATE_POLICY_INTERVAL ) )
{ {
String s = policy.substring( UPDATE_POLICY_INTERVAL.length() + 1 ); String s = policy.substring( UPDATE_POLICY_INTERVAL.length() + 1 );
return Integer.valueOf( s ); return Integer.parseInt( s );
} }
else else
{ {

View File

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

View File

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

View File

@ -96,7 +96,7 @@ public final class CLIReportingUtils
msg += ( rev != null ? rev : "" ); msg += ( rev != null ? rev : "" );
if ( StringUtils.isNotBlank( timestamp ) ) if ( StringUtils.isNotBlank( timestamp ) )
{ {
String ts = formatTimestamp( Long.valueOf( timestamp ) ); String ts = formatTimestamp( Long.parseLong( timestamp ) );
msg += ( rev != null ? "; " : "" ) + ts; msg += ( rev != null ? "; " : "" ) + ts;
} }
msg += ")"; msg += ")";

View File

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