From 29c722dd77dbfefdd98c24afb0d58f87728a4864 Mon Sep 17 00:00:00 2001 From: Guillermo Calvo Date: Sat, 27 Jan 2024 01:07:35 +0100 Subject: [PATCH] Make classes implement `JApiHasChangeStatus` if they already do --- japicmp/src/main/java/japicmp/model/JApiAttribute.java | 3 ++- japicmp/src/main/java/japicmp/model/JApiClassType.java | 3 ++- japicmp/src/main/java/japicmp/model/JApiModifier.java | 3 ++- japicmp/src/main/java/japicmp/model/JApiReturnType.java | 3 ++- japicmp/src/main/java/japicmp/model/JApiType.java | 3 ++- .../main/java/japicmp/output/extapi/jpa/model/JpaName.java | 4 +++- 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/japicmp/src/main/java/japicmp/model/JApiAttribute.java b/japicmp/src/main/java/japicmp/model/JApiAttribute.java index 14bb9138f..79377adec 100644 --- a/japicmp/src/main/java/japicmp/model/JApiAttribute.java +++ b/japicmp/src/main/java/japicmp/model/JApiAttribute.java @@ -6,7 +6,7 @@ import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlTransient; -public class JApiAttribute { +public class JApiAttribute implements JApiHasChangeStatus { private final Optional oldAttribute; private final Optional newAttribute; private final JApiChangeStatus changeStatus; @@ -27,6 +27,7 @@ public Optional getNewAttribute() { return newAttribute; } + @Override @XmlAttribute(name = "changeStatus") public JApiChangeStatus getChangeStatus() { return changeStatus; diff --git a/japicmp/src/main/java/japicmp/model/JApiClassType.java b/japicmp/src/main/java/japicmp/model/JApiClassType.java index e21deb66a..d2b90ed8c 100644 --- a/japicmp/src/main/java/japicmp/model/JApiClassType.java +++ b/japicmp/src/main/java/japicmp/model/JApiClassType.java @@ -6,7 +6,7 @@ import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlTransient; -public class JApiClassType { +public class JApiClassType implements JApiHasChangeStatus { private final Optional oldTypeOptional; private final Optional newTypeOptional; private final JApiChangeStatus changeStatus; @@ -31,6 +31,7 @@ public String getNewType() { return OptionalHelper.optionalToString(newTypeOptional); } + @Override @XmlAttribute public JApiChangeStatus getChangeStatus() { return changeStatus; diff --git a/japicmp/src/main/java/japicmp/model/JApiModifier.java b/japicmp/src/main/java/japicmp/model/JApiModifier.java index 018d00fd0..296c4aec2 100644 --- a/japicmp/src/main/java/japicmp/model/JApiModifier.java +++ b/japicmp/src/main/java/japicmp/model/JApiModifier.java @@ -5,7 +5,7 @@ import javax.xml.bind.annotation.XmlAttribute; -public class JApiModifier { +public class JApiModifier implements JApiHasChangeStatus { private final Optional oldModifier; private final Optional newModifier; private final JApiChangeStatus changeStatus; @@ -24,6 +24,7 @@ public Optional getNewModifier() { return newModifier; } + @Override @XmlAttribute(name = "changeStatus") public JApiChangeStatus getChangeStatus() { return changeStatus; diff --git a/japicmp/src/main/java/japicmp/model/JApiReturnType.java b/japicmp/src/main/java/japicmp/model/JApiReturnType.java index 458c69bcc..80f59c2cb 100644 --- a/japicmp/src/main/java/japicmp/model/JApiReturnType.java +++ b/japicmp/src/main/java/japicmp/model/JApiReturnType.java @@ -9,7 +9,7 @@ import java.util.ArrayList; import java.util.List; -public class JApiReturnType implements JApiHasGenericTypes, JApiCompatibility { +public class JApiReturnType implements JApiHasGenericTypes, JApiHasChangeStatus, JApiCompatibility { private final Optional oldReturnTypeOptional; private final Optional newReturnTypeOptional; private final JApiChangeStatus changeStatus; @@ -23,6 +23,7 @@ public JApiReturnType(JApiChangeStatus changeStatus, Optional oldReturnT this.newReturnTypeOptional = newReturnTypeOptional; } + @Override @XmlAttribute(name = "changeStatus") public JApiChangeStatus getChangeStatus() { return changeStatus; diff --git a/japicmp/src/main/java/japicmp/model/JApiType.java b/japicmp/src/main/java/japicmp/model/JApiType.java index c0b8aebec..292321f4b 100644 --- a/japicmp/src/main/java/japicmp/model/JApiType.java +++ b/japicmp/src/main/java/japicmp/model/JApiType.java @@ -6,7 +6,7 @@ import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlTransient; -public class JApiType { +public class JApiType implements JApiHasChangeStatus { private final Optional oldTypeOptional; private final Optional newTypeOptional; private final JApiChangeStatus changeStatus; @@ -27,6 +27,7 @@ public Optional getNewTypeOptional() { return newTypeOptional; } + @Override @XmlAttribute(name = "changeStatus") public JApiChangeStatus getChangeStatus() { return changeStatus; diff --git a/japicmp/src/main/java/japicmp/output/extapi/jpa/model/JpaName.java b/japicmp/src/main/java/japicmp/output/extapi/jpa/model/JpaName.java index e0996ce8a..5af4cd0be 100644 --- a/japicmp/src/main/java/japicmp/output/extapi/jpa/model/JpaName.java +++ b/japicmp/src/main/java/japicmp/output/extapi/jpa/model/JpaName.java @@ -2,11 +2,12 @@ import japicmp.util.Optional; import japicmp.model.JApiChangeStatus; +import japicmp.model.JApiHasChangeStatus; import japicmp.util.OptionalHelper; import javax.xml.bind.annotation.XmlAttribute; -public class JpaName { +public class JpaName implements JApiHasChangeStatus { private final Optional newName; private final Optional oldName; private final JApiChangeStatus changeStatus; @@ -17,6 +18,7 @@ public JpaName(Optional oldName, Optional newName, JApiChangeSta this.changeStatus = changeStatus; } + @Override @XmlAttribute(name = "changeStatus") public JApiChangeStatus getChangeStatus() { return changeStatus;