Skip to content

Commit

Permalink
[MNG-7476] Cleanup access to the mojos map
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed May 30, 2022
1 parent 511b414 commit 7b2ee1a
Showing 1 changed file with 3 additions and 10 deletions.
Expand Up @@ -273,6 +273,7 @@ private class ProjectLock implements AutoCloseable
public void close()
{
// release the lock in the reverse order of the acquisition
mojos.remove( Thread.currentThread() );
if ( acquiredProjectLock != null )
{
acquiredProjectLock.unlock();
Expand Down Expand Up @@ -345,17 +346,9 @@ private void doExecute( MavenSession session, MojoExecution mojoExecution, Proje

ensureDependenciesAreResolved( mojoDescriptor, session, dependencyContext );

try
try ( ProjectLock lock = new ProjectLock( session, mojoDescriptor ) )
{
mojos.put( Thread.currentThread(), mojoDescriptor );
try ( ProjectLock lock = new ProjectLock( session, mojoDescriptor ) )
{
doExecute2( session, mojoExecution );
}
finally
{
mojos.remove( Thread.currentThread() );
}
doExecute2( session, mojoExecution );
}
finally
{
Expand Down

0 comments on commit 7b2ee1a

Please sign in to comment.