Skip to content

Commit f3cfa49

Browse files
subhramitkoppor
andauthored
Reformat codebase (more carefully) (#13885)
* Fix non record comments by carl # Conflicts: # jabgui/src/main/java/org/jabref/gui/edit/automaticfiededitor/MoveFieldValueAction.java # jabgui/src/main/java/org/jabref/gui/mergeentries/threewaymerge/cell/sidebuttons/ToggleMergeUnmergeButton.java # jabgui/src/main/java/org/jabref/gui/mergeentries/threewaymerge/fieldsmerger/CommentMerger.java # jabgui/src/main/java/org/jabref/gui/mergeentries/threewaymerge/fieldsmerger/FieldMerger.java # jabgui/src/main/java/org/jabref/gui/mergeentries/threewaymerge/fieldsmerger/FileMerger.java # jabgui/src/main/java/org/jabref/gui/mergeentries/threewaymerge/fieldsmerger/GroupMerger.java # jabgui/src/main/java/org/jabref/gui/mergeentries/threewaymerge/fieldsmerger/KeywordMerger.java # jablib/src/main/java/org/jabref/logic/layout/format/HTMLChars.java # jablib/src/main/java/org/jabref/model/entry/identifier/ArXivIdentifier.java # jablib/src/main/java/org/jabref/model/entry/identifier/EprintIdentifier.java * Add file exceptions * Remove shebang line * Remove shebang line * Remove shebang line * Expand variables & rename class --------- Co-authored-by: Oliver Kopp <[email protected]>
1 parent 2fc4da5 commit f3cfa49

File tree

605 files changed

+6327
-5447
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

605 files changed

+6327
-5447
lines changed

build-support/src/main/java/CitationStyleCatalogGenerator.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
///usr/bin/env jbang "$0" "$@" ; exit $?
2-
31
//JAVA 24
42
//RUNTIME_OPTIONS --enable-native-access=ALL-UNNAMED
53

build-support/src/main/java/JournalListMvGenerator.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
///usr/bin/env jbang "$0" "$@" ; exit $?
2-
31
//JAVA 24
42
//RUNTIME_OPTIONS --enable-native-access=ALL-UNNAMED
53

@@ -44,7 +42,6 @@
4442
import org.slf4j.Logger;
4543
import org.slf4j.LoggerFactory;
4644

47-
4845
/// Has to be started in the root of the repository due to <https://github.com/jbangdev/jbang-gradle-plugin/issues/11>
4946
public class JournalListMvGenerator {
5047

build-support/src/main/java/LtwaListMvGenerator.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
///usr/bin/env jbang "$0" "$@" ; exit $?
2-
31
//JAVA 24
42
//RUNTIME_OPTIONS --enable-native-access=ALL-UNNAMED
53

config/IntelliJ Code Style.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
<option name="SOFT_MARGINS" value="120" />
44
<option name="DO_NOT_FORMAT">
55
<list>
6-
<fileSet type="globPattern" pattern=".jbang/*.java" />
6+
<fileSet type="globPattern" pattern=".jbang/*.java" />
7+
<fileSet type="globPattern" pattern="AutoCompletionTextInputBinding.java" />
8+
<fileSet type="globPattern" pattern="SuggestionProvider.java" />
79
</list>
810
</option>
911
<JavaCodeStyleSettings>
@@ -304,4 +306,4 @@
304306
</rules>
305307
</arrangement>
306308
</codeStyleSettings>
307-
</code_scheme>
309+
</code_scheme>

jabgui/src/main/java/org/jabref/Launcher.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ public static void initLogging(String[] args) {
110110
// We must configure logging as soon as possible, which is why we cannot wait for the usual
111111
// argument parsing workflow to parse logging options e.g. --debug
112112
Level logLevel = Arrays.stream(args).anyMatch("--debug"::equalsIgnoreCase)
113-
? Level.DEBUG
114-
: Level.INFO;
113+
? Level.DEBUG
114+
: Level.INFO;
115115

116116
// addLogToDisk
117117
// We cannot use `Injector.instantiateModelOrService(BuildInfo.class).version` here, because this initializes logging

jabgui/src/main/java/org/jabref/cli/CliImportHelper.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ public class CliImportHelper {
3030
* @param location URL or file path to import
3131
*/
3232
public static Optional<ParserResult> importFile(String location,
33-
CliPreferences cliPreferences,
34-
boolean porcelain) {
33+
CliPreferences cliPreferences,
34+
boolean porcelain) {
3535
LOGGER.debug("Importing file from locaiton {}", location);
3636
String[] data = location.split(",");
3737

@@ -42,7 +42,7 @@ public static Optional<ParserResult> importFile(String location,
4242
try {
4343
file = new URLDownload(address).toTemporaryFile();
4444
} catch (FetcherException |
45-
MalformedURLException e) {
45+
MalformedURLException e) {
4646
System.err.println(Localization.lang("Problem downloading from %0: %1", address, e.getLocalizedMessage()));
4747
return Optional.empty();
4848
}
@@ -63,9 +63,9 @@ public static Optional<ParserResult> importFile(String location,
6363
return importResult;
6464
}
6565

66-
public static Optional<ParserResult> importFile(Path file,
67-
CliPreferences cliPreferences,
68-
boolean porcelain) {
66+
public static Optional<ParserResult> importFile(Path file,
67+
CliPreferences cliPreferences,
68+
boolean porcelain) {
6969
try {
7070
ImportFormatReader importFormatReader = new ImportFormatReader(
7171
cliPreferences.getImporterPreferences(),

jabgui/src/main/java/org/jabref/gui/JabRefDialogService.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -446,23 +446,23 @@ public void notify(String message) {
446446
LOGGER.info(message);
447447

448448
UiTaskExecutor.runInJavaFXThread(() ->
449-
Notifications.create()
450-
.text(message)
451-
.position(Pos.BOTTOM_CENTER)
452-
.hideAfter(TOAST_MESSAGE_DISPLAY_TIME)
453-
.owner(mainWindow)
454-
.threshold(5,
455-
Notifications.create()
456-
.title(Localization.lang("Last notification"))
457-
.text(
458-
"(" + Localization.lang("Check the event log to see all notifications") + ")"
459-
+ "\n\n" + message)
460-
.onAction(e -> {
461-
ErrorConsoleAction ec = new ErrorConsoleAction();
462-
ec.execute();
463-
}))
464-
.hideCloseButton()
465-
.show());
449+
Notifications.create()
450+
.text(message)
451+
.position(Pos.BOTTOM_CENTER)
452+
.hideAfter(TOAST_MESSAGE_DISPLAY_TIME)
453+
.owner(mainWindow)
454+
.threshold(5,
455+
Notifications.create()
456+
.title(Localization.lang("Last notification"))
457+
.text(
458+
"(" + Localization.lang("Check the event log to see all notifications") + ")"
459+
+ "\n\n" + message)
460+
.onAction(e -> {
461+
ErrorConsoleAction ec = new ErrorConsoleAction();
462+
ec.execute();
463+
}))
464+
.hideCloseButton()
465+
.show());
466466
}
467467

468468
@Override

jabgui/src/main/java/org/jabref/gui/JabRefGUI.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ public void onShowing(WindowEvent event) {
326326

327327
// Open last edited databases
328328
if (uiCommands.stream().noneMatch(UiCommand.BlankWorkspace.class::isInstance)
329-
&& preferences.getWorkspacePreferences().shouldOpenLastEdited()) {
329+
&& preferences.getWorkspacePreferences().shouldOpenLastEdited()) {
330330
mainFrame.openLastEditedDatabases();
331331
}
332332

jabgui/src/main/java/org/jabref/gui/LibraryTab.java

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
import org.jabref.gui.maintable.MainTableDataModel;
5454
import org.jabref.gui.preferences.GuiPreferences;
5555
import org.jabref.gui.undo.CountingUndoManager;
56-
import org.jabref.gui.undo.NamedCompound;
56+
import org.jabref.gui.undo.NamedCompoundEdit;
5757
import org.jabref.gui.undo.UndoableFieldChange;
5858
import org.jabref.gui.undo.UndoableInsertEntries;
5959
import org.jabref.gui.undo.UndoableRemoveEntries;
@@ -123,7 +123,6 @@ public class LibraryTab extends Tab implements CommandSelectionTab {
123123
private final BooleanProperty canGoForwardProperty = new SimpleBooleanProperty(false);
124124
private boolean backOrForwardNavigationActionTriggered = false;
125125

126-
127126
private BibDatabaseContext bibDatabaseContext;
128127

129128
// All subscribers needing "coarse" change events should use this filter
@@ -210,8 +209,8 @@ private LibraryTab(@NonNull BibDatabaseContext bibDatabaseContext,
210209

211210
stateManager.activeDatabaseProperty().addListener((_, _, _) -> {
212211
if (preferences.getSearchPreferences().isFulltext()) {
213-
mainTable.getTableModel().refreshSearchMatches();
214-
}
212+
mainTable.getTableModel().refreshSearchMatches();
213+
}
215214
});
216215
}
217216

@@ -466,13 +465,13 @@ public SuggestionProviders getSuggestionProviders() {
466465
}
467466

468467
public void registerUndoableChanges(List<FieldChange> changes) {
469-
NamedCompound ce = new NamedCompound(Localization.lang("Save actions"));
468+
NamedCompoundEdit compoundEdit = new NamedCompoundEdit(Localization.lang("Save actions"));
470469
for (FieldChange change : changes) {
471-
ce.addEdit(new UndoableFieldChange(change));
470+
compoundEdit.addEdit(new UndoableFieldChange(change));
472471
}
473-
ce.end();
474-
if (ce.hasEdits()) {
475-
getUndoManager().addEdit(ce);
472+
compoundEdit.end();
473+
if (compoundEdit.hasEdits()) {
474+
getUndoManager().addEdit(compoundEdit);
476475
}
477476
}
478477

@@ -1025,7 +1024,7 @@ public void updateNavigationState() {
10251024
* Creates a new library tab. Contents are loaded by the {@code dataLoadingTask}. Most of the other parameters are required by {@code resetChangeMonitor()}.
10261025
*
10271026
* @param dataLoadingTask The task to execute to load the data asynchronously.
1028-
* @param file the path to the file (loaded by the dataLoadingTask)
1027+
* @param file the path to the file (loaded by the dataLoadingTask)
10291028
*/
10301029
public static LibraryTab createLibraryTab(BackgroundTask<ParserResult> dataLoadingTask,
10311030
Path file,

jabgui/src/main/java/org/jabref/gui/ai/components/aichat/AiChatComponent.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ public AiChatComponent(AiService aiService,
9595
aiService.getIngestionService().ingest(name, ListUtil.getLinkedFiles(entries).toList(), bibDatabaseContext);
9696

9797
ViewLoader.view(this)
98-
.root(this)
99-
.load();
98+
.root(this)
99+
.load();
100100
}
101101

102102
@FXML
@@ -215,10 +215,11 @@ private List<Notification> updateNotificationsForEntry(BibEntry entry) {
215215

216216
entry.getFiles().stream().map(file -> aiService.getIngestionService().ingest(file, bibDatabaseContext)).forEach(ingestionStatus -> {
217217
switch (ingestionStatus.getState()) {
218-
case PROCESSING -> notifications.add(new Notification(
219-
Localization.lang("File %0 is currently being processed", ingestionStatus.getObject().getLink()),
220-
Localization.lang("After the file is ingested, you will be able to chat with it.")
221-
));
218+
case PROCESSING ->
219+
notifications.add(new Notification(
220+
Localization.lang("File %0 is currently being processed", ingestionStatus.getObject().getLink()),
221+
Localization.lang("After the file is ingested, you will be able to chat with it.")
222+
));
222223

223224
case ERROR -> {
224225
assert ingestionStatus.getException().isPresent(); // When the state is ERROR, the exception must be present.
@@ -229,7 +230,8 @@ private List<Notification> updateNotificationsForEntry(BibEntry entry) {
229230
));
230231
}
231232

232-
case SUCCESS -> { }
233+
case SUCCESS -> {
234+
}
233235
}
234236
});
235237

0 commit comments

Comments
 (0)