Skip to content
Merged
  •  
  •  
  •  
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- We fixed an issue where JabRef put file paths as absolute path when an entry was created using drag and drop of a PDF file. [#11173](https://github.com/JabRef/jabref/issues/11173)
- We fixed an issue that online and offline mode for new library creation were handled incorrectly. [#11565](https://github.com/JabRef/jabref/pull/11565)
- We fixed an issue with colors in the search bar when dark theme is enabled. [#11569](https://github.com/JabRef/jabref/issues/11569)
- We fixed an issue with query transformers (JStor and others). [#11643](https://github.com/JabRef/jabref/pull/11643)
- We fixed an issue where a new unsaved library was not marked with an asterisk. [#11519](https://github.com/JabRef/jabref/pull/11519)
- We fixed an issue where JabRef starts without window decorations. [#11440](https://github.com/JabRef/jabref/pull/11440)

Expand Down
9 changes: 8 additions & 1 deletion rewrite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,13 @@ recipeList:
- org.openrewrite.staticanalysis.WhileInsteadOfFor
# - org.openrewrite.staticanalysis.WriteOctalValuesAsDecimal

# - org.openrewrite.java.testing.junit5.JUnit5BestPractices -- cannot be used directly, because one recipe is not working (see below)
- org.openrewrite.java.testing.cleanup.AssertLiteralBooleanToFailRecipe
- org.openrewrite.java.testing.cleanup.RemoveTestPrefix
# - org.openrewrite.java.testing.cleanup.TestsShouldNotBePublic -- does not work due to https://github.com/openrewrite/rewrite-testing-frameworks/issues/458
- org.openrewrite.java.testing.junit5.CleanupAssertions
# - org.openrewrite.java.testing.junit5.JUnit5BestPractices
- org.openrewrite.java.testing.junit5.AddParameterizedTestAnnotation
- org.openrewrite.java.testing.junit5.RemoveDuplicateTestTemplates
- org.openrewrite.java.testing.junit5.RemoveTryCatchFailBlocks
- org.openrewrite.java.testing.junit5.LifecycleNonPrivate
- org.openrewrite.java.testing.junit5.StaticImports
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ protected String handleJournal(String journalTitle) {

@Override
protected String handleYear(String year) {
return "sd:" + year + getLogicalAndOperator() + "ed: " + year;
return "sd:" + year + getLogicalAndOperator() + "ed:" + year;
}

@Override
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/org/jabref/IconsPropertiesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;

public class IconsPropertiesTest {
class IconsPropertiesTest {

@Test
public void existenceOfIconImagesReferencedFromIconsProperties() throws IOException {
void existenceOfIconImagesReferencedFromIconsProperties() throws IOException {
String folder = "src/main/resources/images/external";
String iconsProperties = "Icons.properties";
String iconsPropertiesPath = "src/main/resources/images/" + iconsProperties;
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/org/jabref/cli/AuxCommandLineTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.mockito.Mockito.mock;

public class AuxCommandLineTest {
class AuxCommandLineTest {

private ImportFormatPreferences importFormatPreferences;

@BeforeEach
public void setUp() throws Exception {
void setUp() throws Exception {
importFormatPreferences = mock(ImportFormatPreferences.class, Answers.RETURNS_DEEP_STUBS);
}

@Test
public void test() throws URISyntaxException, IOException {
void test() throws URISyntaxException, IOException {
InputStream originalStream = AuxCommandLineTest.class.getResourceAsStream("origin.bib");

File auxFile = Path.of(AuxCommandLineTest.class.getResource("paper.aux").toURI()).toFile();
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/org/jabref/gui/ClipBoardManagerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import static org.mockito.Mockito.when;

@AllowedToUseAwt("Requires AWT for clipboard access")
public class ClipBoardManagerTest {
class ClipBoardManagerTest {

private BibEntryTypesManager entryTypesManager;
private ClipBoardManager clipBoardManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import static org.junit.jupiter.api.Assertions.assertEquals;

public class AppendPersonNamesStrategyTest {
class AppendPersonNamesStrategyTest {

@Test
void withoutParam() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;

public class ContentSelectorSuggestionProviderTest {
class ContentSelectorSuggestionProviderTest {

private ContentSelectorSuggestionProvider autoCompleter;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import static org.junit.jupiter.api.Assertions.assertEquals;

public class PersonNameStringConverterTest {
class PersonNameStringConverterTest {

/** The author. **/
private Author author;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class SuggestionProvidersTest {
private SuggestionProviders suggestionProviders;

@BeforeEach
public void initializeSuggestionProviders() {
void initializeSuggestionProviders() {
BibDatabase database = new BibDatabase();
JournalAbbreviationRepository abbreviationRepository = mock(JournalAbbreviationRepository.class);
Set<Field> completeFields = Set.of(StandardField.AUTHOR, StandardField.XREF, StandardField.XDATA, StandardField.JOURNAL, StandardField.PUBLISHER, SpecialField.PRINTED);
Expand Down Expand Up @@ -57,7 +57,7 @@ private static Stream<Arguments> getTestPairs() {

@ParameterizedTest
@MethodSource("getTestPairs")
public void appropriateCompleterReturned(Class<SuggestionProvider<BibEntry>> expected, Field field) {
void appropriateCompleterReturned(Class<SuggestionProvider<BibEntry>> expected, Field field) {
assertEquals(expected, suggestionProviders.getForField(field).getClass());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class BackupManagerDiscardedTest {
private Path backupDir;

@BeforeEach
public void setup(@TempDir Path tempDir) throws Exception {
void setup(@TempDir Path tempDir) throws Exception {
this.backupDir = tempDir.resolve("backups");
Files.createDirectories(backupDir);

Expand Down Expand Up @@ -85,22 +85,22 @@ private void makeBackup() {
}

@Test
public void noDiscardingAChangeLeadsToNewerBackupBeReported() throws Exception {
void noDiscardingAChangeLeadsToNewerBackupBeReported() throws Exception {
databaseModification();
makeBackup();
assertTrue(BackupManager.backupFileDiffers(testBib, backupDir));
}

@Test
public void noDiscardingASavedChange() throws Exception {
void noDiscardingASavedChange() throws Exception {
databaseModification();
makeBackup();
saveDatabase();
assertFalse(BackupManager.backupFileDiffers(testBib, backupDir));
}

@Test
public void discardingAChangeLeadsToNewerBackupToBeIgnored() throws Exception {
void discardingAChangeLeadsToNewerBackupToBeIgnored() throws Exception {
databaseModification();
makeBackup();
backupManager.discardBackup(backupDir);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

public class BackupManagerTest {
class BackupManagerTest {

Path backupDir;

Expand All @@ -43,7 +43,7 @@ void setup(@TempDir Path tempDir) {
}

@Test
public void backupFileNameIsCorrectlyGeneratedInAppDataDirectory() {
void backupFileNameIsCorrectlyGeneratedInAppDataDirectory() {
Path bibPath = Path.of("tmp", "test.bib");
backupDir = OS.getNativeDesktop().getBackupDirectory();
Path bakPath = BackupManager.getBackupPathForNewBackup(bibPath, backupDir);
Expand All @@ -53,13 +53,13 @@ public void backupFileNameIsCorrectlyGeneratedInAppDataDirectory() {
}

@Test
public void backupFileIsEqualForNonExistingBackup() throws Exception {
void backupFileIsEqualForNonExistingBackup() throws Exception {
Path originalFile = Path.of(BackupManagerTest.class.getResource("no-autosave.bib").toURI());
assertFalse(BackupManager.backupFileDiffers(originalFile, backupDir));
}

@Test
public void backupFileIsEqual() throws Exception {
void backupFileIsEqual() throws Exception {
// Prepare test: Create backup file on "right" path
Path source = Path.of(BackupManagerTest.class.getResource("no-changes.bib.bak").toURI());
Path target = BackupFileUtil.getPathForNewBackupFileAndCreateDirectory(Path.of(BackupManagerTest.class.getResource("no-changes.bib").toURI()), BackupFileType.BACKUP, backupDir);
Expand All @@ -70,7 +70,7 @@ public void backupFileIsEqual() throws Exception {
}

@Test
public void backupFileDiffers() throws Exception {
void backupFileDiffers() throws Exception {
// Prepare test: Create backup file on "right" path
Path source = Path.of(BackupManagerTest.class.getResource("changes.bib.bak").toURI());
Path target = BackupFileUtil.getPathForNewBackupFileAndCreateDirectory(Path.of(BackupManagerTest.class.getResource("changes.bib").toURI()), BackupFileType.BACKUP, backupDir);
Expand All @@ -81,7 +81,7 @@ public void backupFileDiffers() throws Exception {
}

@Test
public void correctBackupFileDeterminedForMultipleBakFiles() throws Exception {
void correctBackupFileDeterminedForMultipleBakFiles() throws Exception {
Path noChangesBib = Path.of(BackupManagerTest.class.getResource("no-changes.bib").toURI());
Path noChangesBibBak = Path.of(BackupManagerTest.class.getResource("no-changes.bib.bak").toURI());

Expand All @@ -105,7 +105,7 @@ public void correctBackupFileDeterminedForMultipleBakFiles() throws Exception {
}

@Test
public void bakFileWithNewerTimeStampLeadsToDiff() throws Exception {
void bakFileWithNewerTimeStampLeadsToDiff() throws Exception {
Path changesBib = Path.of(BackupManagerTest.class.getResource("changes.bib").toURI());
Path changesBibBak = Path.of(BackupManagerTest.class.getResource("changes.bib.bak").toURI());

Expand All @@ -116,7 +116,7 @@ public void bakFileWithNewerTimeStampLeadsToDiff() throws Exception {
}

@Test
public void bakFileWithOlderTimeStampDoesNotLeadToDiff() throws Exception {
void bakFileWithOlderTimeStampDoesNotLeadToDiff() throws Exception {
Path changesBib = Path.of(BackupManagerTest.class.getResource("changes.bib").toURI());
Path changesBibBak = Path.of(BackupManagerTest.class.getResource("changes.bib.bak").toURI());

Expand All @@ -130,7 +130,7 @@ public void bakFileWithOlderTimeStampDoesNotLeadToDiff() throws Exception {
}

@Test
public void shouldNotCreateABackup(@TempDir Path customDir) throws Exception {
void shouldNotCreateABackup(@TempDir Path customDir) throws Exception {
Path backupDir = customDir.resolve("subBackupDir");
Files.createDirectories(backupDir);

Expand All @@ -157,7 +157,7 @@ public void shouldNotCreateABackup(@TempDir Path customDir) throws Exception {
}

@Test
public void shouldCreateABackup(@TempDir Path customDir) throws Exception {
void shouldCreateABackup(@TempDir Path customDir) throws Exception {
Path backupDir = customDir.resolve("subBackupDir");
Files.createDirectories(backupDir);

Expand Down
24 changes: 12 additions & 12 deletions src/test/java/org/jabref/gui/edit/CopyMoreActionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

public class CopyMoreActionTest {
class CopyMoreActionTest {

private final DialogService dialogService = spy(DialogService.class);
private final ClipBoardManager clipBoardManager = mock(ClipBoardManager.class);
Expand All @@ -48,7 +48,7 @@ public class CopyMoreActionTest {
private BibEntry entry;

@BeforeEach
public void setUp() {
void setUp() {
String title = "A tale from the trenches";
entry = new BibEntry(StandardEntryType.Misc)
.withField(StandardField.AUTHOR, "Souti Chattopadhyay and Nicholas Nelson and Audrey Au and Natalia Morales and Christopher Sanchez and Rahul Pandita and Anita Sarma")
Expand All @@ -67,7 +67,7 @@ public void setUp() {
}

@Test
public void executeOnFail() {
void executeOnFail() {
when(stateManager.getActiveDatabase()).thenReturn(Optional.empty());
when(stateManager.getSelectedEntries()).thenReturn(FXCollections.emptyObservableList());
copyMoreAction = new CopyMoreAction(StandardActions.COPY_TITLE, dialogService, stateManager, clipBoardManager, preferencesService, abbreviationRepository);
Expand All @@ -78,7 +78,7 @@ public void executeOnFail() {
}

@Test
public void executeCopyTitleWithNoTitle() {
void executeCopyTitleWithNoTitle() {
BibEntry entryWithNoTitle = (BibEntry) entry.clone();
entryWithNoTitle.clearField(StandardField.TITLE);
ObservableList<BibEntry> entriesWithNoTitles = FXCollections.observableArrayList(entryWithNoTitle);
Expand All @@ -94,7 +94,7 @@ public void executeCopyTitleWithNoTitle() {
}

@Test
public void executeCopyTitleOnPartialSuccess() {
void executeCopyTitleOnPartialSuccess() {
BibEntry entryWithNoTitle = (BibEntry) entry.clone();
entryWithNoTitle.clearField(StandardField.TITLE);
ObservableList<BibEntry> mixedEntries = FXCollections.observableArrayList(entryWithNoTitle, entry);
Expand All @@ -112,7 +112,7 @@ public void executeCopyTitleOnPartialSuccess() {
}

@Test
public void executeCopyTitleOnSuccess() {
void executeCopyTitleOnSuccess() {
ObservableList<BibEntry> entriesWithTitles = FXCollections.observableArrayList(entry);
BibDatabaseContext databaseContext = new BibDatabaseContext(new BibDatabase(entriesWithTitles));

Expand All @@ -128,7 +128,7 @@ public void executeCopyTitleOnSuccess() {
}

@Test
public void executeCopyKeyWithNoKey() {
void executeCopyKeyWithNoKey() {
BibEntry entryWithNoKey = (BibEntry) entry.clone();
entryWithNoKey.clearCiteKey();
ObservableList<BibEntry> entriesWithNoKeys = FXCollections.observableArrayList(entryWithNoKey);
Expand All @@ -144,7 +144,7 @@ public void executeCopyKeyWithNoKey() {
}

@Test
public void executeCopyKeyOnPartialSuccess() {
void executeCopyKeyOnPartialSuccess() {
BibEntry entryWithNoKey = (BibEntry) entry.clone();
entryWithNoKey.clearCiteKey();
ObservableList<BibEntry> mixedEntries = FXCollections.observableArrayList(entryWithNoKey, entry);
Expand All @@ -162,7 +162,7 @@ public void executeCopyKeyOnPartialSuccess() {
}

@Test
public void executeCopyKeyOnSuccess() {
void executeCopyKeyOnSuccess() {
ObservableList<BibEntry> entriesWithKeys = FXCollections.observableArrayList(entry);
BibDatabaseContext databaseContext = new BibDatabaseContext(new BibDatabase(entriesWithKeys));

Expand All @@ -178,7 +178,7 @@ public void executeCopyKeyOnSuccess() {
}

@Test
public void executeCopyDoiWithNoDoi() {
void executeCopyDoiWithNoDoi() {
BibEntry entryWithNoDoi = (BibEntry) entry.clone();
entryWithNoDoi.clearField(StandardField.DOI);
ObservableList<BibEntry> entriesWithNoDois = FXCollections.observableArrayList(entryWithNoDoi);
Expand All @@ -194,7 +194,7 @@ public void executeCopyDoiWithNoDoi() {
}

@Test
public void executeCopyDoiOnPartialSuccess() {
void executeCopyDoiOnPartialSuccess() {
BibEntry entryWithNoDoi = (BibEntry) entry.clone();
entryWithNoDoi.clearField(StandardField.DOI);
ObservableList<BibEntry> mixedEntries = FXCollections.observableArrayList(entryWithNoDoi, entry);
Expand All @@ -212,7 +212,7 @@ public void executeCopyDoiOnPartialSuccess() {
}

@Test
public void executeCopyDoiOnSuccess() {
void executeCopyDoiOnSuccess() {
ObservableList<BibEntry> entriesWithDois = FXCollections.observableArrayList(entry);
BibDatabaseContext databaseContext = new BibDatabaseContext(new BibDatabase(entriesWithDois));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.Mockito.mock;

public class CopyOrMoveFieldContentTabViewModelTest {
class CopyOrMoveFieldContentTabViewModelTest {
CopyOrMoveFieldContentTabViewModel copyOrMoveFieldContentTabViewModel;
BibEntry entryA;
BibEntry entryB;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.mockito.Mockito.mock;

public class EditFieldContentTabViewModelTest {
class EditFieldContentTabViewModelTest {
EditFieldContentViewModel editFieldContentViewModel;
BibEntry entryA;
BibEntry entryB;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

public class ManageKeywordsViewModelTest {
class ManageKeywordsViewModelTest {

private final BibEntryPreferences bibEntryPreferences = mock(BibEntryPreferences.class);
private ManageKeywordsViewModel keywordsViewModel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.Mockito.mock;

public class RenameFieldViewModelTest {
class RenameFieldViewModelTest {
RenameFieldViewModel renameFieldViewModel;
BibEntry entryA;
BibEntry entryB;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

public class ReplaceStringViewModelTest {
class ReplaceStringViewModelTest {

private final LibraryTab libraryTab = mock(LibraryTab.class);
private ReplaceStringViewModel viewModel;
Expand Down
Loading