Skip to content

Fix OpenRewrite#15670

Merged
Siedlerchr merged 9 commits into
mainfrom
fix-openrewrite
May 4, 2026
Merged

Fix OpenRewrite#15670
Siedlerchr merged 9 commits into
mainfrom
fix-openrewrite

Conversation

@koppor

@koppor koppor commented May 4, 2026

Copy link
Copy Markdown
Member

Follow-up to #15665

PR Description

Code quality for the win :)

Summary:

-        Duration eta = oneWorkTime.multipliedBy(workMax.get() - workDone.get() <= 0 ? 1 : workMax.get() - workDone.get());
+        Duration eta = oneWorkTime.multipliedBy(workMax.get() <= workDone.get() ? 1 : workMax.get() - workDone.get());

-            if (lines[i].trim().isEmpty()) {
+            if (lines[i].isBlank()) {
+import static java.util.function.Predicate.not;
+
...
-                   .filter(key -> !key.isEmpty())
+                   .filter(not(String::isEmpty))
-    @CsvSource({"rfc1945", "RFC1945", "1945"})
+    @ValueSource(strings = {"rfc1945", "RFC1945", "1945"})

-        assertEquals(Path.of("file9"), history.get(0));
+        assertEquals(Path.of("file9"), history.getFirst());
-                LOGGER.warn(loggerMessage + " (during expand)");
+                LOGGER.warn("{} (during expand)", loggerMessage);

Steps to test

See CI passing

Checklist

  • I own the copyright of the code submitted and I license it under the MIT license
  • I manually tested my changes in running JabRef (always required)
  • [/] I added JUnit tests for changes (if applicable)
  • [/] I added screenshots in the PR description (if change is visible to the user)
  • [/] I added a screenshot in the PR description showing a library with a single entry with me as author and as title the issue number
  • [/] I described the change in CHANGELOG.md in a way that can be understood by the average user (if change is visible to the user)
  • [/] I checked the user documentation for up to dateness and submitted a pull request to our user documentation repository

@qodo-free-for-open-source-projects

Copy link
Copy Markdown
Contributor

Review Summary by Qodo

Apply OpenRewrite modernizations and code quality improvements

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Replace .trim().isEmpty() with .isBlank() for cleaner code
• Use Predicate.not(String::isEmpty) instead of lambda negations
• Replace double literals d suffix (e.g., 60d to 60D)
• Simplify string concatenation with += operator
• Update test annotations from @CsvSource to @ValueSource
• Refactor switch statements to modern Java switch expressions
• Add Java code formatting action and integrate into CI/CD workflows
Diagram
flowchart LR
  A["Code Quality Issues"] -->|Replace trim().isEmpty| B["Use isBlank()"]
  A -->|Simplify filters| C["Use Predicate.not()"]
  A -->|String concatenation| D["Use += operator"]
  A -->|Literal formatting| E["Use uppercase D suffix"]
  F["Test Annotations"] -->|Replace CsvSource| G["Use ValueSource"]
  H["Switch Statements"] -->|Modernize| I["Use switch expressions"]
  J["CI/CD Workflows"] -->|Add formatting| K["Format Java action"]
  B --> L["Modernized Codebase"]
  C --> L
  D --> L
  E --> L
  G --> L
  I --> L
  K --> L
Loading

Grey Divider

File Changes

1. jabgui/src/main/java/org/jabref/gui/documentviewer/DocumentViewerViewModel.java ✨ Enhancement +1/-1

Replace trim().isEmpty() with isBlank()

jabgui/src/main/java/org/jabref/gui/documentviewer/DocumentViewerViewModel.java


2. jabgui/src/main/java/org/jabref/gui/edit/CopyMoreAction.java ✨ Enhancement +4/-1

Use Predicate.not() and isBlank() improvements

jabgui/src/main/java/org/jabref/gui/edit/CopyMoreAction.java


3. jabgui/src/main/java/org/jabref/gui/git/GitCommitDialogViewModel.java ✨ Enhancement +1/-1

Replace trim().isEmpty() with isBlank()

jabgui/src/main/java/org/jabref/gui/git/GitCommitDialogViewModel.java


View more (61)
4. jabgui/src/main/java/org/jabref/gui/groups/GroupTreeView.java ✨ Enhancement +4/-4

Uppercase double literal suffixes

jabgui/src/main/java/org/jabref/gui/groups/GroupTreeView.java


5. jabgui/src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java ✨ Enhancement +1/-1

Simplify string concatenation with += operator

jabgui/src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java


6. jabgui/src/main/java/org/jabref/gui/libraryproperties/constants/ConstantsItemModel.java ✨ Enhancement +2/-2

Replace trim().isEmpty() with isBlank()

jabgui/src/main/java/org/jabref/gui/libraryproperties/constants/ConstantsItemModel.java


7. jabgui/src/main/java/org/jabref/gui/libraryproperties/general/GeneralPropertiesView.java ✨ Enhancement +2/-2

Replace trim().isEmpty() with isBlank()

jabgui/src/main/java/org/jabref/gui/libraryproperties/general/GeneralPropertiesView.java


8. jabgui/src/main/java/org/jabref/gui/libraryproperties/keypattern/KeyPatternPropertiesViewModel.java ✨ Enhancement +2/-2

Replace trim().isEmpty() with isBlank()

jabgui/src/main/java/org/jabref/gui/libraryproperties/keypattern/KeyPatternPropertiesViewModel.java


9. jabgui/src/main/java/org/jabref/gui/preferences/citationkeypattern/CitationKeyPatternTabViewModel.java ✨ Enhancement +2/-2

Replace trim().isEmpty() with isBlank()

jabgui/src/main/java/org/jabref/gui/preferences/citationkeypattern/CitationKeyPatternTabViewModel.java


10. jabgui/src/main/java/org/jabref/gui/preferences/journals/JournalAbbreviationsTabViewModel.java ✨ Enhancement +2/-2

Replace trim().isEmpty() with isBlank()

jabgui/src/main/java/org/jabref/gui/preferences/journals/JournalAbbreviationsTabViewModel.java


11. jabgui/src/main/java/org/jabref/gui/preferences/websearch/WebSearchTabViewModel.java ✨ Enhancement +1/-1

Replace trim().isEmpty() with isBlank()

jabgui/src/main/java/org/jabref/gui/preferences/websearch/WebSearchTabViewModel.java


12. jabgui/src/main/java/org/jabref/gui/preview/ClipboardContentGenerator.java ✨ Enhancement +1/-1

Simplify string concatenation with += operator

jabgui/src/main/java/org/jabref/gui/preview/ClipboardContentGenerator.java


13. jabgui/src/main/java/org/jabref/gui/shared/SharedDatabaseLoginDialogViewModel.java ✨ Enhancement +1/-1

Replace trim().isEmpty() with isBlank()

jabgui/src/main/java/org/jabref/gui/shared/SharedDatabaseLoginDialogViewModel.java


14. jabgui/src/main/java/org/jabref/gui/util/MarkdownTextFlow.java ✨ Enhancement +1/-1

Replace trim().isEmpty() with isBlank()

jabgui/src/main/java/org/jabref/gui/util/MarkdownTextFlow.java


15. jabgui/src/main/java/org/jabref/gui/walkthrough/declarative/Trigger.java ✨ Enhancement +1/-1

Replace trim().isEmpty() with isBlank()

jabgui/src/main/java/org/jabref/gui/walkthrough/declarative/Trigger.java


16. jabgui/src/main/java/org/jabref/gui/welcome/quicksettings/viewmodel/ThemeDialogViewModel.java ✨ Enhancement +1/-1

Replace trim().isEmpty() with isBlank()

jabgui/src/main/java/org/jabref/gui/welcome/quicksettings/viewmodel/ThemeDialogViewModel.java


17. jablib/src/main/java/org/jabref/logic/bibtex/BibEntryWriter.java ✨ Enhancement +1/-1

Replace trim().isEmpty() with isBlank()

jablib/src/main/java/org/jabref/logic/bibtex/BibEntryWriter.java


18. jablib/src/main/java/org/jabref/logic/bst/BstFunctions.java ✨ Enhancement +1/-1

Replace trim().isEmpty() with isBlank()

jablib/src/main/java/org/jabref/logic/bst/BstFunctions.java


19. jablib/src/main/java/org/jabref/logic/citationkeypattern/CitationKeyGenerator.java ✨ Enhancement +1/-1

Replace trim().isEmpty() with isBlank()

jablib/src/main/java/org/jabref/logic/citationkeypattern/CitationKeyGenerator.java


20. jablib/src/main/java/org/jabref/logic/cleanup/UpgradePdfPsToFileCleanup.java ✨ Enhancement +1/-1

Replace trim().isEmpty() with isBlank()

jablib/src/main/java/org/jabref/logic/cleanup/UpgradePdfPsToFileCleanup.java


21. jablib/src/main/java/org/jabref/logic/importer/fetcher/LOBIDFetcher.java ✨ Enhancement +5/-2

Use Predicate.not() and isBlank() improvements

jablib/src/main/java/org/jabref/logic/importer/fetcher/LOBIDFetcher.java


22. jablib/src/main/java/org/jabref/logic/importer/fetcher/citation/semanticscholar/SemanticScholarCitationFetcher.java ✨ Enhancement +1/-1

Fix logging statement format

jablib/src/main/java/org/jabref/logic/importer/fetcher/citation/semanticscholar/SemanticScholarCitationFetcher.java


23. jablib/src/main/java/org/jabref/logic/importer/fileformat/CitaviXmlImporter.java ✨ Enhancement +5/-3

Use Predicate.not() and isBlank() improvements

jablib/src/main/java/org/jabref/logic/importer/fileformat/CitaviXmlImporter.java


24. jablib/src/main/java/org/jabref/logic/importer/fileformat/IsiImporter.java ✨ Enhancement +2/-2

Replace trim().isEmpty() with isBlank()

jablib/src/main/java/org/jabref/logic/importer/fileformat/IsiImporter.java


25. jablib/src/main/java/org/jabref/logic/importer/fileformat/MedlinePlainImporter.java ✨ Enhancement +1/-1

Replace trim().isEmpty() with isBlank()

jablib/src/main/java/org/jabref/logic/importer/fileformat/MedlinePlainImporter.java


26. jablib/src/main/java/org/jabref/logic/importer/fileformat/PicaXmlParser.java ✨ Enhancement +1/-1

Simplify string concatenation with += operator

jablib/src/main/java/org/jabref/logic/importer/fileformat/PicaXmlParser.java


27. jablib/src/main/java/org/jabref/logic/importer/fileformat/RepecNepImporter.java ✨ Enhancement +3/-3

Replace trim().isEmpty() with isBlank()

jablib/src/main/java/org/jabref/logic/importer/fileformat/RepecNepImporter.java


28. jablib/src/main/java/org/jabref/logic/importer/fileformat/RisImporter.java ✨ Enhancement +1/-1

Replace trim().isEmpty() with isBlank()

jablib/src/main/java/org/jabref/logic/importer/fileformat/RisImporter.java


29. jablib/src/main/java/org/jabref/logic/importer/fileformat/pdf/PdfContentImporter.java ✨ Enhancement +3/-3

Replace trim().isEmpty() with isBlank() and simplify increment

jablib/src/main/java/org/jabref/logic/importer/fileformat/pdf/PdfContentImporter.java


30. jablib/src/main/java/org/jabref/logic/importer/util/FileFieldParser.java ✨ Enhancement +1/-1

Replace trim().isEmpty() with isBlank()

jablib/src/main/java/org/jabref/logic/importer/util/FileFieldParser.java


31. jablib/src/main/java/org/jabref/logic/integrity/BooktitleContainsCountryChecker.java ✨ Enhancement +4/-1

Use Predicate.not() for filter operations

jablib/src/main/java/org/jabref/logic/integrity/BooktitleContainsCountryChecker.java


32. jablib/src/main/java/org/jabref/logic/journals/ltwa/LtwaTsvParser.java ✨ Enhancement +4/-1

Use Predicate.not() for filter operations

jablib/src/main/java/org/jabref/logic/journals/ltwa/LtwaTsvParser.java


33. jablib/src/main/java/org/jabref/logic/layout/LayoutEntry.java ✨ Enhancement +1/-1

Replace trim().isEmpty() with isBlank()

jablib/src/main/java/org/jabref/logic/layout/LayoutEntry.java


34. jablib/src/main/java/org/jabref/logic/layout/format/Authors.java ✨ Enhancement +6/-3

Use Predicate.not() and simplify concatenation

jablib/src/main/java/org/jabref/logic/layout/format/Authors.java


35. jablib/src/main/java/org/jabref/logic/layout/format/CurrentDate.java ✨ Enhancement +1/-1

Replace trim().isEmpty() with isBlank()

jablib/src/main/java/org/jabref/logic/layout/format/CurrentDate.java


36. jablib/src/main/java/org/jabref/logic/layout/format/DocBookAuthorFormatter.java ✨ Enhancement +8/-4

Use Predicate.not() for filter operations

jablib/src/main/java/org/jabref/logic/layout/format/DocBookAuthorFormatter.java


37. jablib/src/main/java/org/jabref/logic/layout/format/WrapFileLinks.java ✨ Enhancement +1/-1

Replace trim().isEmpty() with isBlank()

jablib/src/main/java/org/jabref/logic/layout/format/WrapFileLinks.java


38. jablib/src/main/java/org/jabref/logic/openoffice/action/EditMerge.java ✨ Enhancement +2/-2

Replace trim().isEmpty() and fix logging format

jablib/src/main/java/org/jabref/logic/openoffice/action/EditMerge.java


39. jablib/src/main/java/org/jabref/logic/openoffice/style/JStyle.java ✨ Enhancement +3/-3

Replace trim().isEmpty() with isBlank()

jablib/src/main/java/org/jabref/logic/openoffice/style/JStyle.java


40. jablib/src/main/java/org/jabref/logic/openoffice/style/OOPreFormatter.java ✨ Enhancement +11/-20

Refactor switch statement to expression

jablib/src/main/java/org/jabref/logic/openoffice/style/OOPreFormatter.java


41. jablib/src/main/java/org/jabref/logic/push/AbstractPushToApplication.java ✨ Enhancement +4/-1

Use Predicate.not() for filter operations

jablib/src/main/java/org/jabref/logic/push/AbstractPushToApplication.java


42. jablib/src/main/java/org/jabref/logic/push/PushToApplicationDetector.java ✨ Enhancement +2/-2

Replace trim().isEmpty() with isBlank()

jablib/src/main/java/org/jabref/logic/push/PushToApplicationDetector.java


43. jablib/src/main/java/org/jabref/logic/texparser/DefaultLatexParser.java ✨ Enhancement +1/-1

Replace trim().isEmpty() with isBlank()

jablib/src/main/java/org/jabref/logic/texparser/DefaultLatexParser.java


44. jablib/src/main/java/org/jabref/logic/util/ProgressCounter.java 🐞 Bug fix +1/-1

Fix duration calculation logic

jablib/src/main/java/org/jabref/logic/util/ProgressCounter.java


45. jablib/src/main/java/org/jabref/logic/util/URLUtil.java ✨ Enhancement +1/-1

Replace trim().isEmpty() with isBlank()

jablib/src/main/java/org/jabref/logic/util/URLUtil.java


46. jablib/src/main/java/org/jabref/logic/util/strings/StringUtil.java ✨ Enhancement +1/-1

Replace trim().isEmpty() with isBlank()

jablib/src/main/java/org/jabref/logic/util/strings/StringUtil.java


47. jablib/src/main/java/org/jabref/model/entry/BibEntry.java ✨ Enhancement +3/-1

Use Predicate.not() for filter operations

jablib/src/main/java/org/jabref/model/entry/BibEntry.java


48. jablib/src/test/java/org/jabref/logic/importer/fetcher/RfcFetcherTest.java 🧪 Tests +3/-3

Replace CsvSource with ValueSource annotation

jablib/src/test/java/org/jabref/logic/importer/fetcher/RfcFetcherTest.java


49. jablib/src/test/java/org/jabref/logic/importer/fileformat/BibtexImporterTest.java 🧪 Tests +3/-3

Replace CsvSource with ValueSource annotation

jablib/src/test/java/org/jabref/logic/importer/fileformat/BibtexImporterTest.java


50. jablib/src/test/java/org/jabref/logic/importer/fileformat/BibtexParserTest.java 🧪 Tests +2/-1

Replace CsvSource with ValueSource annotation

jablib/src/test/java/org/jabref/logic/importer/fileformat/BibtexParserTest.java


51. jablib/src/test/java/org/jabref/logic/importer/fileformat/MedlinePlainImporterTest.java 🧪 Tests +2/-2

Replace CsvSource with ValueSource annotation

jablib/src/test/java/org/jabref/logic/importer/fileformat/MedlinePlainImporterTest.java


52. jablib/src/test/java/org/jabref/logic/integrity/NoURLCheckerTest.java 🧪 Tests +2/-2

Replace CsvSource with ValueSource annotation

jablib/src/test/java/org/jabref/logic/integrity/NoURLCheckerTest.java


53. jablib/src/test/java/org/jabref/logic/l10n/JavaLocalizationEntryParser.java ✨ Enhancement +1/-1

Replace trim().isEmpty() with isBlank()

jablib/src/test/java/org/jabref/logic/l10n/JavaLocalizationEntryParser.java


54. jablib/src/test/java/org/jabref/logic/layout/LayoutEntryTest.java 🧪 Tests +2/-7

Replace CsvSource with ValueSource annotation

jablib/src/test/java/org/jabref/logic/layout/LayoutEntryTest.java


55. jablib/src/test/java/org/jabref/logic/search/query/SearchQueryTest.java 🧪 Tests +3/-3

Replace CsvSource with ValueSource annotation

jablib/src/test/java/org/jabref/logic/search/query/SearchQueryTest.java


56. jablib/src/test/java/org/jabref/logic/util/io/FileHistoryTest.java ✨ Enhancement +1/-1

Replace get(0) with getFirst() method

jablib/src/test/java/org/jabref/logic/util/io/FileHistoryTest.java


57. jablib/src/test/java/org/jabref/model/entry/AuthorTest.java 🧪 Tests +3/-4

Replace CsvSource with ValueSource annotation

jablib/src/test/java/org/jabref/model/entry/AuthorTest.java


58. jablib/src/test/java/org/jabref/model/entry/MonthTest.java 🧪 Tests +3/-3

Replace CsvSource with ValueSource annotation

jablib/src/test/java/org/jabref/model/entry/MonthTest.java


59. jabsrv/src/main/java/org/jabref/http/server/cayw/CitationProperties.java ✨ Enhancement +5/-2

Use Predicate.not() for filter operations

jabsrv/src/main/java/org/jabref/http/server/cayw/CitationProperties.java


60. .github/actions/format-java/action.yml ⚙️ Configuration changes +13/-0

Add Java code formatting GitHub action

.github/actions/format-java/action.yml


61. .github/ghprcomment.yml 📝 Documentation +1/-1

Update OpenRewrite instructions with formatting step

.github/ghprcomment.yml


62. .github/workflows/run-openrewrite.yml ⚙️ Configuration changes +10/-10

Integrate Java formatting into OpenRewrite workflow

.github/workflows/run-openrewrite.yml


63. .github/workflows/tests-code.yml ⚙️ Configuration changes +5/-6

Add Java formatting step to CI pipeline

.github/workflows/tests-code.yml


64. rewrite.yml ⚙️ Configuration changes +2/-2

Disable problematic OpenRewrite rules

rewrite.yml


Grey Divider

Qodo Logo

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (2) 📎 Requirement gaps (0)

Grey Divider


Action required

1. @valuesource misused text block📘 Rule violation ≡ Correctness
Description
The change replaces multi-value @CsvSource semantics with a single `@ValueSource(strings =
"""...""")` argument, likely collapsing multiple intended test cases into one string input. This
weakens test coverage and can hide regressions.
Code

jablib/src/test/java/org/jabref/model/entry/AuthorTest.java[R67-74]

+    @ValueSource(strings = """
              # Lower-case letters
              asdf
              a
              # Numbers
              1
              1 23
-                    """
-    )
+                    """)
Evidence
PR Compliance ID 26 prohibits weakening tests/assertions when updating tests. The modified
annotation uses @ValueSource(strings = """..."""), which supplies one string (the entire text
block) instead of the multiple individual inputs that @CsvSource previously provided.

AGENTS.md
jablib/src/test/java/org/jabref/model/entry/AuthorTest.java[67-74]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The parameterized test likely no longer iterates over the intended individual inputs because `@ValueSource(strings = """...""")` passes the entire text block as a single parameter value.
## Issue Context
This appears to be an OpenRewrite-style conversion from `@CsvSource` to `@ValueSource`, but it changes test semantics and reduces coverage.
## Fix Focus Areas
- jablib/src/test/java/org/jabref/model/entry/AuthorTest.java[65-77]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Unused imports break Checkstyle🐞 Bug ☼ Reliability
Description
Multiple files add import java.util.function.Predicate; but never reference Predicate (only the
static not(...)), which violates the project’s Checkstyle UnusedImports rule and will fail CI.
Code

jabgui/src/main/java/org/jabref/gui/edit/CopyMoreAction.java[7]

+import java.util.function.Predicate;
Evidence
Checkstyle is configured to fail on unused imports, and several modified files now contain a
Predicate import that is not used anywhere in the file beyond imports (only not(...) is used via
static import).

config/checkstyle/checkstyle.xml[88-110]
jabgui/src/main/java/org/jabref/gui/edit/CopyMoreAction.java[3-34]
jablib/src/main/java/org/jabref/logic/importer/fetcher/LOBIDFetcher.java[3-40]
jablib/src/main/java/org/jabref/logic/integrity/BooktitleContainsCountryChecker.java[3-17]
jablib/src/main/java/org/jabref/logic/journals/ltwa/LtwaTsvParser.java[3-20]
jablib/src/main/java/org/jabref/logic/layout/format/Authors.java[3-16]
jablib/src/main/java/org/jabref/logic/layout/format/DocBookAuthorFormatter.java[2-12]
jablib/src/main/java/org/jabref/logic/push/AbstractPushToApplication.java[3-27]
jabsrv/src/main/java/org/jabref/http/server/cayw/CitationProperties.java[2-12]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Several modified Java files import `java.util.function.Predicate` but never use the symbol (only the static import `Predicate.not` is used). This violates Checkstyle’s `UnusedImports` rule and fails CI.
### Issue Context
The project enables Checkstyle `UnusedImports`, which treats unused imports as errors.
### Fix Focus Areas
- jabgui/src/main/java/org/jabref/gui/edit/CopyMoreAction.java[4-8]
- jablib/src/main/java/org/jabref/logic/importer/fetcher/LOBIDFetcher.java[8-15]
- jablib/src/main/java/org/jabref/logic/integrity/BooktitleContainsCountryChecker.java[3-16]
- jablib/src/main/java/org/jabref/logic/journals/ltwa/LtwaTsvParser.java[9-17]
- jablib/src/main/java/org/jabref/logic/layout/format/Authors.java[3-14]
- jablib/src/main/java/org/jabref/logic/layout/format/DocBookAuthorFormatter.java[1-9]
- jablib/src/main/java/org/jabref/logic/push/AbstractPushToApplication.java[7-25]
- jabsrv/src/main/java/org/jabref/http/server/cayw/CitationProperties.java[2-10]
### Notes
Keep `import static java.util.function.Predicate.not;` (since `not(...)` is used); remove the non-static `import java.util.function.Predicate;` where it’s unused.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

3. writeField uses isPresent()+get 📘 Rule violation ⚙ Maintainability
Description
The updated code branches on value.isPresent() and then calls value.get(), which is explicitly
discouraged in favor of idiomatic Optional control flow. This increases the risk of future refactors
introducing NoSuchElementException and reduces readability.
Code

jablib/src/main/java/org/jabref/logic/bibtex/BibEntryWriter.java[170]

+        if (value.isPresent() && !value.get().isBlank()) {
Evidence
PR Compliance ID 34 forbids isPresent()/isEmpty() branching followed by get() in new/modified
code. The modified if condition in writeField uses value.isPresent() and value.get() on the
same line.

jablib/src/main/java/org/jabref/logic/bibtex/BibEntryWriter.java[170-170]
Best Practice: Learned patterns

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`writeField` uses `value.isPresent()` followed by `value.get()` in modified code.
## Issue Context
Compliance requires idiomatic Optional control flow (avoid presence-check + `get()`). This method also needs to keep `IOException` handling readable.
## Fix Focus Areas
- jablib/src/main/java/org/jabref/logic/bibtex/BibEntryWriter.java[170-176]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


4. Inline matches() regex used 📘 Rule violation ➹ Performance
Description
A modified line uses String.matches(...), which recompiles the regex each call and violates the
requirement to compile and reuse patterns. This can degrade performance in code paths that are
executed frequently.
Code

jablib/src/main/java/org/jabref/logic/importer/fileformat/RepecNepImporter.java[358]

+        return this.lastLine.matches("\\d+\\.\\s.*") && !this.inOverviewSection && this.preLine.isBlank();
Evidence
PR Compliance ID 10 requires compiling regexes once via Pattern.compile instead of calling
String.matches. The modified return statement in isStartOfWorkingPaper() still calls
this.lastLine.matches("\\d+\\.\\s.*").

AGENTS.md
jablib/src/main/java/org/jabref/logic/importer/fileformat/RepecNepImporter.java[358-358]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`isStartOfWorkingPaper()` uses `String.matches(...)` on a modified line, which recompiles the regex repeatedly.
## Issue Context
Compliance requires compiled `Pattern` constants and use of `matcher().matches()`.
## Fix Focus Areas
- jablib/src/main/java/org/jabref/logic/importer/fileformat/RepecNepImporter.java[355-359]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


5. Fork PR checkout broken 🐞 Bug ☼ Reliability
Description
run-openrewrite.yml now checks out using only ref: github.event.pull_request.head.ref without
also selecting the PR head repository/SHA, so it cannot reliably fetch PR branches that live in
forks (branch name exists only in the fork).
Code

.github/workflows/run-openrewrite.yml[R28-33]

+      - name: Checkout
  uses: actions/checkout@v6
  with:
    submodules: 'true'
-
-      - name: Checkout PR branch
-        run: |
-          gh pr checkout ${{ inputs.pr_number || github.event.pull_request.number }}
-        env:
-          GH_TOKEN: ${{secrets.GH_TOKEN_JABREF_MACHINE_PR_APPROVE}}
+          ref: ${{ inputs.branch || github.event.pull_request.head.ref }}
+          token: ${{ secrets.GH_TOKEN_JABREF_MACHINE_PR_APPROVE || github.token }}
Evidence
The workflow’s checkout step uses the head branch name (head.ref) but does not specify the head
repository (head.repo.full_name) or a SHA, which is necessary to uniquely identify PR sources
coming from forks.

.github/workflows/run-openrewrite.yml[22-34]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The OpenRewrite workflow checks out `ref: ${{ github.event.pull_request.head.ref }}` but does not specify the PR head repository or SHA. For fork PRs, the branch name typically does not exist in the base repo, so checkout can’t reliably fetch the PR content.
### Issue Context
The previous approach used `gh pr checkout`, which implicitly handled fork PRs. The new approach needs to explicitly select the correct repository/ref.
### Fix Focus Areas
- .github/workflows/run-openrewrite.yml[27-34]
### Suggested change
- For `pull_request` events, set:
- `repository: ${{ github.event.pull_request.head.repo.full_name }}`
- `ref: ${{ github.event.pull_request.head.sha }}` (or `head.ref` if you prefer branch)
- For `workflow_dispatch`, keep using the current repository + provided `inputs.branch`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View more (1)
6. Unpinned GitHub Action ref 🐞 Bug ⛨ Security
Description
The new composite action references leventeBajczi/intellij-idea-format@master, which is not pinned
to a tag or commit SHA, increasing supply-chain and reproducibility risk for CI formatting.
Code

.github/actions/format-java/action.yml[R7-10]

+    - uses: leventeBajczi/intellij-idea-format@master
+      with:
+        file-mask: "*.java"
+        settings-file: ".idea/codeStyles/Project.xml"
Evidence
The workflow will execute whatever code is currently at the master branch tip of a third-party
action, making CI behavior mutable over time.

.github/actions/format-java/action.yml[1-13]
Best Practice: GitHub Actions security hardening

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The composite action uses a third-party action pinned to a moving branch (`@master`). This can change unexpectedly and is a supply-chain risk.
### Issue Context
This action runs in CI and can modify/commit code.
### Fix Focus Areas
- .github/actions/format-java/action.yml[6-10]
### Suggested change
Replace `leventeBajczi/intellij-idea-format@master` with a pinned tag or (preferably) a full commit SHA, e.g.:
- `uses: leventeBajczi/intellij-idea-format@<commit_sha>`

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

Comment thread jablib/src/test/java/org/jabref/model/entry/AuthorTest.java Outdated
Comment thread jabgui/src/main/java/org/jabref/gui/edit/CopyMoreAction.java Outdated
@koppor koppor added status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers dev: code-quality Issues related to code or architecture decisions labels May 4, 2026
@Siedlerchr

Copy link
Copy Markdown
Member

Seems like some heylogs issue?
all prs are now linking to /files
grafik

@Siedlerchr Siedlerchr enabled auto-merge May 4, 2026 17:53
@Siedlerchr Siedlerchr added this pull request to the merge queue May 4, 2026
@github-actions github-actions Bot added the status: to-be-merged PRs which are accepted and should go into the merge-queue. label May 4, 2026
Merged via the queue into main with commit 695b449 May 4, 2026
61 checks passed
@Siedlerchr Siedlerchr deleted the fix-openrewrite branch May 4, 2026 18:31
Siedlerchr added a commit to FynnianB/jabref that referenced this pull request May 4, 2026
…rity

* upstream/main: (204 commits)
  New Crowdin updates (JabRef#15669)
  Fix OpenRewrite (JabRef#15670)
  Udpate heylogs (and fix CHANGELOG.md) (JabRef#15671)
  Improve security and prevent shell injection for push2applications (JabRef#15628)
  Fix depdency analysis (JabRef#15668)
  Always use CI-local "gradle", instead of gradlew (JabRef#15667)
  Change OpenRewrite task to use rewriteDryRun (JabRef#15664)
  Add small documentation to parameter (JabRef#15666)
  Fix markbaseChanged for "imported entries" (JabRef#15610)
  Add forgotten --fresh
  chore(deps): update dependency com.github.ben-manes.caffeine:caffeine to v3.2.4 (JabRef#15662)
  chore(deps): update jackson monorepo to v3.1.3 (JabRef#15659)
  chore(deps): update dependency org.glassfish.hk2:hk2-utils to v4.0.1 (JabRef#15657)
  chore(deps): update dependency org.glassfish.hk2:hk2-locator to v4.0.1 (JabRef#15656)
  fix gemsfx missing icon resolving (JabRef#15655)
  chore(deps): update dependency org.glassfish.hk2:hk2-api to v4.0.1 (JabRef#15654)
  chore(deps): update dependency org.postgresql:postgresql to v42.7.11 (JabRef#15634)
  Chore(deps): Bump tools.jackson:jackson-bom in /versions (JabRef#15653)
  Chore(deps): Bump dev.langchain4j:langchain4j-bom in /versions (JabRef#15652)
  Chore(deps): Bump com.dlsc.gemsfx:gemsfx in /versions (JabRef#15651)
  ...
Siedlerchr added a commit that referenced this pull request May 5, 2026
* upstream/main: (775 commits)
  Chore(deps): Bump com.konghq:unirest-modules-gson in /versions (#15682)
  Chore(deps): Bump org.glassfish.jaxb:jaxb-runtime in /versions (#15681)
  Update dependency com.konghq:unirest-modules-gson to v4.9.0 (#15679)
  Integrate with SearchRxiv  (#15373)
  Fix requirements (#15600)
  refactor: less objects during writing (#15677)
  Fix: suppress WARN for empty or blank column name in MainTableColumnModel#parse() (#15576)
  New Crowdin updates (#15676)
  Chore(deps): Bump com.github.ben-manes.caffeine:caffeine in /versions (#15673)
  Fix Nullwarnings - C (Mark bst package as nonnull by default) (#15663)
  Chore(deps): Bump com.github.javaparser:javaparser-symbol-solver-core (#15674)
  Chore(deps): Bump com.github.javaparser:javaparser-core in /versions (#15672)
  New Crowdin updates (#15669)
  Fix OpenRewrite (#15670)
  Udpate heylogs (and fix CHANGELOG.md) (#15671)
  Improve security and prevent shell injection for push2applications (#15628)
  Fix depdency analysis (#15668)
  Always use CI-local "gradle", instead of gradlew (#15667)
  Change OpenRewrite task to use rewriteDryRun (#15664)
  Add small documentation to parameter (#15666)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dev: code-quality Issues related to code or architecture decisions status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers status: to-be-merged PRs which are accepted and should go into the merge-queue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants