Skip to content
Snippets Groups Projects
Commit 1a8bfef7 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

forbid adding reactions with the same id

parent 51377a45
No related branches found
No related tags found
1 merge request!186Resolve "upload of sbml"
......@@ -173,6 +173,9 @@ public class ModelFullIndexed implements Model {
@Override
public void addReaction(Reaction reaction) {
modelData.addReaction(reaction);
if (reactionByReactionId.get(reaction.getIdReaction()) != null) {
throw new InvalidArgumentException("Reaction with id already exists: " + reaction.getElementId());
}
reactionByReactionId.put(reaction.getIdReaction(), reaction);
reactionByDbId.put(reaction.getId(), reaction);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment