Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update openrewrite #10782

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ plugins {

id 'idea'

id 'org.openrewrite.rewrite' version '6.6.3'
id 'org.openrewrite.rewrite' version '6.6.6'
}

// Enable following for debugging
Expand Down Expand Up @@ -258,7 +258,7 @@ dependencies {
xjc group: 'org.glassfish.jaxb', name: 'jaxb-xjc', version: '3.0.2'
xjc group: 'org.glassfish.jaxb', name: 'jaxb-runtime', version: '3.0.2'

rewrite(platform("org.openrewrite.recipe:rewrite-recipe-bom:2.5.4"))
rewrite(platform("org.openrewrite.recipe:rewrite-recipe-bom:2.6.1"))
rewrite("org.openrewrite.recipe:rewrite-static-analysis")
rewrite("org.openrewrite.recipe:rewrite-logging-frameworks")
rewrite("org.openrewrite.recipe:rewrite-testing-frameworks")
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/gui/JabRefGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ private void openWindow(Stage mainStage) {
});
Platform.runLater(this::openDatabases);

if (!(fileUpdateMonitor.isActive())) {
if (!fileUpdateMonitor.isActive()) {
getMainFrame().getDialogService()
.showErrorDialogAndWait(Localization.lang("Unable to monitor file changes. Please close files " +
"and processes and restart. You may encounter errors if you continue " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ private Optional<Path> askForSavePath() {
if (selectedPath.isPresent()) {
Path savePath = selectedPath.get();
// Workaround for linux systems not adding file extension
if (!(savePath.getFileName().toString().toLowerCase().endsWith(".bib"))) {
if (!savePath.getFileName().toString().toLowerCase().endsWith(".bib")) {
savePath = Path.of(savePath.toString() + ".bib");
if (!Files.notExists(savePath)) {
if (!dialogService.showConfirmationDialogAndWait(Localization.lang("Overwrite file"), Localization.lang("'%0' exists. Overwrite file?", savePath.getFileName()))) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static void showParserResultWarningDialog(final ParserResult parserResult
final DialogService dialogService) {
Objects.requireNonNull(parserResult);
// Return if no warnings
if (!(parserResult.hasWarnings())) {
if (!parserResult.hasWarnings()) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ private void adjustTitleLayout() {
textGraphicTranslateBinding = Bindings.createDoubleBinding(
() -> switch (getSkinnable().getAlignment()) {
case TOP_CENTER, CENTER, BOTTOM_CENTER, BASELINE_CENTER -> 0.0;
default -> -(arrowButton.getWidth());
default -> -arrowButton.getWidth();
}, getSkinnable().alignmentProperty(), arrowButton.widthProperty());
text.translateXProperty().bind(textGraphicTranslateBinding);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1299,7 +1299,7 @@ private static List<String> getValidInstitutionNameParts(String name) {

// Cleanup: remove unnecessary words.
for (String part : name.replaceAll("\\{[A-Z]+}", "").split("[ \\-_]")) {
if ((!(part.isEmpty()) // remove empty
if ((!part.isEmpty() // remove empty
&& !ignore.contains(part.toLowerCase(Locale.ENGLISH)) // remove ignored words
&& (part.charAt(part.length() - 1) != '.')
&& Character.isUpperCase(part.charAt(0)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ public static BibEntry parseSpringerJSONtoBibtex(JSONObject springerJsonEntry) {
}

// Page numbers
if (springerJsonEntry.has("startingPage") && !(springerJsonEntry.getString("startingPage").isEmpty())) {
if (springerJsonEntry.has("endingPage") && !(springerJsonEntry.getString("endingPage").isEmpty())) {
if (springerJsonEntry.has("startingPage") && !springerJsonEntry.getString("startingPage").isEmpty()) {
if (springerJsonEntry.has("endingPage") && !springerJsonEntry.getString("endingPage").isEmpty()) {
entry.setField(StandardField.PAGES,
springerJsonEntry.getString("startingPage") + "--" + springerJsonEntry.getString("endingPage"));
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ private String getPureTextFromFile() {
private String purgeEOFCharacters(String input) {
StringBuilder remainingText = new StringBuilder();
for (Character character : input.toCharArray()) {
if (!(isEOFCharacter(character))) {
if (!isEOFCharacter(character)) {
remainingText.append(character);
}
}
Expand Down Expand Up @@ -865,7 +865,7 @@ private String parseBracketedText() throws IOException {
if (Character.isWhitespace((char) character)) {
String whitespacesReduced = skipAndRecordWhitespace(character);

if (!(whitespacesReduced.isEmpty()) && !"\n\t".equals(whitespacesReduced)) { // &&
if (!whitespacesReduced.isEmpty() && !"\n\t".equals(whitespacesReduced)) { // &&
whitespacesReduced = whitespacesReduced.replace("\t", ""); // Remove tabulators.
value.append(whitespacesReduced);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public static JournalAbbreviationRepository loadRepository(JournalAbbreviationPr
// Read external lists
List<String> lists = journalAbbreviationPreferences.getExternalJournalLists();
// might produce NPE in tests
if (lists != null && !(lists.isEmpty())) {
if (lists != null && !lists.isEmpty()) {
// reversing ensures that the latest lists overwrites the former one
Collections.reverse(lists);
for (String filename : lists) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/logic/layout/format/FileLink.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public String format(String field) {
LinkedFile link = null;
if (fileType == null) {
// No file type specified. Simply take the first link.
if (!(fileList.isEmpty())) {
if (!fileList.isEmpty()) {
link = fileList.get(0);
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ private void addStringField(Document newDocument, String field, String value) {
}

private boolean isValidField(String value) {
return !(StringUtil.isNullOrEmpty(value));
return !StringUtil.isNullOrEmpty(value);
}

public static String mergeLines(String text) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -855,17 +855,17 @@ public class HTMLUnicodeConversionMaps {

static {
for (String[] aConversionList : CONVERSION_LIST) {
if (!(aConversionList[2].isEmpty())) {
if (!aConversionList[2].isEmpty()) {
String strippedLaTeX = cleanLaTeX(aConversionList[2]);
if (!(aConversionList[1].isEmpty())) {
if (!aConversionList[1].isEmpty()) {
HTML_LATEX_CONVERSION_MAP.put("&" + aConversionList[1] + ";", aConversionList[2]);
if (!strippedLaTeX.isEmpty()) {
LATEX_HTML_CONVERSION_MAP.put(strippedLaTeX, "&" + aConversionList[1] + ";");
}
} else if (!(aConversionList[0].isEmpty()) && !strippedLaTeX.isEmpty()) {
} else if (!aConversionList[0].isEmpty() && !strippedLaTeX.isEmpty()) {
LATEX_HTML_CONVERSION_MAP.put(strippedLaTeX, "&#" + aConversionList[0] + ";");
}
if (!(aConversionList[0].isEmpty())) {
if (!aConversionList[0].isEmpty()) {
NUMERICAL_LATEX_CONVERSION_MAP.put(Integer.decode(aConversionList[0]), aConversionList[2]);
if (Integer.decode(aConversionList[0]) > 128) {
String unicodeSymbol = String.valueOf(Character.toChars(Integer.decode(aConversionList[0])));
Expand Down
Loading