Skip to content

Fix: Reset External File Type to default#15167

Merged
calixtus merged 11 commits into
JabRef:mainfrom
pluto-han:fix-for-issue-15117
Feb 23, 2026
Merged

Fix: Reset External File Type to default#15167
calixtus merged 11 commits into
JabRef:mainfrom
pluto-han:fix-for-issue-15117

Conversation

@pluto-han

Copy link
Copy Markdown
Collaborator

Related issues and pull requests

Closes #15117

PR Description

This PR fixes the issue where resetting preference does not reset External File Type to default. This is fixed by adding getDefaultExternalFileTypes() in ExternalApplicationsPreferences() .ExternalApplicationsPreferences().

Required vefirication screenshot:
image

Steps to test

  1. Open File -> Preferences. Click reset preferences.

  2. Note that it does not clear External File Type but reset it to default.

image image

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

Fix External File Type reset to default in preferences

🐞 Bug fix

Grey Divider

Walkthroughs

Description
• Fixes External File Type not resetting to default when preferences are reset
• Initializes external file types with default values in constructor
• Updates CHANGELOG.md with issue reference

Grey Divider

File Changes

1. jabgui/src/main/java/org/jabref/gui/frame/ExternalApplicationsPreferences.java 🐞 Bug fix +2/-1

Initialize external file types with defaults

• Added import for ExternalFileTypes class
• Changed default initialization of externalFileTypes from empty set to default external file
 types
• Uses Set.copyOf(ExternalFileTypes.getDefaultExternalFileTypes()) instead of Set.of()

jabgui/src/main/java/org/jabref/gui/frame/ExternalApplicationsPreferences.java


2. CHANGELOG.md 📝 Documentation +1/-0

Document External File Type reset fix

• Added entry documenting the fix for issue #15117
• Describes the fix for External File Type reset behavior

CHANGELOG.md


Grey Divider

Qodo Logo

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

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

Copy link
Copy Markdown
Contributor

Code Review by Qodo

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

Grey Divider


Remediation recommended

1. Misaligned externalFileTypes argument📘 Rule violation ✓ Correctness
Description
The new constructor argument line introduces excessive whitespace before the inline comment,
deviating from surrounding formatting and reducing readability. This violates the requirement to
keep formatting consistent and diffs minimal.
Code

jabgui/src/main/java/org/jabref/gui/frame/ExternalApplicationsPreferences.java[54]

+                Set.copyOf(ExternalFileTypes.getDefaultExternalFileTypes()),                                                                    // externalFileTypes
Evidence
The checklist requires adhering to existing formatting and avoiding style-only noise in touched
areas. The modified line has unusually large spacing before the // externalFileTypes comment
compared to adjacent arguments, indicating a formatting inconsistency introduced by this PR.

AGENTS.md
AGENTS.md
jabgui/src/main/java/org/jabref/gui/frame/ExternalApplicationsPreferences.java[51-56]

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 modified argument line in `ExternalApplicationsPreferences()` has excessive whitespace before the inline comment, deviating from surrounding formatting.
## Issue Context
The constructor arguments use aligned inline comments for readability; the new `externalFileTypes` argument was updated but now has inconsistent spacing.
## Fix Focus Areas
- jabgui/src/main/java/org/jabref/gui/frame/ExternalApplicationsPreferences.java[51-56]

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


2. No test for preference reset 📘 Rule violation ⛯ Reliability
Description
This PR changes default handling of externalFileTypes when creating default preferences, which is
a behavior change. No corresponding test changes are included to prevent regressions.
Code

jabgui/src/main/java/org/jabref/gui/frame/ExternalApplicationsPreferences.java[54]

+                Set.copyOf(ExternalFileTypes.getDefaultExternalFileTypes()),                                                                    // externalFileTypes
Evidence
The checklist requires behavior changes to be covered by tests. The PR modifies default preference
construction for externalFileTypes, but the provided diff contains no test additions/updates to
assert the new default/reset behavior.

AGENTS.md
jabgui/src/main/java/org/jabref/gui/frame/ExternalApplicationsPreferences.java[50-67]

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 behavior change was made to default construction of `ExternalApplicationsPreferences` (`externalFileTypes` now uses `ExternalFileTypes.getDefaultExternalFileTypes()`), but no tests were updated to cover this reset/default behavior.
## Issue Context
The change fixes a regression where resetting preferences did not restore External File Types to defaults. A deterministic test should assert that default preferences (or the reset path, if testable) contains the expected default external file types.
## Fix Focus Areas
- jabgui/src/main/java/org/jabref/gui/frame/ExternalApplicationsPreferences.java[50-67]

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



Advisory comments

3. Changelog link format🐞 Bug ✓ Correctness
Description
The new CHANGELOG entry uses inconsistent issue link formatting and inconsistent
wording/capitalization compared to adjacent entries and the UI tab name, reducing documentation
consistency.
Code

CHANGELOG.md[49]

