Skip to content

Commit

Permalink
Use a single loop to select active profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Oct 5, 2022
1 parent 95c7bc5 commit 076d3a7
Showing 1 changed file with 13 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ else if ( isActiveByDefault( profile ) )
activeProfiles.add( profile );
}
}

}
}

Expand All @@ -119,24 +118,21 @@ private boolean isActive( Profile profile, ProfileActivationContext context, Mod
if ( activator.presentInConfig( profile, context, problems ) )
{
isActive = true;
}
}
for ( ProfileActivator activator : activators )
{
try
{
if ( activator.presentInConfig( profile, context, problems ) )
try
{
isActive &= activator.isActive( profile, context, problems );
if ( !activator.isActive( profile, context, problems ) )
{
return false;
}
}
catch ( RuntimeException e )
{
problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE )
.setMessage( "Failed to determine activation for profile " + profile.getId() )
.setLocation( profile.getLocation( "" ) )
.setException( e ) );
return false;
}
}
catch ( RuntimeException e )
{
problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE )
.setMessage( "Failed to determine activation for profile " + profile.getId() )
.setLocation( profile.getLocation( "" ) )
.setException( e ) );
return false;
}
}
return isActive;
Expand Down

0 comments on commit 076d3a7

Please sign in to comment.