Skip to content

Fix javadoc markdown artifacts#15309

Open
AbhijitBhowmick wants to merge 6 commits intoJabRef:mainfrom
AbhijitBhowmick:14897-fix-javadoctoMarkdown-repairs
Open

Fix javadoc markdown artifacts#15309
AbhijitBhowmick wants to merge 6 commits intoJabRef:mainfrom
AbhijitBhowmick:14897-fix-javadoctoMarkdown-repairs

Conversation

@AbhijitBhowmick
Copy link

@AbhijitBhowmick AbhijitBhowmick commented Mar 9, 2026

Related issues and pull requests

Closes #14897

PR Description

1.This incorporates all the pending old Javadoc to Markdown changes required after merging #14891.
2.The following files are changed: 2.1.AutoCompletionTextInputBinding.java 2.2.JabRefCliPreferences.java 3.3.SearchBasedParserFetcher.java 4.4.StartNewStudyAction.java

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

@github-actions
Copy link
Contributor

github-actions bot commented Mar 9, 2026

Hey @AbhijitBhowmick! 👋

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

Review Summary by Qodo

Convert Javadoc to Markdown and standardize comment formatting

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Convert Javadoc comment style from /// to standard /**/ format
• Replace ASCII art section dividers with // region: and // endRegion markers
• Remove HTML list tags (<ol>, </ol>) from documentation comments
• Improve code organization and readability with consistent comment formatting
Diagram
flowchart LR
  A["Old Javadoc Style<br/>/// comments<br/>ASCII dividers"] -- "Convert to" --> B["Standard Format<br/>/* */ comments<br/>region markers"]
  B -- "Applied to" --> C["4 Java Files<br/>AutoCompletion<br/>Preferences<br/>Fetcher<br/>Study Action"]
Loading

Grey Divider

File Changes

1. jabgui/src/main/java/org/jabref/gui/autocompleter/AutoCompletionTextInputBinding.java Formatting +26/-24

Convert copyright header to standard block comment

• Convert copyright header from /// line comments to standard /* */ block comment format
• Maintain all copyright and license information with improved readability

jabgui/src/main/java/org/jabref/gui/autocompleter/AutoCompletionTextInputBinding.java


2. jabgui/src/main/java/org/jabref/gui/slr/StartNewStudyAction.java 📝 Documentation +2/-2

Remove HTML list tags from documentation

• Remove HTML <ol> and </ol> tags from Javadoc comments
• Replace with plain text format using /// prefix for list items

jabgui/src/main/java/org/jabref/gui/slr/StartNewStudyAction.java


3. jablib/src/main/java/org/jabref/logic/importer/SearchBasedParserFetcher.java 📝 Documentation +2/-2

Remove HTML list tags from interface docs

• Remove HTML <ol> and </ol> tags from interface documentation
• Simplify list formatting in Javadoc comments

jablib/src/main/java/org/jabref/logic/importer/SearchBasedParserFetcher.java


View more (1)
4. jablib/src/main/java/org/jabref/logic/preferences/JabRefCliPreferences.java Formatting +23/-39

Replace ASCII dividers with region markers throughout

• Replace ASCII art section dividers (/// with asterisks) with // region: and // endRegion
 markers
• Standardize 12+ section headers throughout the file including serializer logic, backing store
 access, cleanup, custom entry types, misc, network preferences, citation key patterns, bib entry
 preferences, internal preferences, linked files, import/export, importer preferences
• Improve code organization and readability with consistent region-based commenting

jablib/src/main/java/org/jabref/logic/preferences/JabRefCliPreferences.java


Grey Divider

Qodo Logo

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

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

Code Review by Qodo

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

Grey Divider


Remediation recommended

1. // endRegion casing inconsistent📘 Rule violation ✓ Correctness
Description
The PR introduces mixed // endregion and // endRegion markers in JabRefCliPreferences, which
breaks the established convention and can reduce readability/IDE-folding consistency. Standardize
the casing to match the project’s existing style.
Code

jablib/src/main/java/org/jabref/logic/preferences/JabRefCliPreferences.java[1169]

+    // endRegion
Evidence
Compliance requires adherence to JabRef style and avoiding typos/inconsistencies in changed code.
The same file contains both // endregion and newly added // endRegion markers, demonstrating
inconsistent convention introduced by this PR.

AGENTS.md
jablib/src/main/java/org/jabref/logic/preferences/JabRefCliPreferences.java[862-862]
jablib/src/main/java/org/jabref/logic/preferences/JabRefCliPreferences.java[1169-1169]
jablib/src/main/java/org/jabref/logic/preferences/JabRefCliPreferences.java[1393-1393]

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

## Issue description
`JabRefCliPreferences` contains inconsistent region end markers (`// endregion` vs `// endRegion`). This is a style inconsistency/typo introduced in the changed code and may reduce readability and IDE code-folding consistency.
## Issue Context
The project commonly uses `// region: ...` paired with `// endregion` (lowercase `r`). In this PR, multiple `// endRegion` variants were added.
## Fix Focus Areas
- jablib/src/main/java/org/jabref/logic/preferences/JabRefCliPreferences.java[1169-1169]
- jablib/src/main/java/org/jabref/logic/preferences/JabRefCliPreferences.java[1210-1210]
- jablib/src/main/java/org/jabref/logic/preferences/JabRefCliPreferences.java[1324-1324]
- jablib/src/main/java/org/jabref/logic/preferences/JabRefCliPreferences.java[1351-1351]
- jablib/src/main/java/org/jabref/logic/preferences/JabRefCliPreferences.java[1393-1393]
- jablib/src/main/java/org/jabref/logic/preferences/JabRefCliPreferences.java[1459-1459]
- jablib/src/main/java/org/jabref/logic/preferences/JabRefCliPreferences.java[1561-1561]
- jablib/src/main/java/org/jabref/logic/preferences/JabRefCliPreferences.java[1697-1697]
- jablib/src/main/java/org/jabref/logic/preferences/JabRefCliPreferences.java[1803-1803]
- jablib/src/main/java/org/jabref/logic/preferences/JabRefCliPreferences.java[2359-2359]

ⓘ 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 Mar 9, 2026
@testlens-app

This comment has been minimized.

@testlens-app

This comment has been minimized.

@AbhijitBhowmick AbhijitBhowmick force-pushed the 14897-fix-javadoctoMarkdown-repairs branch from 6880f85 to 2ededd5 Compare March 10, 2026 01:01
@testlens-app

This comment has been minimized.

@testlens-app

This comment has been minimized.

@github-actions github-actions bot added status: no-bot-comments and removed status: changes-required Pull requests that are not yet complete labels Mar 10, 2026
@testlens-app

This comment has been minimized.

Copy link
Contributor

Choose a reason for hiding this comment

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

This endregion now does not have a start. Looks like the file was already using some region definitions which interfere with the new ones. Please revisit the region splitting w.r.t. whether it still makes sense. Perhaps some regions are obsolete, need adjustment or reorganization. Can you suggest an adjustment to the regions to solve this issue? Ideally without changing things too radically.

@Stewori
Copy link
Contributor

Stewori commented Mar 10, 2026

Okay, I found that in JabRefCliPreferences.java the existing old region declarations don't use a colon. (it's region name, not region: name). So I googled to find some reference on how the region patter should actually be. From what I found,
https://eclipse.dev/eclipse/markdown/?f=news/4.36/jdt.md
https://donraab.medium.com/grouping-java-methods-using-custom-code-folding-regions-with-intellij-bdff0b4fb2a3
it looks like the version without colon is actually correct.
@AbhijitBhowmick please adjust the new region declarations accordingly.

BTW it's a pity that when Javadoc introduced the @snippet tag, which supports region references, they introduced their own region style (// @start region=name ... // @end region=name), incompatible with the one used by IDEs: https://docs.oracle.com/en/java/javase/25/javadoc/snippets.html#GUID-E17E559E-BD80-4548-846F-1AC53C768CAD One opportunity to improve consistency in the Java ecosystem missed.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please edit the endRegion markings for consistency? (In the whole file) endRegion vs endregion, endRegion vs endRegion: name.
According to https://eclipse.dev/eclipse/markdown/?f=news/4.36/jdt.md endregion it is.

Copy link
Member

Choose a reason for hiding this comment

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

does intellj support them without colon?

Copy link
Contributor

Choose a reason for hiding this comment

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

In the JabRef codebase both variants are mixed. So, either it does not matter, or you are already missing some in IntelliJ.
According to https://blog.jetbrains.com/idea/2012/03/custom-code-folding-regions-in-intellij-idea-111/ the concept is originally a VS thing, IntelliJ added support for their syntax. I struggle to find a proper reference for the syntax definitions in the VS docs (because they are terrible, have dead links, were partly retired etc), but the majority of examples and blog-posts I find use it without colon.
If IntelliJ simply supports both (colon is optional), I suggest we should agree on one version for consistency and apply it whenever possible.

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay, as a definite check, use the "Surround With" feature in IntelliJ. You will find, it does not use a colon.

Copy link
Author

Choose a reason for hiding this comment

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

I have writtten as '''//endregion ''' and I will changes old ones(endRegion ->endregion)

Copy link
Author

@AbhijitBhowmick AbhijitBhowmick Mar 11, 2026

Choose a reason for hiding this comment

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

Intellij has a feature in "Surround with" to add region and endregion .This feature we can use to end confusion in future .
Screenshot 2026-03-11 at 11 05 16

Copy link
Author

Choose a reason for hiding this comment

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

Yes we do not need colon after region.I will remove : after region (in 17 places).

Copy link
Contributor

Choose a reason for hiding this comment

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

Perfect!

//*************************************************************************************************************
// ToDo: Cleanup
//*************************************************************************************************************
// region: Cleanup
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder what to do with this. Turning the cleanup-todo into a region Cleanup is misleading. Perhaps move the methods to the misc region? (or is there a better fit?) Unfortunately I do not know what the cleanup actually shall accomplish.
Perhaps, simply no region in this case, but just a // Todo: Cleanup comment (without ****... decoration).

Copy link
Author

Choose a reason for hiding this comment

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

I am not sure about this Todo:CleanUp. I will keep it as // Todo: Cleanup comment .

Copy link
Contributor

Choose a reason for hiding this comment

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

That's fine. It's arguably well beyond the scope of this issue.

@calixtus calixtus changed the title 14897 fix javadocto markdown repairs Fix javadocto markdown artifacts Mar 12, 2026
@calixtus calixtus changed the title Fix javadocto markdown artifacts Fix javadoc markdown artifacts Mar 12, 2026
This incorporates all the pending old Javadoc to  Markdown changes required after merging JabRef#14891.The following files are changed:
1.AutoCompletionTextInputBinding.java
2.JabRefCliPreferences.java
3.SearchBasedParserFetcher.java
4.StartNewStudyAction.java
                                             1.
1.JabRefCliPreferences.java
2.SearchBasedParserFetcher.java
1.JabRefCliPreferences.java.
The following changes are done:-
1.Added // endregion to maintain sync with region:AI
  And // region Push to application preferences and //region to Git
2.Changed region: to region
3.Changed region: Cleanup to previous ToDo: Cleanup
4.changed endRegion to end region
5.Adjusted  dangling // endregion by merging Imported Preference tag(new one) with Other Preferences(old one)
@AbhijitBhowmick AbhijitBhowmick force-pushed the 14897-fix-javadoctoMarkdown-repairs branch from 39e8c75 to 9496f9b Compare March 13, 2026 07:37
@testlens-app

This comment has been minimized.

@github-actions github-actions bot added status: changes-required Pull requests that are not yet complete and removed status: no-bot-comments labels Mar 13, 2026
1.JabRefCliPreferences.java.
The following changes are done:-
1.Apply IntelliJ formatting
@testlens-app
Copy link

testlens-app bot commented Mar 13, 2026

✅ All tests passed ✅

🏷️ Commit: 204f156
▶️ Tests: 10135 executed
⚪️ Checks: 49/49 completed


Learn more about TestLens at testlens.app.

@github-actions github-actions bot added status: no-bot-comments and removed status: changes-required Pull requests that are not yet complete labels Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

first contrib good first issue An issue intended for project-newcomers. Varies in difficulty. status: no-bot-comments

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Some small repairs after Javadoc to Markdown conversion.

3 participants