Skip to content

Commit

Permalink
Resolve violations in codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
subhramit committed Nov 13, 2024
1 parent 3439f02 commit ca50f09
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 22 deletions.
3 changes: 1 addition & 2 deletions src/main/java/org/jabref/gui/LibraryTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -941,8 +941,7 @@ public void pasteEntry() {
private List<BibEntry> handleNonBibTeXStringData(String data) {
try {
return this.importHandler.handleStringData(data);
} catch (
FetcherException exception) {
} catch (FetcherException exception) {
if (exception instanceof FetcherClientException) {
dialogService.showInformationDialogAndWait(Localization.lang("Look up identifier"), Localization.lang("No data was found for the identifier"));
} else if (exception instanceof FetcherServerException) {
Expand Down
9 changes: 4 additions & 5 deletions src/main/java/org/jabref/gui/frame/JabRefFrameViewModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,10 @@ private void openDatabases(List<ParserResult> parserResults) {
undoManager,
clipBoardManager,
taskExecutor);
} catch (
SQLException |
DatabaseNotSupportedException |
InvalidDBMSConnectionPropertiesException |
NotASharedDatabaseException e) {
} catch (SQLException
| DatabaseNotSupportedException
| InvalidDBMSConnectionPropertiesException
| NotASharedDatabaseException e) {
LOGGER.error("Connection error", e);
dialogService.showErrorDialogAndWait(
Localization.lang("Connection error"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,7 @@ public void editStyle() {
Optional<ExternalFileType> type = ExternalFileTypes.getExternalFileTypeByExt("jstyle", externalApplicationsPreferences);
try {
NativeDesktop.openExternalFileAnyFormat(new BibDatabaseContext(), externalApplicationsPreferences, filePreferences, jStyle.getPath(), type);
} catch (
IOException e) {
} catch (IOException e) {
dialogService.showErrorDialogAndWait(e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,7 @@ private void updateDirectoryWarning(Path directory) {
} else {
directoryWarning.setVisible(false);
}
} catch (
IOException e) {
} catch (IOException e) {
directoryWarning.setText(Localization.lang("Warning: Failed to check if the directory is empty."));
directoryWarning.setVisible(true);
}
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/org/jabref/logic/openoffice/action/Update.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ private static List<String> updateDocument(XTextDocument doc,
}

return frontend.citationGroups.getUnresolvedKeys();
} catch (
IOException e) {
} catch (IOException e) {
Logger.warn("Error while updating document", e);
} finally {
if (useLockControllers && UnoScreenRefresh.hasControllersLocked(doc)) {
Expand Down
14 changes: 5 additions & 9 deletions src/main/java/org/jabref/logic/os/OS.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ public static String getHostName() {
if (StringUtil.isBlank(hostName)) {
try {
hostName = InetAddress.getLocalHost().getHostName();
} catch (
UnknownHostException e) {
} catch (UnknownHostException e) {
LoggerFactory.getLogger(OS.class).info("Hostname not found. Using \"localhost\" as fallback.", e);
hostName = "localhost";
}
Expand All @@ -65,12 +64,10 @@ public static boolean isKeyringAvailable() {
return false;
}
keyring.deletePassword("JabRef", "keyringTest");
} catch (
BackendNotSupportedException ex) {
} catch (BackendNotSupportedException ex) {
LoggerFactory.getLogger(OS.class).warn("Credential store not supported.");
return false;
} catch (
PasswordAccessException ex) {
} catch (PasswordAccessException ex) {
LoggerFactory.getLogger(OS.class).warn("Password storage in credential store failed.");
return false;
} catch (Exception ex) {
Expand All @@ -90,9 +87,8 @@ public static String detectProgramPath(String programName, String directoryName)
try {
ShellLink link = new ShellLink(texworksLinkPath);
return link.resolveTarget();
} catch (
IOException |
ShellLinkException e) {
} catch (IOException
| ShellLinkException e) {
// Static logger instance cannot be used. See the class comment.
Logger logger = Logger.getLogger(OS.class.getName());
logger.log(Level.WARNING, "Had an error while reading .lnk file for TeXworks", e);
Expand Down

0 comments on commit ca50f09

Please sign in to comment.