Skip to content

Commit

Permalink
Fix wrong precondition
Browse files Browse the repository at this point in the history
  • Loading branch information
tortmayr committed Aug 28, 2024
1 parent f6647bf commit b91dead
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public class ServerModule extends GLSPModule {
*/
public ServerModule configureDiagramModule(final DiagramModule diagramModule, final Module... mixinModules) {
String diagramType = diagramModule.getDiagramType();
if (!diagramModules.containsKey(diagramType)) {
if (diagramModules.containsKey(diagramType)) {
throw new IllegalArgumentException(
"A module configuration is already present for diagram type: " + diagramType);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,16 @@ public class BiIndex<K, V> {
protected Map<K, V> map = new HashMap<>();
protected Map<V, K> inverseMap = new HashMap<>();

/**
* Returns an unmodifiable map of the currently indexed key-value pairs.
*/
public Map<K, V> map() {
return Map.copyOf(map);
}

/**
* Returns an unmodifiable inversed map (value to key) of the currently indexed key-value pairs.
*/
public Map<V, K> inverseMap() {
return Map.copyOf(inverseMap);
}
Expand Down

0 comments on commit b91dead

Please sign in to comment.