Repository: SpoonLabs/gumtree-spoon-ast-diff
Pull request #242 (2022-04-21 09:07:58)

Bump maven-javadoc-plugin from 3.3.2 to 3.4.0
Bumps [maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.3.2 to 3.4.0.
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/apache/maven-javadoc-plugin/commit/40cc602f84dbb0689020b55b24970cdd7147722c"><code>40cc602</code></a> [maven-release-plugin] prepare release maven-javadoc-plugin-3.4.0</li>
<li><a href="https://github.com/apache/maven-javadoc-plugin/commit/0c6b32fb5ec9c31b4e38d9f32616ff51102623da"><code>0c6b32f</code></a> [MJAVADOC-714] Upgrade to Maven 3.2.5</li>
<li><a href="https://github.com/apache/maven-javadoc-plugin/commit/506cb74e6abc4b108121b0c586a15b75dd5ccc39"><code>506cb74</code></a> [MJAVADOC-696] Invalid anchors in Javadoc and plugin mojo</li>
<li><a href="https://github.com/apache/maven-javadoc-plugin/commit/47d03d3a08cc58a93fa384f4661d79c350842b82"><code>47d03d3</code></a> [MJAVADOC-712] Remove remains of org.codehaus.doxia.sink.Sink</li>
<li><a href="https://github.com/apache/maven-javadoc-plugin/commit/5fae3b656e131fa233982eebf0944b5253fc845e"><code>5fae3b6</code></a> [MJAVADOC-711] Upgrade plugins in ITs</li>
<li><a href="https://github.com/apache/maven-javadoc-plugin/commit/03ca84372ab689c91dd0d5b63cc2ee12ee3c466b"><code>03ca843</code></a> Bump maven-archiver from 3.5.1 to 3.5.2</li>
<li><a href="https://github.com/apache/maven-javadoc-plugin/commit/5dcfa6e70795d0b5cf5414a848e7e0aeb5541413"><code>5dcfa6e</code></a> Bump plexus-archiver from 4.2.6 to 4.2.7</li>
<li><a href="https://github.com/apache/maven-javadoc-plugin/commit/ca00601609903a0e88a067b2aa3d49e88191937a"><code>ca00601</code></a> Bump junit in /src/it/projects/MJAVADOC-498_modulepath</li>
<li><a href="https://github.com/apache/maven-javadoc-plugin/commit/2583554135dc04db58a435ebcbd2cd19f0d2563a"><code>2583554</code></a> Bump commons-io from 2.2 to 2.7 in /src/it/projects/MJAVADOC-437/module2</li>
<li><a href="https://github.com/apache/maven-javadoc-plugin/commit/9dd7bddb3db6d0d230092d7fbbd4188a98a3a75e"><code>9dd7bdd</code></a> use shared gh action/release-drafter (<a href="https://github-redirect.dependabot.com/apache/maven-javadoc-plugin/issues/128">#128</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.3.2...maven-javadoc-plugin-3.4.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=org.apache.maven.plugins:maven-javadoc-plugin&package-manager=maven&previous-version=3.3.2&new-version=3.4.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>


Patch:
diff --git a/pom.xml b/pom.xml
index 21fcc07..5c76279 100644
--- a/pom.xml
+++ b/pom.xml
@@ -156,7 +156,7 @@
       <plugin>
         <groupId>org.sonatype.plugins</groupId>
         <artifactId>nexus-staging-maven-plugin</artifactId>
-        <version>1.6.8</version>
+        <version>1.6.13</version>
         <extensions>true</extensions>
         <configuration>
           <serverId>ossrh</serverId>
@@ -189,7 +189,7 @@
           <plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-javadoc-plugin</artifactId>
-            <version>3.3.2</version>
+            <version>3.4.0</version>
             <configuration>
                     <doclint>none</doclint>
                     <detectJavaApiLink>false</detectJavaApiLink>
diff --git a/src/main/java/gumtree/spoon/builder/LabelFinder.java b/src/main/java/gumtree/spoon/builder/LabelFinder.java
index 53d10c4..053a1fe 100644
--- a/src/main/java/gumtree/spoon/builder/LabelFinder.java
+++ b/src/main/java/gumtree/spoon/builder/LabelFinder.java
@@ -21,6 +21,7 @@ import spoon.reflect.code.CtVariableAccess;
 import spoon.reflect.code.CtWhile;
 import spoon.reflect.declaration.CtAnnotation;
 import spoon.reflect.declaration.CtNamedElement;
+import spoon.reflect.declaration.CtType;
 import spoon.reflect.path.CtRole;
 import spoon.reflect.reference.CtTypeReference;
 import spoon.reflect.visitor.CtInheritanceScanner;
@@ -42,7 +43,16 @@ class LabelFinder extends CtInheritanceScanner {
 
 	@Override
 	public <T> void visitCtInvocation(CtInvocation<T> invocation) {
-		label = invocation.getExecutable().getSimpleName();
+		if (invocation.getExecutable().isConstructor()) {
+			CtType<?> parentType = invocation.getParent(CtType.class);
+			if (parentType.getQualifiedName().equals(invocation.getExecutable().getDeclaringType().getQualifiedName())) {
+				label = "this";
+			} else {
+				label = "super";
+			}
+		} else {
+			label = invocation.getExecutable().getSimpleName();
+		}
 	}
 
 	@Override


Test patch:
diff --git a/src/test/java/gumtree/spoon/AstComparatorTest.java b/src/test/java/gumtree/spoon/AstComparatorTest.java
index 73176b9..6255d00 100644
--- a/src/test/java/gumtree/spoon/AstComparatorTest.java
+++ b/src/test/java/gumtree/spoon/AstComparatorTest.java
@@ -2136,4 +2136,18 @@ public class AstComparatorTest {
 		assertEquals(deleteOpt.get().getNode().toString(), moveOpt.get().getNode().toString());
 
 	}
+
+	@Test
+	public void thisAndSuperShouldResultInAnASTDiff() {
+		// arrange
+		String c3 = "class X { public  X() { this(); } }";
+		String c4 = "class X { public X() { super();} }";
+		AstComparator comparator = new AstComparator();
+
+		// act
+		Diff diff = comparator.compare(c3, c4);
+
+		// assert
+		assertTrue(diff.containsOperations(OperationKind.Update, "Invocation", "this", "super"));
+	}
 }
diff --git a/src/test/resources/examples/spoon.json b/src/test/resources/examples/spoon.json
index 4e3ae8d..9412d85 100644
--- a/src/test/resources/examples/spoon.json
+++ b/src/test/resources/examples/spoon.json
@@ -262,7 +262,7 @@
               ]
             },
             {
-              "label": "\u003cinit\u003e",
+              "label": "super",
               "type": "Invocation",
               "children": [
                 {
@@ -2500,4 +2500,4 @@
       ]
     }
   ]
-}
+}
\ No newline at end of file