Skip to content

Refine code#15132

Merged
Siedlerchr merged 4 commits into
mainfrom
refine-code
Feb 17, 2026
Merged

Refine code#15132
Siedlerchr merged 4 commits into
mainfrom
refine-code

Conversation

@koppor

@koppor koppor commented Feb 16, 2026

Copy link
Copy Markdown
Member

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

@koppor koppor marked this pull request as ready for review February 16, 2026 22:07
@qodo-free-for-open-source-projects

Copy link
Copy Markdown
Contributor

Review Summary by Qodo

Extract CitationCountFetcher interface and refine code

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Extract getCitationCount method into new CitationCountFetcher interface
• Make CitationFetcher extend the new CitationCountFetcher interface
• Remove empty lines from PdfMergeDialog for cleaner code formatting
Diagram
flowchart LR
  A["CitationCountFetcher<br/>interface"] -->|"extends"| B["CitationFetcher<br/>interface"]
  C["PdfMergeDialog"] -->|"cleanup"| D["Remove empty lines"]
Loading

Grey Divider

File Changes

1. jablib/src/main/java/org/jabref/logic/importer/fetcher/citation/CitationCountFetcher.java ✨ Enhancement +14/-0

Create CitationCountFetcher interface

• New interface file created to define citation count fetching contract
• Contains getCitationCount method that returns Optional<Integer>
• Includes comprehensive JavaDoc documentation

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


2. jablib/src/main/java/org/jabref/logic/importer/fetcher/citation/CitationFetcher.java ✨ Enhancement +1/-7

Make CitationFetcher extend CitationCountFetcher

CitationFetcher now extends CitationCountFetcher interface
• getCitationCount method moved to parent interface
• Removed duplicate method documentation from this interface

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


3. jabgui/src/main/java/org/jabref/gui/externalfiles/PdfMergeDialog.java Formatting +0/-4

Remove empty lines for cleaner formatting

• Removed unnecessary empty lines between method statements
• Improved code formatting consistency
• No functional changes to logic

jabgui/src/main/java/org/jabref/gui/externalfiles/PdfMergeDialog.java


Grey Divider

Qodo Logo

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

qodo-free-for-open-source-projects Bot commented Feb 16, 2026

Copy link
Copy Markdown
Contributor

Code Review by Qodo

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

Grey Divider


Action required

1. CitationCountFetcher missing @NullMarked 📘 Rule violation ✓ Correctness
Description
The newly introduced public interface CitationCountFetcher defines a public API without JSpecify
null-marking, making nullability contracts unclear and potentially triggering nullness/quality-gate
issues. This violates the project expectation to use JSpecify for nullability in new public APIs.
Code

jablib/src/main/java/org/jabref/logic/importer/fetcher/citation/CitationCountFetcher.java[R8-13]

