Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
16 changes: 8 additions & 8 deletions .jbang/CheckoutPR.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import org.kohsuke.github.GitHubBuilder;
import org.kohsuke.github.PagedIterator;

///usr/bin/env jbang "$0" "$@" ; exit $?
/// usr/bin/env jbang "$0" "$@" ; exit $?

//JAVA 21+
//RUNTIME_OPTIONS --enable-native-access=ALL-UNNAMED
Expand Down Expand Up @@ -62,7 +62,7 @@ public static void main(String[] args) throws Exception {
while (prIterator.hasNext()) {
pr = prIterator.next();
if ((contributor.isEmpty() || pr.getHead().getUser().getLogin().equals(contributor)) &&
pr.getHead().getRef().equals(branchName)) {
pr.getHead().getRef().equals(branchName)) {
found = true;
System.out.println("Found pull request #" + pr.getNumber());
break;
Expand Down Expand Up @@ -165,9 +165,9 @@ private static void checkoutUpstreamMain() throws Exception {
// Check if a remote pointing to JabRef/jabref already exists
List<RemoteConfig> remotes = git.remoteList().call();
Optional<RemoteConfig> jabrefRemote = remotes.stream()
// We use "contains", because there could be SSH remote URLs
.filter(r -> r.getURIs().stream().anyMatch(uri -> uri.toString().contains("JabRef/jabref")))
.findFirst();
// We use "contains", because there could be SSH remote URLs
.filter(r -> r.getURIs().stream().anyMatch(uri -> uri.toString().contains("JabRef/jabref")))
.findFirst();

String remoteToUse;
if (jabrefRemote.isPresent()) {
Expand All @@ -176,9 +176,9 @@ private static void checkoutUpstreamMain() throws Exception {
} else {
System.out.println("Adding remote 'upstream' pointing to " + jabrefRepoUrl);
git.remoteAdd()
.setName(upstreamName)
.setUri(new URIish(jabrefRepoUrl))
.call();
.setName(upstreamName)
.setUri(new URIish(jabrefRepoUrl))
.call();
remoteToUse = upstreamName;
}

Expand Down
2 changes: 1 addition & 1 deletion .jbang/CloneJabRef.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import java.nio.file.Files;
import java.nio.file.Path;

///usr/bin/env jbang "$0" "$@" ; exit $?
/// usr/bin/env jbang "$0" "$@" ; exit $?

//JAVA 21+
//RUNTIME_OPTIONS --enable-native-access=ALL-UNNAMED
Expand Down
2 changes: 1 addition & 1 deletion .jbang/JabKitLauncher.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
///usr/bin/env jbang "$0" "$@" ; exit $?
/// usr/bin/env jbang "$0" "$@" ; exit $?
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code reformatting was done without adding new statements. The addition of a space after '///' is purely syntactical and violates the code reformatting policy.


//DESCRIPTION jabkit - mange BibTeX files using JabRef

Expand Down
2 changes: 1 addition & 1 deletion .jbang/JabLsLauncher.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
///usr/bin/env jbang "$0" "$@" ; exit $?
/// usr/bin/env jbang "$0" "$@" ; exit $?
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code reformatting without adding new statements violates the principle of meaningful changes. The addition of a space after '///' is purely cosmetic and doesn't improve functionality.


//DESCRIPTION jabls - start a bibtex languageserver

Expand Down
2 changes: 1 addition & 1 deletion .jbang/JabSrvLauncher.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
///usr/bin/env jbang "$0" "$@" ; exit $?
/// usr/bin/env jbang "$0" "$@" ; exit $?
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code reformatting without adding new statements violates best practices. The change only adds a space after '///' which is purely cosmetic and doesn't improve functionality.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OMG - the code formatter -- not that important - we could also remove that line

But maybe, we add this to exceptions


//DESCRIPTION jabsrv - serve BibTeX files using JabRef

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
///usr/bin/env jbang "$0" "$@" ; exit $?
/// usr/bin/env jbang "$0" "$@" ; exit $?
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments should add new information and not just restate what's obvious from the code. The shebang line is self-explanatory and doesn't need additional comment formatting.


//JAVA 24
//RUNTIME_OPTIONS --enable-native-access=ALL-UNNAMED
Expand Down
3 changes: 1 addition & 2 deletions build-support/src/main/java/JournalListMvGenerator.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
///usr/bin/env jbang "$0" "$@" ; exit $?
/// usr/bin/env jbang "$0" "$@" ; exit $?

//JAVA 24
//RUNTIME_OPTIONS --enable-native-access=ALL-UNNAMED
Expand Down Expand Up @@ -44,7 +44,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


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

Expand Down
2 changes: 1 addition & 1 deletion build-support/src/main/java/LtwaListMvGenerator.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
///usr/bin/env jbang "$0" "$@" ; exit $?
/// usr/bin/env jbang "$0" "$@" ; exit $?

//JAVA 24
//RUNTIME_OPTIONS --enable-native-access=ALL-UNNAMED
Expand Down
12 changes: 6 additions & 6 deletions jabgui/src/main/java/org/jabref/cli/CliImportHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ public class CliImportHelper {
* @param location URL or file path to import
*/
public static Optional<ParserResult> importFile(String location,
CliPreferences cliPreferences,
boolean porcelain) {
CliPreferences cliPreferences,
boolean porcelain) {
LOGGER.debug("Importing file from locaiton {}", location);
String[] data = location.split(",");

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

public static Optional<ParserResult> importFile(Path file,
CliPreferences cliPreferences,
boolean porcelain) {
public static Optional<ParserResult> importFile(Path file,
CliPreferences cliPreferences,
boolean porcelain) {
try {
ImportFormatReader importFormatReader = new ImportFormatReader(
cliPreferences.getImporterPreferences(),
Expand Down
34 changes: 17 additions & 17 deletions jabgui/src/main/java/org/jabref/gui/JabRefDialogService.java
Original file line number Diff line number Diff line change
Expand Up @@ -446,23 +446,23 @@ public void notify(String message) {
LOGGER.info(message);

UiTaskExecutor.runInJavaFXThread(() ->
Notifications.create()
.text(message)
.position(Pos.BOTTOM_CENTER)
.hideAfter(TOAST_MESSAGE_DISPLAY_TIME)
.owner(mainWindow)
.threshold(5,
Notifications.create()
.title(Localization.lang("Last notification"))
.text(
"(" + Localization.lang("Check the event log to see all notifications") + ")"
+ "\n\n" + message)
.onAction(e -> {
ErrorConsoleAction ec = new ErrorConsoleAction();
ec.execute();
}))
.hideCloseButton()
.show());
Notifications.create()
.text(message)
.position(Pos.BOTTOM_CENTER)
.hideAfter(TOAST_MESSAGE_DISPLAY_TIME)
.owner(mainWindow)
.threshold(5,
Notifications.create()
.title(Localization.lang("Last notification"))
.text(
"(" + Localization.lang("Check the event log to see all notifications") + ")"
+ "\n\n" + message)
.onAction(e -> {
ErrorConsoleAction ec = new ErrorConsoleAction();
ec.execute();
}))
.hideCloseButton()
.show());
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion jabgui/src/main/java/org/jabref/gui/JabRefGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ public void onShowing(WindowEvent event) {

// Open last edited databases
if (uiCommands.stream().noneMatch(UiCommand.BlankWorkspace.class::isInstance)
&& preferences.getWorkspacePreferences().shouldOpenLastEdited()) {
&& preferences.getWorkspacePreferences().shouldOpenLastEdited()) {
mainFrame.openLastEditedDatabases();
}

Expand Down
6 changes: 3 additions & 3 deletions jabgui/src/main/java/org/jabref/gui/LibraryTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ private LibraryTab(@NonNull BibDatabaseContext bibDatabaseContext,

stateManager.activeDatabaseProperty().addListener((_, _, _) -> {
if (preferences.getSearchPreferences().isFulltext()) {
mainTable.getTableModel().refreshSearchMatches();
}
mainTable.getTableModel().refreshSearchMatches();
}
});
}

Expand Down Expand Up @@ -968,7 +968,7 @@ public void resetChangedProperties() {
* Creates a new library tab. Contents are loaded by the {@code dataLoadingTask}. Most of the other parameters are required by {@code resetChangeMonitor()}.
*
* @param dataLoadingTask The task to execute to load the data asynchronously.
* @param file the path to the file (loaded by the dataLoadingTask)
* @param file the path to the file (loaded by the dataLoadingTask)
*/
public static LibraryTab createLibraryTab(BackgroundTask<ParserResult> dataLoadingTask,
Path file,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ public AiChatComponent(AiService aiService,
aiService.getIngestionService().ingest(name, ListUtil.getLinkedFiles(entries).toList(), bibDatabaseContext);

ViewLoader.view(this)
.root(this)
.load();
.root(this)
.load();
}

@FXML
Expand Down Expand Up @@ -215,10 +215,11 @@ private List<Notification> updateNotificationsForEntry(BibEntry entry) {

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code reformatting with changed indentation is purely cosmetic and doesn't introduce new functionality. Such changes should be combined with actual code modifications.

Localization.lang("File %0 is currently being processed", ingestionStatus.getObject().getLink()),
Localization.lang("After the file is ingested, you will be able to chat with it.")
));

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

case SUCCESS -> { }
case SUCCESS -> {
}
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ private void initialize() {
// The easy way to get rid of this ambiguity is to disallow scrolling when there are new lines in the prompt.
// But the exception to this situation is when the caret position is at the beginning of the prompt.
history.get().stream()
.skip(newValue.intValue())
.findFirst()
.ifPresent(message -> userPromptTextArea.setText(message));
.skip(newValue.intValue())
.findFirst()
.ifPresent(message -> userPromptTextArea.setText(message));
}
} else {
// When currentUserMessageScroll is set to NEW_NON_EXISTENT_MESSAGE, then we should:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@
* about possible problems with entries (because that will affect LLM output), but on the other hand the user would
* like to chat with all available entries in the group, even if some of them are not valid.
*/
public record Notification(String title, String message) { }
public record Notification(
String title,
Comment on lines +12 to +13
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code was reformatted without adding new statements. According to guidelines, code should not be reformatted only for syntax reasons without adding new functionality.

String message) {
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Copyright (c) 2014, 2015, ControlsFX
* All rights reserved.
*
* <p>
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
Expand All @@ -12,7 +12,7 @@
* * Neither the name of ControlsFX, any associated website, nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* <p>
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ public PersonNameStringConverter(AutoCompletePreferences preferences) {
public String toString(Author author) {
if (autoCompLF) {
switch (autoCompleteFirstNameMode) {
case ONLY_ABBREVIATED, BOTH:
case ONLY_ABBREVIATED,
BOTH:
Comment on lines +44 to +45
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code is being reformatted without adding new statements, which violates the principle of not reformatting code solely for syntax reasons without functional changes.

return author.getFamilyGiven(true);
case ONLY_FULL:
return author.getFamilyGiven(false);
Expand All @@ -51,7 +52,8 @@ public String toString(Author author) {
}
if (autoCompFF) {
switch (autoCompleteFirstNameMode) {
case ONLY_ABBREVIATED, BOTH:
case ONLY_ABBREVIATED,
BOTH:
return author.getGivenFamily(true);
case ONLY_FULL:
return author.getGivenFamily(false);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Copyright (c) 2014, 2016 ControlsFX
* All rights reserved.
*
* <p>
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
Expand All @@ -12,7 +12,7 @@
* * Neither the name of ControlsFX, any associated website, nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* <p>
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ private AutosaveManager(BibDatabaseContext bibDatabaseContext, CoarseChangeFilte
this.executor.scheduleAtFixedRate(
() -> {
if (needsSave) {
eventBus.post(new AutosaveEvent());
needsSave = false;
eventBus.post(new AutosaveEvent());
needsSave = false;
}
},
DELAY_BETWEEN_AUTOSAVE_ATTEMPTS_IN_SECONDS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,10 @@ public static void shutdown(BibDatabaseContext bibDatabaseContext, Path backupDi
/**
* Checks whether a backup file exists for the given database file. If it exists, it is checked whether it is
* newer and different from the original.
*
* <p>
* In case a discarded file is present, the method also returns <code>false</code>, See also {@link #discardBackup(Path)}.
*
* @param originalPath Path to the file a backup should be checked for. Example: jabref.bib.
*
* @return <code>true</code> if backup file exists AND differs from originalPath. <code>false</code> is the
* "default" return value in the good case. In case a discarded file exists, <code>false</code> is returned, too.
* In the case of an exception <code>true</code> is returned to ensure that the user checks the output.
Expand Down Expand Up @@ -303,7 +302,7 @@ private static Path determineDiscardedFile(Path file, Path backupDir) {

/**
* Marks the backups as discarded.
*
* <p>
* We do not delete any files, because the user might want to recover old backup files.
* Therefore, we mark discarded backups by a --discarded file.
*/
Expand Down Expand Up @@ -340,11 +339,11 @@ private void startBackupTask(Path backupDir) {
fillQueue(backupDir);

executor.scheduleAtFixedRate(
// We need to determine the backup path on each action, because we use the timestamp in the filename
() -> determineBackupPathForNewBackup(backupDir).ifPresent(this::performBackup),
DELAY_BETWEEN_BACKUP_ATTEMPTS_IN_SECONDS,
DELAY_BETWEEN_BACKUP_ATTEMPTS_IN_SECONDS,
TimeUnit.SECONDS);
// We need to determine the backup path on each action, because we use the timestamp in the filename
() -> determineBackupPathForNewBackup(backupDir).ifPresent(this::performBackup),
DELAY_BETWEEN_BACKUP_ATTEMPTS_IN_SECONDS,
DELAY_BETWEEN_BACKUP_ATTEMPTS_IN_SECONDS,
TimeUnit.SECONDS);
}

private void fillQueue(Path backupDir) {
Expand All @@ -370,7 +369,7 @@ private void fillQueue(Path backupDir) {
* Unregisters the BackupManager from the eventBus of {@link BibDatabaseContext}.
* This method should only be used when closing a database/JabRef in a normal way.
*
* @param backupDir The backup directory
* @param backupDir The backup directory
* @param createBackup If the backup manager should still perform a backup
*/
private void shutdown(Path backupDir, boolean createBackup) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

/**
* The action concerned with generate a new (sub-)database from latex AUX file.
*
* <p>
* A new library is created by {@link org.jabref.gui.importer.NewDatabaseAction}
*/
public class NewSubLibraryAction extends SimpleCommand {
Expand Down
Loading
Loading