Skip to content

Conversation

@Preetam1804
Copy link
Contributor

@Preetam1804 Preetam1804 commented Jan 9, 2026

User description

Closes #14804

Description

I fixed an issue where a generic "Error Occurred" dialog was shown instead of a specific warning when invalid BibTeX was entered in the Source Tab. This generic error caused the user to lose context and offered no guidance on how to fix the syntax.

Changes made:

  • Replaced "showErrorDialogAndWait" with "showWarningDialogAndWait" in "SourceTab.java" to restore the correct warning icon (Triangle instead of Red Cross).
  • Changed the dialog title from "Error Occurred" to "Problem with parsing entry" to provide specific context.
  • Added a helpful error message: "Parsing failed because more than one entry was found. Please check your BibTeX syntax."

Steps to test

  1. Create a new library and a new entry.
  2. Open the BibTeX Source tab.
  3. Paste the following code (containing two entries) into the source editor:
    @article{test1, title={One}, author={A}}
    @article{test2, title={Two}, author={B}}
  4. Click on another tab (e.g., "Required fields") to trigger the validation.
  5. Verify: The dialog box should now display the warning triangle, the title "Problem with parsing entry", and the specific explanation.

Preview

image
  • 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


Description

  • Replace generic error dialog with specific warning dialog for BibTeX parsing issues

  • Change dialog title to "Problem with parsing entry" for better context

  • Add detailed error message explaining the parsing failure and guidance

  • Use warning icon instead of error icon for improved user experience


Diagram Walkthrough

flowchart LR
  A["Generic Error Dialog<br/>showErrorDialogAndWait"] -->|Replace with| B["Specific Warning Dialog<br/>showWarningDialogAndWait"]
  B --> C["Title: Problem with parsing entry"]
  B --> D["Message: Parsing failed + guidance"]
  B --> E["Warning icon instead of error icon"]
Loading

File Walkthrough

Relevant files
Bug fix
SourceTab.java
Replace generic error with specific warning dialog             

jabgui/src/main/java/org/jabref/gui/entryeditor/SourceTab.java

  • Replaced showErrorDialogAndWait() with showWarningDialogAndWait() for
    multiple entry parsing errors
  • Changed dialog title from generic "More than one entry found." to
    specific "Problem with parsing entry"
  • Added detailed error message with context and guidance: "Parsing
    failed because more than one entry was found. Please check your BibTeX
    syntax."
  • Improved user experience by displaying warning icon instead of error
    icon
+5/-1     

@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2026

Hey @Preetam1804! 👋

Thank you for contributing to JabRef!

We have automated checks in place, based on which you will soon get feedback if any of them are failing. We also use Qodo for review assistance. It will update your pull request description with a review help and offer suggestions to improve the pull request.

After all automated checks pass, a maintainer will also review your contribution. Once that happens, you can go through their comments in the "Files changed" tab and act on them, or reply to the conversation if you have further inputs. You can read about the whole pull request process in our contribution guide.

Please ensure that your pull request is in line with our AI Usage Policy and make necessary disclosures.

@qodo-free-for-open-source-projects
Copy link
Contributor

qodo-free-for-open-source-projects bot commented Jan 9, 2026

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

@jabref-machine
Copy link
Collaborator

Note that your PR will not be reviewed/accepted until you have gone through the mandatory checks in the description and marked each of them them exactly in the format of [x] (done), [ ] (not done yet) or [/] (not applicable). Please adhere to our pull request template.

@qodo-free-for-open-source-projects
Copy link
Contributor

qodo-free-for-open-source-projects bot commented Jan 9, 2026

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Remove unconventional inline comments
Suggestion Impact:The commit directly implemented the suggestion by removing the inline comments "// The Specific Title" and "// Context + Guidance" from lines 7-8 of the showWarningDialogAndWait method call, exactly as suggested.

code diff:

                 dialogService.showWarningDialogAndWait(
-                        Localization.lang("Problem with parsing entry"), // The Specific Title
-                        Localization.lang("Parsing failed because more than one entry was found. Please check your BibTeX syntax.") // Context + Guidance
+                        Localization.lang("Problem with parsing entry"),
+                        Localization.lang("Parsing failed because more than one entry was found. Please check your BibTeX syntax.")
                 );

Remove the unconventional and redundant inline comments from the
showWarningDialogAndWait method call to improve code cleanliness.

jabgui/src/main/java/org/jabref/gui/entryeditor/SourceTab.java [286-289]

 dialogService.showWarningDialogAndWait(
-        Localization.lang("Problem with parsing entry"), // The Specific Title
-        Localization.lang("Parsing failed because more than one entry was found. Please check your BibTeX syntax.") // Context + Guidance
+        Localization.lang("Problem with parsing entry"),
+        Localization.lang("Parsing failed because more than one entry was found. Please check your BibTeX syntax.")
 );

[Suggestion processed]

Suggestion importance[1-10]: 4

__

Why: The suggestion correctly identifies unconventional inline comments that were likely left over from development and proposes their removal, which is a valid code style improvement.

Low
  • Update

@github-actions github-actions bot added the status: changes-required Pull requests that are not yet complete label Jan 9, 2026
@jabref-machine
Copy link
Collaborator

You have removed the "Mandatory Checks" section from your pull request description. Please adhere to our pull request template.

@calixtus
Copy link
Member

calixtus commented Jan 9, 2026

@SoapOperaTester

Please check if your requirements are met.

@Siedlerchr Siedlerchr added this pull request to the merge queue Jan 16, 2026
github-merge-queue bot pushed a commit that referenced this pull request Jan 16, 2026
* Fix generic error dialog and icon in Source Tab parsing

* removed the comment

* removed inline comment

* Removed the obselete key from Jabred_en.properties
Merged via the queue into JabRef:main with commit f4d14d6 Jan 16, 2026
49 checks passed
Siedlerchr added a commit to st-rm-ng/jabref that referenced this pull request Jan 17, 2026
* upstream/main: (64 commits)
  New Crowdin updates (JabRef#14862)
  Make JDK25 available (JabRef#14861)
  Fix empty entries array when exporting group chat to JSON (JabRef#14814)
  feat: add right-click copy context menu to AI chat messages (JabRef#14722)
  FIX : generic error dialog and icon in Source Tab parsing (JabRef#14828)
  Factor out setup-* actions (JabRef#14859)
  Link .http files.
  Update dependency org.postgresql:postgresql to v42.7.9 (JabRef#14857)
  Add more commands to JabSrv (JabRef#14855)
  Fix JabRef#14821: Hide identifier action buttons when field is empty (JabRef#14831)
  Add GH_TOKEN to closed issues/PRs processing step
  New Crowdin updates (JabRef#14854)
  New Crowdin updates (JabRef#14849)
  Chore(deps): Bump jablib/src/main/resources/csl-styles from `0201999` to `f345aa8` (JabRef#14833)
  Add support for book front covers, again (JabRef#14777)
  Readd min width to button in new enty dialog (JabRef#14791)
  Replace plugin impl from jbang plugin (JabRef#14846)
  Revise AI policy wording
  Chore(deps): Bump jablib/src/main/resources/csl-locales (JabRef#14677)
  Update dependency com.konghq:unirest-modules-gson to v4.7.1 (JabRef#14845)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Source tab parsing error dialog became generic and lost context/help text

4 participants