+public interface CitationCountFetcher {
+    /// Get the paper details that includes citation count field for a given {@link BibEntry}.
+    ///
+    /// @param entry entry to search citation count field
+    /// @return returns a {@link Integer} for citation count field (may be empty)
+    Optional<Integer> getCitationCount(BibEntry entry) throws FetcherException;
Evidence
PR Compliance ID 14 requires using JSpecify for nullability in new public APIs.
CitationCountFetcher is newly added and lacks @NullMarked (or equivalent package-level null
marking), while the related CitationFetcher interface in the same package is explicitly annotated
with @NullMarked, indicating the expected convention.

AGENTS.md
jablib/src/main/java/org/jabref/logic/importer/fetcher/citation/CitationCountFetcher.java[8-13]
jablib/src/main/java/org/jabref/logic/importer/fetcher/citation/CitationFetcher.java[10-15]

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

## Issue description
A new public interface (`CitationCountFetcher`) was introduced without JSpecify null-marking, which makes nullability expectations unclear and inconsistent with other interfaces in the same package.
## Issue Context
`CitationFetcher` in the same package is annotated with `@NullMarked`, suggesting the package expects JSpecify nullness defaults for public APIs.
## Fix Focus Areas
- jablib/src/main/java/org/jabref/logic/importer/fetcher/citation/CitationCountFetcher.java[1-14]
- jablib/src/main/java/org/jabref/logic/importer/fetcher/citation/CitationFetcher.java[10-15]

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


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

Comment on lines +8 to +13
public interface CitationCountFetcher {
/// Get the paper details that includes citation count field for a given {@link BibEntry}.
///
/// @param entry entry to search citation count field
/// @return returns a {@link Integer} for citation count field (may be empty)
Optional<Integer> getCitationCount(BibEntry entry) throws FetcherException;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Action required

1. citationcountfetcher missing @NullMarked 📘 Rule violation ✓ Correctness

The newly introduced public interface CitationCountFetcher defines a public API without JSpecify
null-marking, making nullability contracts unclear and potentially triggering nullness/quality-gate
issues. This violates the project expectation to use JSpecify for nullability in new public APIs.
Agent Prompt
## Issue description
A new public interface (`CitationCountFetcher`) was introduced without JSpecify null-marking, which makes nullability expectations unclear and inconsistent with other interfaces in the same package.

## Issue Context
`CitationFetcher` in the same package is annotated with `@NullMarked`, suggesting the package expects JSpecify nullness defaults for public APIs.

## Fix Focus Areas
- jablib/src/main/java/org/jabref/logic/importer/fetcher/citation/CitationCountFetcher.java[1-14]
- jablib/src/main/java/org/jabref/logic/importer/fetcher/citation/CitationFetcher.java[10-15]

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

@testlens-app

testlens-app Bot commented Feb 16, 2026

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: 99000ea
▶️ Tests: 11192 executed
⚪️ Checks: 53/53 completed


Learn more about TestLens at testlens.app.

@koppor koppor added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Feb 17, 2026
@Siedlerchr Siedlerchr enabled auto-merge February 17, 2026 17:04
@Siedlerchr Siedlerchr added this pull request to the merge queue Feb 17, 2026
@github-actions github-actions Bot added the status: to-be-merged PRs which are accepted and should go into the merge-queue. label Feb 17, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Feb 17, 2026
@Siedlerchr Siedlerchr added this pull request to the merge queue Feb 17, 2026
github-merge-queue Bot pushed a commit that referenced this pull request Feb 17, 2026
* Remove empty lines

* Extract interface

* Add JSpecify annotation
@Siedlerchr Siedlerchr removed this pull request from the merge queue due to a manual request Feb 17, 2026
@Siedlerchr Siedlerchr enabled auto-merge February 17, 2026 18:27
@Siedlerchr Siedlerchr added this pull request to the merge queue Feb 17, 2026
Merged via the queue into main with commit be7dfc9 Feb 17, 2026
54 checks passed
@Siedlerchr Siedlerchr deleted the refine-code branch February 17, 2026 19:26
Siedlerchr added a commit to ustmd/jabref that referenced this pull request Feb 20, 2026
* upstream/main: (26 commits)
  Fix matrix
  Feature visual timer 15122 (JabRef#15151)
  Chore(deps): Bump com.googlecode.plist:dd-plist from 1.28 to 1.29 in /versions (JabRef#15166)
  Chore(deps): Bump jablib/src/main/resources/csl-styles from `a0eb8d7` to `e306b56` (JabRef#15162)
  Chore(deps): Bump io.zonky.test.postgres:embedded-postgres-binaries-bom (JabRef#15165)
  Chore(deps): Bump jablib/src/main/resources/csl-locales (JabRef#15163)
  Chore(deps): Bump jablib/src/main/abbrv.jabref.org (JabRef#15164)
  Change Dependabot schedule from weekly to daily
  macos-15-intel should run on main only (JabRef#15161)
  Chore(deps): Bump jablib/src/main/resources/csl-styles (JabRef#15152)
  Chore(deps): Bump org.jetbrains:annotations in /versions (JabRef#15154)
  Chore(deps): Bump jablib/src/main/abbrv.jabref.org (JabRef#15153)
  Chore(deps): Bump org.itsallcode.openfasttrace from 3.1.0 to 3.1.1 (JabRef#15141)
  Chore(deps): Bump org.junit:junit-bom from 6.0.2 to 6.0.3 in /versions (JabRef#15148)
  Chore(deps): Bump org.eclipse.lsp4j:org.eclipse.lsp4j from 0.24.0 to 1.0.0 in /versions (JabRef#15149)
  Chore(deps): Bump org.postgresql:postgresql in /versions (JabRef#15146)
  Chore(deps): Bump net.bytebuddy:byte-buddy in /versions (JabRef#15147)
  Refine code (JabRef#15132)
  Chore(deps): Bump com.dlsc.gemsfx:gemsfx in /versions (JabRef#15143)
  Update dependency de.undercouch:citeproc-java to v3.5.0 (JabRef#15145)
  ...
RakockiW pushed a commit to RakockiW/jabref that referenced this pull request Mar 1, 2026
* Remove empty lines

* Extract interface

* Add JSpecify annotation

---------

Co-authored-by: Christoph <siedlerkiller@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: fetcher 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.

2 participants