diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e4cfe3ac8a..ce6c7c162aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,7 +33,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - The global default directory for storing PDFs is now the subdirectory "JabRef" in the user's home. - We reworked the Define study parameters dialog. [#9123](https://github.com/JabRef/jabref/pull/9123) - We simplified the actions to fast-resolve duplicates to 'Keep Left', 'Keep Right', 'Keep Both' and 'Keep Merged'. [#9056](https://github.com/JabRef/jabref/issues/9056) - +- We fixed an issue where a message about changed metadata would occur on saving although nothing changed [#9159](https://github.com/JabRef/jabref/issues/9159) ### Fixed diff --git a/src/main/java/org/jabref/logic/cleanup/FieldFormatterCleanup.java b/src/main/java/org/jabref/logic/cleanup/FieldFormatterCleanup.java index 0d1cf5c5ad6..1594bdb4aab 100644 --- a/src/main/java/org/jabref/logic/cleanup/FieldFormatterCleanup.java +++ b/src/main/java/org/jabref/logic/cleanup/FieldFormatterCleanup.java @@ -105,15 +105,15 @@ public Formatter getFormatter() { } @Override - public boolean equals(Object o) { - if (this == o) { + public boolean equals(Object obj) { + if (this == obj) { return true; } - if (o instanceof FieldFormatterCleanup) { - FieldFormatterCleanup that = (FieldFormatterCleanup) o; - return Objects.equals(field, that.field) && Objects.equals(formatter, that.formatter); + if (!(obj instanceof FieldFormatterCleanup)) { + return false; } - return false; + FieldFormatterCleanup other = (FieldFormatterCleanup) obj; + return Objects.equals(field, other.field) && Objects.equals(formatter, other.formatter); } @Override diff --git a/src/main/java/org/jabref/logic/cleanup/FieldFormatterCleanups.java b/src/main/java/org/jabref/logic/cleanup/FieldFormatterCleanups.java index ce53b68d144..153ee3be486 100644 --- a/src/main/java/org/jabref/logic/cleanup/FieldFormatterCleanups.java +++ b/src/main/java/org/jabref/logic/cleanup/FieldFormatterCleanups.java @@ -206,4 +206,26 @@ private static Formatter getFormatterFromString(String formatterName) { } return new IdentityFormatter(); } + + @Override + public int hashCode() { + return Objects.hash(actions, enabled); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof FieldFormatterCleanups)) { + return false; + } + FieldFormatterCleanups other = (FieldFormatterCleanups) obj; + return Objects.equals(actions, other.actions) && (enabled == other.enabled); + } + + @Override + public String toString() { + return "FieldFormatterCleanups [enabled=" + enabled + ", actions=" + actions + "]"; + } } diff --git a/src/main/java/org/jabref/model/metadata/ContentSelector.java b/src/main/java/org/jabref/model/metadata/ContentSelector.java index 1d51a893aa9..d2c633f6396 100644 --- a/src/main/java/org/jabref/model/metadata/ContentSelector.java +++ b/src/main/java/org/jabref/model/metadata/ContentSelector.java @@ -26,7 +26,7 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (o == null || getClass() != o.getClass()) { + if ((o == null) || (getClass() != o.getClass())) { return false; } @@ -35,6 +35,11 @@ public boolean equals(Object o) { Objects.equals(values, that.values); } + @Override + public String toString() { + return "ContentSelector [field=" + field + ", values=" + values + "]"; + } + @Override public int hashCode() { return Objects.hash(field, values); diff --git a/src/main/java/org/jabref/model/metadata/MetaData.java b/src/main/java/org/jabref/model/metadata/MetaData.java index 9b0ed2ae856..1ef1a0976b1 100644 --- a/src/main/java/org/jabref/model/metadata/MetaData.java +++ b/src/main/java/org/jabref/model/metadata/MetaData.java @@ -375,7 +375,14 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(groupsRoot.getValue(), encoding, encodingExplicitlySupplied, saveOrderConfig, citeKeyPatterns, userFileDirectory, - defaultCiteKeyPattern, saveActions, mode, isProtected, defaultFileDirectory); + return Objects.hash(isProtected, groupsRoot.getValue(), encoding, encodingExplicitlySupplied, saveOrderConfig, citeKeyPatterns, userFileDirectory, + laTexFileDirectory, defaultCiteKeyPattern, saveActions, mode, defaultFileDirectory, contentSelectors); } + + @Override + public String toString() { + return "MetaData [citeKeyPatterns=" + citeKeyPatterns + ", userFileDirectory=" + userFileDirectory + ", laTexFileDirectory=" + laTexFileDirectory + ", groupsRoot=" + groupsRoot + ", encoding=" + encoding + ", saveOrderConfig=" + saveOrderConfig + ", defaultCiteKeyPattern=" + defaultCiteKeyPattern + ", saveActions=" + saveActions + ", mode=" + mode + ", isProtected=" + isProtected + ", defaultFileDirectory=" + defaultFileDirectory + ", contentSelectors=" + contentSelectors + ", encodingExplicitlySupplied=" + encodingExplicitlySupplied + "]"; + } + + }