mirror of https://github.com/apache/maven.git
[MNG-6631] documented the performance intent
This commit is contained in:
parent
44ad1aafa6
commit
d34e8fbdc0
|
@ -221,12 +221,14 @@ public class DefaultArtifactVersion
|
|||
|
||||
private static Integer tryParseInt( String s )
|
||||
{
|
||||
// for performance, check digits instead of relying later on catching NumberFormatException
|
||||
if ( !isDigits( s ) )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if ( !isDigits( s ) )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
long longValue = Long.parseLong( s );
|
||||
if ( longValue > Integer.MAX_VALUE )
|
||||
{
|
||||
|
@ -236,6 +238,7 @@ public class DefaultArtifactVersion
|
|||
}
|
||||
catch ( NumberFormatException e )
|
||||
{
|
||||
// should never happen since checked isDigits(s) before
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue