-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Added MonthPlausibilityComparator #14457 #14745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added MonthPlausibilityComparator #14457 #14745
Conversation
|
Hey @keerthansamudrala! 👋 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. |
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||
|
The requested changes were not addressed for 14 days. Please follow-up in the next 7 days or your PR will be automatically closed. You can check the contributing guidelines for hints on the pull request process. |
|
Your code currently does not meet JabRef's code guidelines. IntelliJ auto format covers some cases. There seem to be issues with your code style and autoformat configuration. Please reformat your code (Ctrl+Alt+L) and commit, then push. |
|
Hi, I converted the comment to a Javadoc-style block and ran IntelliJ’s reformat (⌘⌥L) with standard options (optimize imports, rearrange code, code cleanup). IntelliJ reports “No lines changed: content is already properly formatted”, and I consistently end up with the current layout of the Javadoc comment. Could you please confirm whether this formatting is acceptable and aligns with JabRef’s preferred style, or if you would prefer a different comment structure (for example, a single-line Javadoc or a different placement)? |
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||||||||||
|
|
||
| /// If the left entry type is misc then prefer the the right value | ||
| /// If | ||
| /// the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rever the javadoc formatting here
|
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. |
You can research why IntelliJ does that line breaking... And search for IntelliJ issues... We saw this behavior but did not track it down to the root cause yet. |
koppor
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SPAM!!
This copies #14629 and claims to be the original author.

User description
Closes #14457
I have implemented the MonthPlausibilityComparator to handle month field reconciliation. This comparator uses a priority-based hierarchy (JabRef format > BibTeX short name > Numbers) to suggest the most standard month format when merging or comparing entries.
Note to Reviewers: I have included temporary comments within the logic to explain the specific decision-making for each "Tier" (JabRef format, Short names, Numbers, etc.). If the logic and implementation meet the project standards, I will remove these comments to provide a final "clean code" version for merging.
Steps to test
1. Run the newly added JUnit test :
org.jabref.logic.bibtex.comparator.plausibility.MonthPlausibilityComparatorTest.
2. Verify that the 16 tests pass, covering scenarios such as:

- Preference for #jan# over jan.
- Preference for jan over January.
- Preference for 1 over January.
- Correct handling of conflicting months (e.g., June vs. July) by returning UNDETERMINED.
Mandatory checks
CHANGELOG.mdin a way that is understandable for the average user (if change is visible to the user)PR Type
Enhancement, Tests
Description
Implemented MonthPlausibilityComparator for month field reconciliation
Uses priority-based hierarchy: JabRef format > short names > numbers
Added 16 comprehensive JUnit tests covering various month format scenarios
Integrated comparator into PlausibilityComparatorFactory for automatic field handling
Diagram Walkthrough
File Walkthrough
MonthPlausibilityComparator.java
New MonthPlausibilityComparator implementationjablib/src/main/java/org/jabref/logic/bibtex/comparator/plausibility/MonthPlausibilityComparator.java
(#jan#) > short names (jan) > numbers (1) > string length
UNDETERMINED
PlausibilityComparatorFactory.java
Register MonthPlausibilityComparator in factoryjablib/src/main/java/org/jabref/logic/bibtex/comparator/plausibility/PlausibilityComparatorFactory.java
FieldProperty.MONTH
method
MonthPlausibilityComparatorTest.java
Comprehensive test suite for MonthPlausibilityComparatorjablib/src/test/java/org/jabref/logic/bibtex/comparator/plausibility/MonthPlausibilityComparatorTest.java
names over numbers, numbers over full names
case sensitivity
invalid inputs
EntryTypePlausibilityComparator.java
Reformat JavaDoc comment formattingjablib/src/main/java/org/jabref/logic/bibtex/comparator/plausibility/EntryTypePlausibilityComparator.java
Project.xml
Update IDE code style configuration.idea/codeStyles/Project.xml