anon-iclr-submission/benchname-bug-localization huggingface dataset:
Repository: jabref/jabref
Issue: Preferences / entry types doesn't register changes

### JabRef version

Latest development branch build (please note build date below)

### Operating system

GNU / Linux

### Details on version and operating system

Linux Mint 21.1 with Cinnamon

### Checked with the latest development build

- [X] I made a backup of my libraries before testing the latest development version.
- [X] I have tested the latest development version and the problem persists

### Steps to reproduce the behaviour

JabRef 5.10--2023-04-24--b599690
Linux 5.15.0-71-generic amd64 
Java 20.0.1 
JavaFX 20+19

1. File / Preferences / Entry types
2.  Select, e.g., "book"
3.  Click "required" for "Address"; also add some required fields like DOI, eprint, etc.
4. Save.
5. Have a look, close open, check again.  The selections at step 3 is forgotten.


### Appendix

_No response_

Changed files:
src/main/java/org/jabref/preferences/JabRefPreferences.java

diff --git a/src/main/java/org/jabref/preferences/JabRefPreferences.java b/src/main/java/org/jabref/preferences/JabRefPreferences.java
index bbc182f949..962bec1143 100644
--- a/src/main/java/org/jabref/preferences/JabRefPreferences.java
+++ b/src/main/java/org/jabref/preferences/JabRefPreferences.java
@@ -1206,8 +1206,8 @@ public class JabRefPreferences implements PreferencesService {
     @Override
     public void storeCustomEntryTypesRepository(BibEntryTypesManager entryTypesManager) {
         clearAllBibEntryTypes();
-        storeBibEntryTypes(entryTypesManager.getAllCustomTypes(BibDatabaseMode.BIBTEX), BibDatabaseMode.BIBTEX);
-        storeBibEntryTypes(entryTypesManager.getAllCustomTypes(BibDatabaseMode.BIBLATEX), BibDatabaseMode.BIBLATEX);
+        storeBibEntryTypes(entryTypesManager.getAllTypes(BibDatabaseMode.BIBTEX), BibDatabaseMode.BIBTEX);
+        storeBibEntryTypes(entryTypesManager.getAllTypes(BibDatabaseMode.BIBLATEX), BibDatabaseMode.BIBLATEX);
     }
 
     private void storeBibEntryTypes(Collection<BibEntryType> bibEntryTypes, BibDatabaseMode bibDatabaseMode) {
Repository: jabref/jabref
Issue: File Annoation Tab gives NPE when PDF is not avaiable

Entry with linked PDF:
` file          = {:Arellano2015 - Natural Language Processing of Textual Requirements.pdf:PDF},`
but the PDF is not available/existing in the folder.

Switch to Tab File Annotations: NPE exception comes:
```
java.lang.NullPointerException: null
	at org.jabref.gui.entryeditor.FileAnnotationTab.updateShownAnnotations(FileAnnotationTab.java:130) ~[bin/:?]
	at org.jabref.gui.entryeditor.FileAnnotationTab.addAnnotations(FileAnnotationTab.java:114) ~[bin/:?]
	at org.jabref.gui.entryeditor.FileAnnotationTab.initializeTab(FileAnnotationTab.java:89) ~[bin/:?]
	at org.jabref.gui.entryeditor.EntryEditor$TabListener.lambda$0(EntryEditor.java:1155) ~[bin/:?]
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311) ~[?:1.8.0_121]
```

Changed files:
src/main/java/org/jabref/gui/entryeditor/FileAnnotationTab.java

diff --git a/src/main/java/org/jabref/gui/entryeditor/FileAnnotationTab.java b/src/main/java/org/jabref/gui/entryeditor/FileAnnotationTab.java
index 7c6901c310..14483cec7b 100644
--- a/src/main/java/org/jabref/gui/entryeditor/FileAnnotationTab.java
+++ b/src/main/java/org/jabref/gui/entryeditor/FileAnnotationTab.java
@@ -127,7 +127,7 @@ class FileAnnotationTab extends JPanel {
      */
     private void updateShownAnnotations(List<FileAnnotation> annotations) {
         listModel.clear();
-        if (annotations.isEmpty()) {
+        if (annotations == null || annotations.isEmpty()) {
             listModel.addElement(new FileAnnotation("", LocalDateTime.now(), 0, Localization.lang("File has no attached annotations"), NONE, Optional.empty()));
         } else {
             Comparator<FileAnnotation> byPage = Comparator.comparingInt(FileAnnotation::getPage);
Repository: jabref/jabref
Issue: Import from external database fails for 3.1 and PostgreSQL

Hi,

Just tried out 3.1.  Thank you for all of the enhancements, especially the new look!.

I tried to import from an existing database but it failed with the following error in a pop-up window:

"Could not import from SQL database for the following reason:
java.util.ConcurrentModificationException"

There were no obvious command line messages.  I used ./gradlew run to test.

Cheers,

Fred


Changed files:
src/main/java/net/sf/jabref/sql/importer/DBImporter.java

diff --git a/src/main/java/net/sf/jabref/sql/importer/DBImporter.java b/src/main/java/net/sf/jabref/sql/importer/DBImporter.java
index cf8d75355f..f5ff766ce1 100644
--- a/src/main/java/net/sf/jabref/sql/importer/DBImporter.java
+++ b/src/main/java/net/sf/jabref/sql/importer/DBImporter.java
@@ -21,6 +21,7 @@ import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Statement;
 import java.util.*;
+import java.util.stream.Collectors;
 
 import net.sf.jabref.bibtex.EntryTypes;
 import net.sf.jabref.model.entry.*;
@@ -104,12 +105,7 @@ public abstract class DBImporter extends DBImporterExporter {
                         rsEntryType.getStatement().close();
                     }
 
-                    List<String> colNames = this.readColumnNames(conn);
-                    for (String next : colNames) {
-                        if (!columnsNotConsideredForEntries.contains(next)) {
-                            colNames.add(next);
-                        }
-                    }
+                    List<String> colNames = this.readColumnNames(conn).stream().filter(column -> !columnsNotConsideredForEntries.contains(column)).collect(Collectors.toList());
 
                     String database_id = rsDatabase.getString("database_id");
                     // Read the entries and create BibEntry instances: