Skip to content

Commit

Permalink
Run GJF again
Browse files Browse the repository at this point in the history
  • Loading branch information
koppor committed Oct 5, 2024
1 parent b64fc3f commit c004615
Show file tree
Hide file tree
Showing 35 changed files with 96 additions and 119 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/cli/JabRefCLI.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class JabRefCLI {
100; // Number of characters per line before a line break must be added.
private static final String WRAPPED_LINE_PREFIX =
""; // If a line break is added, this prefix will be inserted at the beginning of the
// next line
// next line
private static final String STRING_TABLE_DELIMITER = " : ";

private final CommandLine cl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ private List<Notification> updateNotificationsForEntry(BibEntry entry) {
assert ingestionStatus
.getException()
.isPresent(); // When the state is ERROR, the exception
// must be present.
// must be present.

notifications.add(
new Notification(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,8 @@ public final Collection<T> provideSuggestions(ISuggestionRequest request) {
Equivalence<T> equivalence = getEquivalence();
return getSource()
.filter(candidate -> isMatch(candidate, request))
.map(
equivalence
::wrap) // Need to do a bit of acrobatic as there is no
// distinctBy method
.map(equivalence::wrap) // Need to do a bit of acrobatic as there is no
// distinctBy method
.distinct()
.limit(10)
.map(Equivalence.Wrapper::get)
Expand All @@ -70,10 +68,8 @@ public List<T> getPossibleSuggestions() {
Comparator<T> comparator = getComparator().reversed();
Equivalence<T> equivalence = getEquivalence();
return getSource()
.map(
equivalence
::wrap) // Need to do a bit of acrobatic as there is no distinctBy
// method
.map(equivalence::wrap) // Need to do a bit of acrobatic as there is no distinctBy
// method
.distinct()
.map(Equivalence.Wrapper::get)
.sorted(comparator)
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/gui/desktop/os/Linux.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public void openFolderAndSelectFile(Path filePath) throws IOException {
new String[] {
"nemo", absoluteFilePath
}; // Although nemo is based on nautilus it does not support --select, it
// directly highlights the file
// directly highlights the file
} else if (desktopSession.contains("xfce")) {
cmd = new String[] {"thunar", absoluteFilePath};
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/gui/exporter/ExportCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ private void export(
fileDirForDatabase,
abbreviationRepository);
return null; // can not use BackgroundTask.wrap(Runnable) because
// Runnable.run() can't throw Exceptions
// Runnable.run() can't throw Exceptions
})
.onSuccess(
save -> {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/jabref/gui/fieldeditors/FieldEditorFX.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ default void establishBinding(
if (e.getEventType()
== KeyEvent
.KEY_PRESSED // if not checked, it will be fired twice:
// once for key pressed and once for key
// released
// once for key pressed and once for key
// released
&& e.isShortcutDown()) {
if (keyBindingRepository.matches(e, KeyBinding.UNDO)) {
undoAction.execute();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ private Node createFileDisplay(LinkedFileViewModel linkedFile) {
HBox.setHgrow(info, Priority.ALWAYS);
info.setStyle(
"-fx-padding: 0.5em 0 0.5em 0;"); // To align with buttons below which also have
// 0.5em padding
// 0.5em padding
info.getChildren().setAll(label, progressIndicator);

Button acceptAutoLinkedFile = IconTheme.JabRefIcons.AUTO_LINKED_FILE.asButton();
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/jabref/gui/frame/JabRefFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ private void initKeyBindings() {
break;
case PASTE:
if (OS.OS_X) { // Workaround for a jdk issue that executes paste
// twice when using cmd+v in a TextField
// twice when using cmd+v in a TextField
// Extra workaround for CodeArea, which does not inherit from
// TextInputControl
if (!(stateManager.getFocusOwner().isPresent()
Expand Down Expand Up @@ -492,7 +492,7 @@ private void initBindings() {
libraryTab.textProperty().getValue()
+ " – "
+ FRAME_TITLE, // not a minus, but codepoint
// 2013
// 2013
libraryTab.textProperty());
mainStage.titleProperty().bind(windowTitle);
});
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/gui/frame/MainMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ StandardActions.PARSE_LATEX, new ParseLatexAction(stateManager)),
stateManager,
(UiTaskExecutor)
taskExecutor)), // we know at this point that this
// is a UITaskExecutor
// is a UITaskExecutor
new SeparatorMenuItem(),
createSendSubMenu(factory, dialogService, stateManager, preferences),
pushToApplicationMenuItem,
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/org/jabref/gui/openoffice/OOBibBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -924,9 +924,8 @@ public void guiActionUpdateDocument(List<BibDatabase> databases, OOStyle style)
syncOptions
.setUpdateBibliography(true)
.setAlwaysAddCitedOnPages(
this
.alwaysAddCitedOnPages); // TODO: Provide option to
// user: this is always false
this.alwaysAddCitedOnPages); // TODO: Provide option to
// user: this is always false

unresolvedKeys =
Update.synchronizeDocument(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,9 @@ private void initialize() {
availableListView.setOnMouseClicked(
event -> {
if (event.getClickCount() == 2) {
viewModel
.handleCslStyleSelection(); // Only CSL styles can be selected with
// a double click, JStyles show a style
// description instead
viewModel.handleCslStyleSelection(); // Only CSL styles can be selected with
// a double click, JStyles show a style
// description instead
this.setResult(viewModel.getSelectedStyle());
this.close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public class AiTabViewModel implements PreferenceTabViewModel {
private final BooleanProperty disableApiBaseUrl =
new SimpleBooleanProperty(
true); // {@link HuggingFaceChatModel} and {@link GoogleAiGeminiChatModel}
// doesn't support setting API base URL
// doesn't support setting API base URL

private final StringProperty openAiApiBaseUrl = new SimpleStringProperty();
private final StringProperty mistralAiApiBaseUrl = new SimpleStringProperty();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ public abstract class AbstractPushToApplication implements PushToApplication {
private static final Logger LOGGER = LoggerFactory.getLogger(AbstractPushToApplication.class);
protected boolean
couldNotCall; // Set to true in case the command could not be executed, e.g., if the
// file is not found
// file is not found
protected boolean
couldNotPush; // Set to true in case the tunnel to the program (if one is used) does not
// operate
// operate
protected boolean
notDefined; // Set to true if the corresponding path is not defined in the preferences

Expand Down
6 changes: 2 additions & 4 deletions src/main/java/org/jabref/gui/push/PushToLyx.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,8 @@ public void pushEntries(
if (!commandPath.endsWith(".in")) {
commandPath = commandPath + ".in";
}
File lp =
new File(
commandPath); // this needs to fixed because it gives "asdf" when going
// prefs.get("lyxpipe")
File lp = new File(commandPath); // this needs to fixed because it gives "asdf" when going
// prefs.get("lyxpipe")
if (!lp.exists() || !lp.canWrite()) {
// See if it helps to append ".in":
lp = new File(commandPath + ".in");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ protected void crawl() {
() -> {
crawler.performCrawl();
return 0; // Return any value to make this a callable instead of a
// runnable. This allows throwing exceptions.
// runnable. This allows throwing exceptions.
})
.onFailure(
e -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public FileDialogConfiguration build() {
public Builder withInitialDirectory(Path directory) {
if (directory
== null) { // It could be that somehow the path is null, for example if it got
// deleted in the meantime
// deleted in the meantime
initialDirectory = null;
} else { // Dir must be a folder, not a file
if (!Files.isDirectory(directory)) {
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/org/jabref/logic/bibtex/FieldWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,8 @@ private String formatAndResolveStrings(String content, Field field)

if (pos2 == -1) {
if (neverFailOnHashes) {
pos1 =
content
.length(); // just write out the rest of the text, and throw no
// exception
pos1 = content.length(); // just write out the rest of the text, and throw no
// exception
} else {
LOGGER.error(
"The character {} is not allowed in BibTeX strings unless escaped as in '\\{}'. "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,8 @@ public Document getDOMrepresentation() {
row,
getField(
e,
StandardField
.AUTHOR)); // new AuthorLastFirst().format(getField(e,
// StandardField.AUTHOR_FIELD)));
StandardField.AUTHOR)); // new AuthorLastFirst().format(getField(e,
// StandardField.AUTHOR_FIELD)));
addTableCell(result, row, getField(e, StandardField.BOOKTITLE));
addTableCell(result, row, getField(e, StandardField.CHAPTER));
addTableCell(result, row, getField(e, StandardField.DAY));
Expand All @@ -171,9 +170,8 @@ public Document getDOMrepresentation() {
row,
getField(
e,
StandardField
.EDITOR)); // new AuthorLastFirst().format(getField(e,
// StandardField.EDITOR_FIELD)));
StandardField.EDITOR)); // new AuthorLastFirst().format(getField(e,
// StandardField.EDITOR_FIELD)));
addTableCell(result, row, getField(e, StandardField.HOWPUBLISHED));
addTableCell(result, row, getField(e, StandardField.INSTITUTION));
addTableCell(result, row, getField(e, StandardField.JOURNAL));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ public void export(

if (entries
.isEmpty()) { // Do not export if no entries to export -- avoids exports with only
// template text
// template text
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public String format(String oldString) {
.matcher(newValue)
.replaceAll(
"\\$$1"); // Move numbers, possibly with operators +, -, or /, left
// of $ into the equation
// of $ into the equation
newValue =
MOVE_NUMBERS_RIGHT_INTO_EQUATION
.matcher(newValue)
Expand All @@ -72,9 +72,8 @@ public String format(String oldString) {
newValue =
ESCAPE_PERCENT_SIGN_ONCE
.matcher(newValue)
.replaceAll(
"$1\\\\%"); // escape %, but do not escapee \% again, used for
// comments in TeX
.replaceAll("$1\\\\%"); // escape %, but do not escapee \% again, used for
// comments in TeX

return newValue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ Optional<BibEntry> getEntryFromPDFContent(String firstpageContents, String lineS

lineIndex =
0; // to prevent array index out of bounds exception on second run we need to reset
// i to zero
// i to zero

proceedToNextNonEmptyLine();
if (lineIndex >= lines.length) {
Expand Down Expand Up @@ -385,9 +385,8 @@ Optional<BibEntry> getEntryFromPDFContent(String firstpageContents, String lineS
if (posWithEditor > curString.length()) {
curString =
curString.substring(
posWithEditor
- 2); // we don't have any spaces after Eds so we
// substract the 2
posWithEditor - 2); // we don't have any spaces after Eds so we
// substract the 2
} else {
curString = curString.substring(posWithEditor);
}
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/org/jabref/logic/net/ssl/TrustStoreManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,8 @@ private static X509TrustManager findDefaultTrustManager(KeyStore keyStore)
throws NoSuchAlgorithmException, KeyStoreException {
TrustManagerFactory tmf =
TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
tmf.init(
keyStore); // If keyStore is null, tmf will be initialized with the default trust
// store
tmf.init(keyStore); // If keyStore is null, tmf will be initialized with the default trust
// store

for (TrustManager tm : tmf.getTrustManagers()) {
if (tm instanceof X509TrustManager manager) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,8 @@ private List<Path> parseFileField(BibEntry entry) {
Objects.requireNonNull(entry);

return entry.getFiles().stream()
.filter(
file ->
!file
.isOnlineLink()) // Do not query external file links (huge
// performance leak)
.filter(file -> !file.isOnlineLink()) // Do not query external file links (huge
// performance leak)
.map(file -> file.findIn(possibleFilePaths))
.filter(Optional::isPresent)
.map(Optional::get)
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/logic/xmp/XmpUtilReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public XmpUtilReader() {
System.setProperty(
"sun.java2d.cmm",
"sun.java2d.cmm.kcms.KcmsServiceProvider"); // To get higher rendering speed on java
// 8 oder 9 for images
// 8 oder 9 for images
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/model/ChainNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/
@SuppressWarnings(
"unchecked") // We use some explicit casts of the form "(T) this". The constructor ensures
// that this cast is valid.
// that this cast is valid.
public abstract class ChainNode<T extends ChainNode<T>> {

/**
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/jabref/model/entry/Date.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public class Date {
+ // covers YYYY.MM.DD, YYYY.M.DD, YYYY.MM.D, YYYY.M.D
"(January|February|March|April|May|June|July|August|September|"
+ "October|November|December) \\d{1,2}, \\d{4}"; // covers Month DD, YYYY &
// Month D, YYYY
// Month D, YYYY
}

private final TemporalAccessor date;
Expand Down Expand Up @@ -197,7 +197,7 @@ public static Optional<Date> parse(String dateString) {
"\\d{1,4}-\\d{1,2} BC/\\d{1,4}-\\d{1,2} BC|"
+ // 5 AD/10 AD and 0005 AD/0010 AD
"\\d{1,4}-\\d{1,2} AD/\\d{1,4}-\\d{1,2} AD" // 5 AD/10 AD and 0005 AD/0010
// AD
// AD
)) {
try {
String[] strDates = dateString.split("/");
Expand All @@ -220,7 +220,7 @@ public static Optional<Date> parse(String dateString) {
"\\d{1,4}-\\d{1,2} BC / \\d{1,4}-\\d{1,2} BC|"
+ // 5 AD/10 AD and 0005 AD/0010 AD
"\\d{1,4}-\\d{1,2} AD / \\d{1,4}-\\d{1,2} AD" // 5 AD/10 AD and 0005 AD/0010
// AD
// AD
)) {
try {
String[] strDates = dateString.split(" / ");
Expand Down
Loading

0 comments on commit c004615

Please sign in to comment.