Repository: SpoonLabs/gumtree-spoon-ast-diff
Pull request #236 (2022-03-11 09:03:52)

Bump maven-compiler-plugin from 3.10.0 to 3.10.1
Bumps [maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin) from 3.10.0 to 3.10.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/apache/maven-compiler-plugin/releases">maven-compiler-plugin's releases</a>.</em></p>
<blockquote>
<h2>3.10.1</h2>
<!-- raw HTML omitted -->
<h2>🚀 New features and improvements</h2>
<ul>
<li><a href="https://issues.apache.org/jira/browse/MCOMPILER-426">[MCOMPILER-426]</a> - add flag to enable-preview java compiler feature (<a href="https://github-redirect.dependabot.com/apache/maven-compiler-plugin/issues/98">#98</a>) <a href="https://github.com/olamy"><code>@​olamy</code></a></li>
</ul>
<h2>🐛 Bug Fixes</h2>
<ul>
<li><a href="https://issues.apache.org/jira/browse/MCOMPILER-346">[MCOMPILER-346]</a> - workaround to jdk bug: assertion error from javaxcompiler javax.tools API (<a href="https://github-redirect.dependabot.com/apache/maven-compiler-plugin/issues/97">#97</a>) <a href="https://github.com/olamy"><code>@​olamy</code></a></li>
<li><a href="https://issues.apache.org/jira/browse/MCOMPILER-485">[MCOMPILER-485]</a> - Fixes internal string format in generated package-info.class (<a href="https://github-redirect.dependabot.com/apache/maven-compiler-plugin/issues/95">#95</a>) <a href="https://github.com/dbwiddis"><code>@​dbwiddis</code></a></li>
</ul>
<h2>📦 Dependency updates</h2>
<ul>
<li>Bump maven-javadoc-plugin from 3.3.1 to 3.3.2 (<a href="https://github-redirect.dependabot.com/apache/maven-compiler-plugin/issues/94">#94</a>) <a href="https://github.com/dependabot"><code>@​dependabot</code></a></li>
</ul>
<h2>Other contributions</h2>
<ul>
<li>thanks to <a href="https://github.com/basil"><code>@​basil</code></a> for providing an IT test for the fix of <a href="https://issues.apache.org/jira/browse/MCOMPILER-346">[MCOMPILER-346]</a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/apache/maven-compiler-plugin/commit/4e08e2b9518fbbda7252236315b2ce03edcef505"><code>4e08e2b</code></a> [maven-release-plugin] prepare release maven-compiler-plugin-3.10.1</li>
<li><a href="https://github.com/apache/maven-compiler-plugin/commit/6795b0f508343dbc64dba384b85af2f1f3684b7a"><code>6795b0f</code></a> [MCOMPILER-426] add flag to enable-preview java compiler feature (<a href="https://github-redirect.dependabot.com/apache/maven-compiler-plugin/issues/98">#98</a>)</li>
<li><a href="https://github.com/apache/maven-compiler-plugin/commit/1de8c91fba76fc345dca64cea300839bef436cba"><code>1de8c91</code></a> MCOMPILER 346 workaround to jdk bug: assertion error from javaxcompiler javax...</li>
<li><a href="https://github.com/apache/maven-compiler-plugin/commit/96ed94f5bcc0de6b6bd36816ce5caf3100dcd840"><code>96ed94f</code></a> use shared release drafter</li>
<li><a href="https://github.com/apache/maven-compiler-plugin/commit/fa80028166ffde859b1a1e20547701a9bed34d54"><code>fa80028</code></a> [MCOMPILER-485] Fixes internal string format in generated package-info.class ...</li>
<li><a href="https://github.com/apache/maven-compiler-plugin/commit/f605c0f52f20bf80c7473ec642474ba4fc028d4c"><code>f605c0f</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/apache/maven-compiler-plugin/issues/94">#94</a> from apache/dependabot/maven/org.apache.maven.plugins-...</li>
<li><a href="https://github.com/apache/maven-compiler-plugin/commit/4a54a9a01486e3c806518df56204cb1528545bb9"><code>4a54a9a</code></a> Bump maven-javadoc-plugin from 3.3.1 to 3.3.2</li>
<li><a href="https://github.com/apache/maven-compiler-plugin/commit/87b5a7ff8aef572238f8ccef7d213ea0772ce49d"><code>87b5a7f</code></a> [maven-release-plugin] prepare for next development iteration</li>
<li>See full diff in <a href="https://github.com/apache/maven-compiler-plugin/compare/maven-compiler-plugin-3.10.0...maven-compiler-plugin-3.10.1">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-compiler-plugin&package-manager=maven&previous-version=3.10.0&new-version=3.10.1)](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 a5cd641..344cc99 100644
--- a/pom.xml
+++ b/pom.xml
@@ -36,7 +36,7 @@
     <dependency>
       <groupId>fr.inria.gforge.spoon</groupId>
       <artifactId>spoon-core</artifactId>
-      <version>10.0.0</version>
+      <version>10.1.1</version>
     </dependency>
     <dependency>
       <groupId>com.github.gumtreediff</groupId>
@@ -94,7 +94,7 @@
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-compiler-plugin</artifactId>
-        <version>3.10.0</version>
+        <version>3.10.1</version>
         <configuration>
           <source>${java.src.version}</source>
           <target>${java.src.version}</target>
@@ -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