Skip to content

Commit

Permalink
Fix shape equality in ADT validator (#1514)
Browse files Browse the repository at this point in the history
  • Loading branch information
kubukoz authored May 10, 2024
1 parent 3b46b08 commit 7cc1aa9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.18.18

* Fix an issue in the ADT trait validators that would sometimes fail validation while they shouldn't.

# 0.18.17

* Constraints applied to list or map members are now correctly rendered in the generated code.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ ShapeId getReferencer() {

private static List<Reference> getReferences(Model model, Shape adtMemberShape, Shape adtParent) {
return model.getMemberShapes().stream().flatMap(memberShape -> {
boolean doesMemberTargetAdtShape = memberShape.getTarget() == adtMemberShape.getId();
boolean doesMemberTargetAdtShape = memberShape.getTarget().equals(adtMemberShape.getId());
boolean isMemberShapeInDesiredTarget = memberShape.getContainer().equals(adtParent.toShapeId());
if (doesMemberTargetAdtShape) {
return Stream.of(new Reference(isMemberShapeInDesiredTarget, memberShape.getContainer()));
Expand Down

0 comments on commit 7cc1aa9

Please sign in to comment.