diff --git a/plugins/org.eclipse.glsp.server/src/org/eclipse/glsp/server/di/ServerModule.java b/plugins/org.eclipse.glsp.server/src/org/eclipse/glsp/server/di/ServerModule.java index fcdf5292..3fe57e37 100644 --- a/plugins/org.eclipse.glsp.server/src/org/eclipse/glsp/server/di/ServerModule.java +++ b/plugins/org.eclipse.glsp.server/src/org/eclipse/glsp/server/di/ServerModule.java @@ -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); } diff --git a/plugins/org.eclipse.glsp.server/src/org/eclipse/glsp/server/utils/BiIndex.java b/plugins/org.eclipse.glsp.server/src/org/eclipse/glsp/server/utils/BiIndex.java index c2ff95c2..832bf30b 100644 --- a/plugins/org.eclipse.glsp.server/src/org/eclipse/glsp/server/utils/BiIndex.java +++ b/plugins/org.eclipse.glsp.server/src/org/eclipse/glsp/server/utils/BiIndex.java @@ -32,10 +32,16 @@ public class BiIndex { protected Map map = new HashMap<>(); protected Map inverseMap = new HashMap<>(); + /** + * Returns an unmodifiable map of the currently indexed key-value pairs. + */ public Map map() { return Map.copyOf(map); } + /** + * Returns an unmodifiable inversed map (value to key) of the currently indexed key-value pairs. + */ public Map inverseMap() { return Map.copyOf(inverseMap); }