gnodet-bot commented on code in PR #2297:
URL: https://github.com/apache/maven-resolver/pull/2297#discussion_r4572129254
##########
maven-resolver-generator-gnupg/src/main/java/org/eclipse/aether/generator/gnupg/GnupgSignatureArtifactGenerator.java:
##########
@@ -84,6 +84,9 @@ public String generatorId() {
@Override
public synchronized Collection<? extends Artifact> generate(Collection<?
extends Artifact> generatedArtifacts) {
+ if (closed.get()) {
+ throw new IllegalStateException("generator is closed");
Review Comment:
💡 Include `generatorId()` in the error message so callers can identify which
generator was misused when multiple generators are active in a single
deployment:
```suggestion
throw new IllegalStateException("generator " + generatorId() + "
is closed");
```
##########
maven-resolver-generator-sigstore/src/main/java/org/eclipse/aether/generator/sigstore/SigstoreSignatureArtifactGenerator.java:
##########
@@ -76,6 +76,9 @@ public String generatorId() {
@Override
public synchronized Collection<? extends Artifact> generate(Collection<?
extends Artifact> generatedArtifacts) {
+ if (closed.get()) {
+ throw new IllegalStateException("generator is closed");
Review Comment:
💡 Same: include `generatorId()` for consistency and debuggability across
both generators.
```suggestion
throw new IllegalStateException("generator " + generatorId() + "
is closed");
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]