Skip to content

improve-imported-entries#14999

Merged
calixtus merged 4 commits into
mainfrom
improve-imported-entries
Feb 2, 2026
Merged

improve-imported-entries#14999
calixtus merged 4 commits into
mainfrom
improve-imported-entries

Conversation

@koppor

@koppor koppor commented Feb 2, 2026

Copy link
Copy Markdown
Member

User description

I converted "imported entries" to all lower case - and at some files, I had two groups

  • Imported entries
  • imported entries

This PR fixes that by being case-insensitive when checking for precense.

This refs #14998

Steps to test

  1. Freshly installed JabRef
  2. Enable "import entries" group in preferences
  3. See that all lower case.

Mandatory checks

  • 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 described the change in CHANGELOG.md in a way that is understandable for the average user (if change is visible to the user)
  • [/] I checked the user documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request updating file(s) in https://github.com/JabRef/user-documentation/tree/main/en.

PR Type

Bug fix, Enhancement


Description

  • Make "Imported entries" group detection case-insensitive

  • Improve whitespace handling in group name validation

  • Prevent duplicate groups with different casing


Diagram Walkthrough

flowchart LR
  A["Group Name Input"] --> B["Trim Whitespace"]
  B --> C["Store Normalized Name"]
  C --> D["Case-Insensitive Lookup"]
  D --> E["Add Entries to Group"]
Loading

File Walkthrough

Relevant files
Bug fix
ImportHandler.java
Make group name comparison case-insensitive                           

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

  • Changed equals() to equalsIgnoreCase() when comparing group names
  • Ensures imported entries are added to existing groups regardless of
    case differences
+1/-1     
GroupTreeViewModel.java
Case-insensitive group existence check                                     

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

  • Changed equals() to equalsIgnoreCase() when checking group existence
  • Prevents creation of duplicate "Imported entries" groups with
    different casing
+1/-1     
Enhancement
WebSearchTabViewModel.java
Improve whitespace handling in group names                             

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

  • Simplified empty check using trim().isEmpty() instead of checking for
    leading spaces
  • Apply trim() to group name before storing to normalize whitespace
  • Improves robustness of group name validation
+2/-2     
Documentation
CHANGELOG.md
Document case-insensitive group checking                                 

CHANGELOG.md

  • Added entry documenting case-insensitive group detection improvement
+1/-0     

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

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

Copy link
Copy Markdown
Contributor

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

  • Update
Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

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

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

Copy link
Copy Markdown
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Prevent null pointer and improve efficiency

Add a null check for addImportedEntriesGroupName.getValue() to prevent potential
NullPointerException and refactor to improve efficiency by storing the value in
a local variable.

jabgui/src/main/java/org/jabref/gui/preferences/websearch/WebSearchTabViewModel.java [211-215]

-if (addImportedEntriesGroupName.getValue().trim().isEmpty()) {
+String groupName = addImportedEntriesGroupName.getValue();
+if (groupName == null || groupName.trim().isEmpty()) {
     libraryPreferences.setAddImportedEntriesGroupName(Localization.lang("Imported entries"));
 } else {
-    libraryPreferences.setAddImportedEntriesGroupName(addImportedEntriesGroupName.getValue().trim());
+    libraryPreferences.setAddImportedEntriesGroupName(groupName.trim());
 }
  • Apply / Chat
Suggestion importance[1-10]: 5

__

Why: The suggestion correctly identifies a potential NullPointerException and proposes a more robust and efficient implementation by adding a null check and using a local variable to avoid redundant method calls.

Low
  • Update

@calixtus calixtus added this pull request to the merge queue Feb 2, 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 2, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Feb 2, 2026
@calixtus calixtus enabled auto-merge February 2, 2026 12:41
@calixtus calixtus added this pull request to the merge queue Feb 2, 2026
Merged via the queue into main with commit db1a085 Feb 2, 2026
54 checks passed
@calixtus calixtus deleted the improve-imported-entries branch February 2, 2026 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Review effort 2/5 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