+- We fixed an issue where resetting preference does not reset External File Type to default. [15117](https://github.com/JabRef/jabref/issues/15117)
Evidence
The new entry links to the issue without the conventional # prefix used by surrounding items, and
the UI uses the phrasing “External file types” (plural, lower-case), while the changelog says
“External File Type”.

CHANGELOG.md[44-55]
jabgui/src/main/java/org/jabref/gui/preferences/externalfiletypes/ExternalFileTypesTab.java[35-38]

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 new CHANGELOG entry is inconsistent with surrounding entries: it uses `[15117](...)` instead of `[#15117](...)`, and it refers to “External File Type” (singular, title case) while the UI uses “External file types”.
## Issue Context
This is a documentation-only consistency fix; no runtime behavior changes required.
## Fix Focus Areas
- CHANGELOG.md[49-49]
- jabgui/src/main/java/org/jabref/gui/preferences/externalfiletypes/ExternalFileTypesTab.java[35-38]

ⓘ 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

@github-actions github-actions Bot added good first issue An issue intended for project-newcomers. Varies in difficulty. status: changes-required Pull requests that are not yet complete labels Feb 19, 2026
@testlens-app

testlens-app Bot commented Feb 19, 2026

Copy link
Copy Markdown

🔎 No tests executed 🔎

🏷️ Commit: 54526dc
▶️ Tests: 0 executed
⚪️ Checks: 49/49 completed


Learn more about TestLens at testlens.app.

Localization.lang("References"), // eMailSubject
OS.WINDOWS, // shouldAutoOpenEmailAttachmentsFolder
Set.of(), // externalFileTypes
Set.copyOf(ExternalFileTypes.getDefaultExternalFileTypes()), // externalFileTypes

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why copyOf?
Also please adjust the comment alignment with the others in the column

@pluto-han pluto-han Feb 20, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Because Set.copyOf can unpack elements in the list, but Set.of cannot.

Comments are aligned now.

@aniruddhkorde9-dot

Copy link
Copy Markdown

Hello! I am a new contributor looking to get involved. I would love to work on this issue. Could you please assign it to me?

@subhramit

Copy link
Copy Markdown
Member

Hello! I am a new contributor looking to get involved. I would love to work on this issue. Could you please assign it to me?

You'll be blocked if you have no idea about GitHub and spam assignment requests on PRs this way. Please have the minimum courtesy of looking through how Open Source projects are worked on, and go through a project's contributing guidelines.

@github-actions github-actions Bot added status: changes-required Pull requests that are not yet complete and removed status: no-bot-comments labels Feb 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Your pull request conflicts with the target branch.

Please merge with your code. For a step-by-step guide to resolve merge conflicts, see https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/resolving-a-merge-conflict-using-the-command-line.

@github-actions github-actions Bot added status: no-bot-comments and removed status: changes-required Pull requests that are not yet complete labels Feb 23, 2026
calixtus
calixtus previously approved these changes Feb 23, 2026

@calixtus calixtus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me

@calixtus calixtus enabled auto-merge February 23, 2026 20:54
@github-actions github-actions Bot added the status: changes-required Pull requests that are not yet complete label Feb 23, 2026
@github-actions github-actions Bot added status: no-bot-comments and removed status: changes-required Pull requests that are not yet complete labels Feb 23, 2026
@calixtus calixtus added this pull request to the merge queue Feb 23, 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 23, 2026
Merged via the queue into JabRef:main with commit 2cdc35c Feb 23, 2026
51 checks passed
Siedlerchr added a commit that referenced this pull request Feb 25, 2026
* refs/heads/main:
  Increase max assignments from 2 to 3
  Chore(deps): Bump io.zonky.test:embedded-postgres in /versions (#15213)
  Chore(deps): Bump jablib/src/main/resources/csl-styles (#15211)
  New Crowdin updates (#15208)
  Fix: Prevent creating empty or duplicate fields  (#15168)
  chore(deps): update jackson monorepo to v3.1.0 (#15203)
  Update KeywordEditor to work with escaping (#14929)
  Chore(deps): Bump com.dlsc.gemsfx:gemsfx in /versions (#15205)
  Chore(deps): Bump tools.jackson:jackson-bom in /versions (#15206)
  Fix: Reset External File Type to default (#15167)
  docs: fix link formatting in ADR 0012 (#15201)
RakockiW pushed a commit to RakockiW/jabref that referenced this pull request Mar 1, 2026
* reset preference

* add CHANGELOG.md

* add CHANGELOG.md

* align comments

* update CHANGELOG.md

* Fixed comment indentation

* fix mapping of vars

* fix gradle

---------

Co-authored-by: Carl Christian Snethlage <50491877+calixtus@users.noreply.github.com>
Co-authored-by: Siedlerchr <siedlerkiller@gmail.com>
priyanshu16095 pushed a commit to priyanshu16095/jabref that referenced this pull request Mar 3, 2026
* reset preference

* add CHANGELOG.md

* add CHANGELOG.md

* align comments

* update CHANGELOG.md

* Fixed comment indentation

* fix mapping of vars

* fix gradle

---------

Co-authored-by: Carl Christian Snethlage <50491877+calixtus@users.noreply.github.com>
Co-authored-by: Siedlerchr <siedlerkiller@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

good first issue An issue intended for project-newcomers. Varies in difficulty. status: no-bot-comments 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.

Resetting of Preferences clears External File Type and does not reset them to default

5 participants