From 363a93bd06d7cb38c0f5e5d8dbd89b7afed4a42a Mon Sep 17 00:00:00 2001 From: tsantalis Date: Tue, 10 Dec 2024 10:54:56 -0500 Subject: [PATCH] Match single-tag javadocs, regardless of their textual contents --- src/main/java/gr/uom/java/xmi/diff/UMLJavadocDiff.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/gr/uom/java/xmi/diff/UMLJavadocDiff.java b/src/main/java/gr/uom/java/xmi/diff/UMLJavadocDiff.java index f0ebfe613f..ab590ee087 100644 --- a/src/main/java/gr/uom/java/xmi/diff/UMLJavadocDiff.java +++ b/src/main/java/gr/uom/java/xmi/diff/UMLJavadocDiff.java @@ -80,6 +80,7 @@ public UMLJavadocDiff(UMLJavadoc javadocBefore, UMLJavadoc javadocAfter, UMLOper private void process(UMLJavadoc javadocBefore, UMLJavadoc javadocAfter) { List tagsBefore = javadocBefore.getTags(); List tagsAfter = javadocAfter.getTags(); + boolean singleTagJavadoc = tagsBefore.size() == 1 && tagsAfter.size() == 1; List deletedTags = new ArrayList(tagsBefore); List addedTags = new ArrayList(tagsAfter); if(tagsBefore.size() <= tagsAfter.size()) { @@ -208,6 +209,15 @@ else if(tagBefore.isThrows() && tagAfter.isThrows()) { } } } + if(singleTagJavadoc && commonTags.isEmpty()) { + UMLTagElement tagBefore = deletedTags.get(0); + UMLTagElement tagAfter = addedTags.get(0); + deletedToBeDeleted.add(tagBefore); + addedToBeDeleted.add(tagAfter); + Pair pair = Pair.of(tagBefore, tagAfter); + commonTags.add(pair); + matchNestedTags(tagBefore, tagAfter); + } deletedTags.removeAll(deletedToBeDeleted); addedTags.removeAll(addedToBeDeleted); this.deletedTags.addAll(deletedTags);