Skip to content

Commit

Permalink
Fixed issue with using 5.2+ features
Browse files Browse the repository at this point in the history
fixes #3340
  • Loading branch information
dilipkrish committed Jun 25, 2020
1 parent a0a7788 commit 3c1774c
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ public void add(ModelSpecification modelSpecification) {
modelSpecification.key().ifPresent(key -> {
if (!modelByKey.containsKey(key)) {
modelByKey.put(key, modelSpecification);
modelByQName.addIfAbsent(key.getQualifiedModelName(), modelSpecification);
if (!modelByQName.containsKey(key.getQualifiedModelName())) {
modelByQName.add(key.getQualifiedModelName(), modelSpecification);
}
List<ModelSpecification> specsWithSameName = modelByQName.get(key.getQualifiedModelName());
if (!specsWithSameName.contains(modelSpecification)) {
modelByQName.add(key.getQualifiedModelName(), modelSpecification);
Expand Down Expand Up @@ -259,8 +261,12 @@ private boolean equivalentReference(
boolean isSame = sameModel(modelByKey.get(first), modelByKey.get(second), referenceKeyToEffectiveKey, seen);
seen.put(Arrays.asList(first, second), isSame);
if (isSame) {
referenceKeyToEffectiveKey.addIfAbsent(first, second);
referenceKeyToEffectiveKey.addIfAbsent(second, first);
if (!referenceKeyToEffectiveKey.containsKey(first)) {
referenceKeyToEffectiveKey.add(first, second);
}
if (!referenceKeyToEffectiveKey.containsKey(second)) {
referenceKeyToEffectiveKey.add(second, first);
}
}
return isSame;
}
Expand Down

0 comments on commit 3c1774c

Please sign in to comment.