Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class MavenCommandService : IMavenCommandService

/// <summary>
/// Per-location semaphores to prevent concurrent Maven CLI executions for the same pom.xml.
/// This allows multiple detectors (e.g., MvnCliComponentDetector and MavenWithFallbackDetector)
/// This allows the MvnCliComponentDetector
/// to safely share the same output file without race conditions.
Comment on lines +25 to 26
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The updated comment at lines 23-27 is now grammatically incomplete. The sentence "This allows the MvnCliComponentDetector" ends without finishing the thought, then the next line "to safely share the same output file without race conditions." starts with "to" without a subject, making the full sentence read: "This allows the MvnCliComponentDetector to safely share the same output file without race conditions." This is actually a dangling incomplete sentence in the XML doc comment. The comment should be rephrased to form a complete, readable sentence, such as: "This allows the MvnCliComponentDetector to safely share the same output file without race conditions."

Suggested change
/// This allows the MvnCliComponentDetector
/// to safely share the same output file without race conditions.
/// This design allows the MvnCliComponentDetector to safely share the same output file without race conditions.

Copilot uses AI. Check for mistakes.
/// </summary>
private readonly ConcurrentDictionary<string, SemaphoreSlim> locationLocks = new();
Expand Down Expand Up @@ -74,7 +74,7 @@ public async Task<MavenCliResult> GenerateDependenciesFileAsync(ProcessRequest p
}

// Use semaphore to prevent concurrent Maven CLI executions for the same pom.xml.
// This allows MvnCliComponentDetector and MavenWithFallbackDetector to safely share the output file.
// This allows the MvnCliComponentDetector to reuse any existing output file.
var semaphore = this.locationLocks.GetOrAdd(pomFile.Location, _ => new SemaphoreSlim(1, 1));

await semaphore.WaitAsync(cancellationToken);
Expand Down
Loading
Loading