Skip to content

Commit

Permalink
Don't putAll
Browse files Browse the repository at this point in the history
  • Loading branch information
alanocallaghan committed Jan 8, 2025
1 parent 21b5af9 commit 39f5f0e
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions src/main/java/qupath/ext/instanseg/core/InstanSeg.java
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ public static final class Builder {
private Collection<? extends ColorTransforms.ColorTransform> channels;
private InstanSegModel model;
private Class<? extends PathObject> preferredOutputClass;
private final Map<String, Object> optionalArgs = new HashMap<>();
private Map<String, ?> optionalArgs;

Builder() {}

Expand Down Expand Up @@ -663,21 +663,11 @@ public Builder outputAnnotations() {
* @param optionalArgs The argument names and values.
* @return A modified builder.
*/
public Builder args(Map<String, Object> optionalArgs) {
this.optionalArgs.putAll(optionalArgs);
public Builder args(Map<String, ?> optionalArgs) {
this.optionalArgs = (optionalArgs);
return this;
}

/**
* Set a number of optional arguments
* @param name The argument name.
* @param value The argument value.
* @return A modified builder.
*/
public Builder arg(String name, Object value) {
optionalArgs.put(name, value);
return this;
}

/**
* Request to make measurements from the objects created by InstanSeg.
Expand Down

0 comments on commit 39f5f0e

Please sign in to comment.