mirror of https://github.com/apache/maven.git
code formatting
This commit is contained in:
parent
e112cd89c7
commit
6683e8681f
|
@ -205,14 +205,15 @@ public class DefaultArtifactVersion
|
|||
|
||||
private static Integer getNextIntegerToken( StringTokenizer tok )
|
||||
{
|
||||
try {
|
||||
try
|
||||
{
|
||||
String s = tok.nextToken();
|
||||
if ( ( s.length() > 1 ) && s.startsWith( "0" ) )
|
||||
{
|
||||
throw new NumberFormatException( "Number part has a leading 0: '" + s + "'" );
|
||||
}
|
||||
return Integer.valueOf( s );
|
||||
}
|
||||
}
|
||||
catch( NoSuchElementException e )
|
||||
{
|
||||
throw new NumberFormatException( "Number is invalid" );
|
||||
|
|
|
@ -201,7 +201,7 @@ public class DefaultArtifactVersionTest
|
|||
}
|
||||
catch ( Exception e )
|
||||
{
|
||||
assertTrue("We expect a NumberFormatException to be thrown.", e instanceof NumberFormatException);
|
||||
assertTrue( "We expect a NumberFormatException to be thrown.", e instanceof NumberFormatException );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -23,13 +23,16 @@ import org.apache.maven.artifact.repository.ArtifactRepository;
|
|||
import org.apache.maven.artifact.repository.DefaultArtifactRepository;
|
||||
import org.codehaus.plexus.PlexusTestCase;
|
||||
|
||||
public class DefaultMirrorSelectorTest extends PlexusTestCase {
|
||||
public class DefaultMirrorSelectorTest
|
||||
extends PlexusTestCase
|
||||
{
|
||||
|
||||
public void testMirrorWithMirroOfPatternContainingANegationIsNotSelected() {
|
||||
ArtifactRepository repository = new DefaultArtifactRepository("snapshots.repo", "http://whatever", null);
|
||||
String pattern = "external:*, !snapshots.repo";
|
||||
boolean matches = DefaultMirrorSelector.matchPattern(repository, pattern);
|
||||
System.out.println(matches);
|
||||
assertFalse(matches);
|
||||
}
|
||||
public void testMirrorWithMirroOfPatternContainingANegationIsNotSelected()
|
||||
{
|
||||
ArtifactRepository repository = new DefaultArtifactRepository( "snapshots.repo", "http://whatever", null );
|
||||
String pattern = "external:*, !snapshots.repo";
|
||||
boolean matches = DefaultMirrorSelector.matchPattern( repository, pattern );
|
||||
System.out.println( matches );
|
||||
assertFalse( matches );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -105,8 +105,10 @@ public class DefaultProfileSelector
|
|||
private boolean isActive( Profile profile, ProfileActivationContext context, ModelProblemCollector problems )
|
||||
{
|
||||
boolean isActive = false;
|
||||
for ( ProfileActivator activator : activators ) {
|
||||
if ( activator.presentInConfig( profile, context, problems ) ) {
|
||||
for ( ProfileActivator activator : activators )
|
||||
{
|
||||
if ( activator.presentInConfig( profile, context, problems ) )
|
||||
{
|
||||
isActive = true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue