From d2ee34234f88daa88c8777a8792a492bb8fde25c Mon Sep 17 00:00:00 2001 From: Kevin Klein Date: Fri, 2 Sep 2022 22:12:17 +0200 Subject: [PATCH 1/2] Fix exception that occurs when saving name formatters. --- CHANGELOG.md | 1 + .../logic/layout/format/NameFormatterPreferences.java | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 23f76110599..6dab8b181f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -107,6 +107,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - We fixed a bug where updating group view mode (intersection or union) requires re-selecting groups to take effect. [#6998](https://github.com/JabRef/jabref/issues/6998) - We fixed a bug that prevented external group metadata changes from being merged. [#8873](https://github.com/JabRef/jabref/issues/8873) - We fixed the shared database opening dialog to remember autosave folder and tick. [#7516](https://github.com/JabRef/jabref/issues/7516) +- We fixed an issue where name formatter could not be saved. [#9120](https://github.com/JabRef/jabref/issues/9120) ### Removed diff --git a/src/main/java/org/jabref/logic/layout/format/NameFormatterPreferences.java b/src/main/java/org/jabref/logic/layout/format/NameFormatterPreferences.java index 486f92abb5c..e4dd4e18028 100644 --- a/src/main/java/org/jabref/logic/layout/format/NameFormatterPreferences.java +++ b/src/main/java/org/jabref/logic/layout/format/NameFormatterPreferences.java @@ -1,18 +1,18 @@ package org.jabref.logic.layout.format; -import java.util.List; - import javafx.collections.FXCollections; import javafx.collections.ObservableList; +import java.util.List; + public class NameFormatterPreferences { private final ObservableList nameFormatterKey; private final ObservableList nameFormatterValue; public NameFormatterPreferences(List nameFormatterKey, List nameFormatterValue) { - this.nameFormatterKey = FXCollections.observableList(nameFormatterKey); - this.nameFormatterValue = FXCollections.observableList(nameFormatterValue); + this.nameFormatterKey = FXCollections.observableArrayList(nameFormatterKey); + this.nameFormatterValue = FXCollections.observableArrayList(nameFormatterValue); } public ObservableList getNameFormatterKey() { From 25441a088d6b1241c1383640d70dd298d5952159 Mon Sep 17 00:00:00 2001 From: Kevin Klein Date: Fri, 2 Sep 2022 22:34:53 +0200 Subject: [PATCH 2/2] Fix code style. --- .../jabref/logic/layout/format/NameFormatterPreferences.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/jabref/logic/layout/format/NameFormatterPreferences.java b/src/main/java/org/jabref/logic/layout/format/NameFormatterPreferences.java index e4dd4e18028..09f614f04e9 100644 --- a/src/main/java/org/jabref/logic/layout/format/NameFormatterPreferences.java +++ b/src/main/java/org/jabref/logic/layout/format/NameFormatterPreferences.java @@ -1,10 +1,10 @@ package org.jabref.logic.layout.format; +import java.util.List; + import javafx.collections.FXCollections; import javafx.collections.ObservableList; -import java.util.List; - public class NameFormatterPreferences { private final ObservableList nameFormatterKey;