Skip to content

Commit

Permalink
Throw an exception when a resource name collision is detected
Browse files Browse the repository at this point in the history
  • Loading branch information
mattdailis committed Oct 2, 2023
1 parent c45dad9 commit 6d95a48
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ CellId<State> allocate(

@Override
public void resource(final String name, final Resource<?> resource) {
if (this.resources.containsKey(name)) throw new IllegalArgumentException("A resource with that name has already been declared: \"" + name + "\"");
this.resources.put(name, resource);
}

Expand Down

0 comments on commit 6d95a48

Please sign in to comment.