Skip to content

Add and implement JSpecify ADR#13957

Merged
calixtus merged 28 commits into
mainfrom
jspecify-adr
Sep 25, 2025
Merged

Add and implement JSpecify ADR#13957
calixtus merged 28 commits into
mainfrom
jspecify-adr

Conversation

@calixtus

Copy link
Copy Markdown
Member

Selfexplaining Title

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.

@calixtus calixtus added status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers dev: code-quality Issues related to code or architecture decisions dev: adr labels Sep 22, 2025

@subhramit subhramit 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.

Very minor refinements on ADR

Comment thread docs/decisions/0051-jspecify-nullable-annotations Outdated
Comment thread docs/decisions/0051-jspecify-nullable-annotations Outdated
Comment thread docs/decisions/0051-jspecify-nullable-annotations Outdated
Comment thread docs/decisions/0051-jspecify-nullable-annotations Outdated
Comment thread docs/decisions/0051-jspecify-nullable-annotations Outdated
Comment thread docs/decisions/0051-jspecify-nullable-annotations Outdated
Comment thread docs/decisions/0051-jspecify-nullable-annotations Outdated
Comment thread docs/decisions/0051-jspecify-nullable-annotations Outdated
calixtus and others added 8 commits September 23, 2025 07:20
Co-authored-by: Subhramit Basu <subhramit.bb@live.in>
Co-authored-by: Subhramit Basu <subhramit.bb@live.in>
Co-authored-by: Subhramit Basu <subhramit.bb@live.in>
Co-authored-by: Subhramit Basu <subhramit.bb@live.in>
Co-authored-by: Subhramit Basu <subhramit.bb@live.in>
Co-authored-by: Subhramit Basu <subhramit.bb@live.in>
Co-authored-by: Subhramit Basu <subhramit.bb@live.in>
Co-authored-by: Subhramit Basu <subhramit.bb@live.in>
@calixtus calixtus requested a review from subhramit September 23, 2025 05:22
subhramit
subhramit previously approved these changes Sep 23, 2025

@subhramit subhramit 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.

ADR ✅

Comment thread jabgui/src/main/java/org/jabref/gui/groups/GroupNodeViewModel.java
Comment thread jabgui/src/main/java/org/jabref/gui/groups/GroupNodeViewModel.java
Comment thread jabgui/src/main/java/org/jabref/gui/groups/GroupNodeViewModel.java
Comment thread jabgui/src/main/java/org/jabref/gui/groups/GroupNodeViewModel.java
Comment thread jabgui/src/main/java/org/jabref/gui/groups/GroupNodeViewModel.java
tsantalis added a commit to tsantalis/RefactoringMiner that referenced this pull request Sep 23, 2025
@trag-bot

trag-bot Bot commented Sep 24, 2025

Copy link
Copy Markdown

@trag-bot didn't find any issues in the code! ✅✨

@Override
public void setSelectedGroups(BibDatabaseContext context, List<GroupTreeNode> newSelectedGroups) {
Objects.requireNonNull(newSelectedGroups);
public void setSelectedGroups(BibDatabaseContext context, @NonNull List<GroupTreeNode> newSelectedGroups) {

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.

is context nullable?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Can always be changed. My method was only: monkey see, monkey do.
Change was made bc of change in interface. Can be discussed in static analysis followup pr.

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.

In case all nullable variables are marked @Nullable, one can mark the whole class as @NullMarked and can remove all the @NonNull annotations.

Comment on lines +28 to +32
PersonNameSuggestionProvider(@NonNull Field field, BibDatabase database) {
this(List.of(field), database);
}

public PersonNameSuggestionProvider(Collection<Field> fields, BibDatabase database) {
public PersonNameSuggestionProvider(@NonNull Collection<Field> fields, BibDatabase database) {

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.

similar qn, could database be null


public WordSuggestionProvider(Field field, BibDatabase database) {
this.field = Objects.requireNonNull(field);
public WordSuggestionProvider(@NonNull Field field, BibDatabase database) {

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.

here as well

@subhramit subhramit Sep 25, 2025

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.

(i am asking because I see @NonNull BibDatabaseContext databaseContext in some classes below)

@subhramit subhramit 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.

I checked the CitationStyle classes, looks good.
Some questions though^

@calixtus calixtus added this pull request to the merge queue Sep 25, 2025
Merged via the queue into main with commit 7f5edd6 Sep 25, 2025
110 checks passed
@calixtus calixtus deleted the jspecify-adr branch September 25, 2025 07:41
alexsukhin added a commit to alexsukhin/jabref that referenced this pull request Sep 25, 2025
Shanaya-1981 pushed a commit to Shanaya-1981/jabref that referenced this pull request Oct 13, 2025
* Add ADR

* Implement ADR

* Undo unwanted changes

* Remove newline

* Remove newline

* Remove newline

* Update docs/decisions/0051-jspecify-nullable-annotations

Co-authored-by: Subhramit Basu <subhramit.bb@live.in>

* Update docs/decisions/0051-jspecify-nullable-annotations

Co-authored-by: Subhramit Basu <subhramit.bb@live.in>

* Update docs/decisions/0051-jspecify-nullable-annotations

Co-authored-by: Subhramit Basu <subhramit.bb@live.in>

* Update docs/decisions/0051-jspecify-nullable-annotations

Co-authored-by: Subhramit Basu <subhramit.bb@live.in>

* Update docs/decisions/0051-jspecify-nullable-annotations

Co-authored-by: Subhramit Basu <subhramit.bb@live.in>

* Update docs/decisions/0051-jspecify-nullable-annotations

Co-authored-by: Subhramit Basu <subhramit.bb@live.in>

* Update docs/decisions/0051-jspecify-nullable-annotations

Co-authored-by: Subhramit Basu <subhramit.bb@live.in>

* Update docs/decisions/0051-jspecify-nullable-annotations

Co-authored-by: Subhramit Basu <subhramit.bb@live.in>

* Fix refactoring artifacts

* Checkstyle

* Checkstyle

* Fix and add tests

* Fix unused imports

* Remove null tests

* Implement more annotations

* Implement more annotations for consistency

* Remove more null tests

* Fix import and some static analysis null issues

* Remove more null tests

---------

Co-authored-by: Carl Christian Snethlage <calixtus@users.noreply.github.com>
Co-authored-by: Subhramit Basu <subhramit.bb@live.in>
github-merge-queue Bot pushed a commit that referenced this pull request Nov 11, 2025
* Add cleanup dialog tabs with individual tab preferences

* Fixed indentation and added commenting

* Fix Trag-bot review issues

- Removed trivial comments
- Renamed PDF-related variables
- Updated methods to return Optional
- Used Optional property for FieldFormatterCleanups

* Fix Trag-bot review issues

- Removed trivial comments
- Fixed CHANGELOG.md

* Fix Trag-bot review issues

- Removed trivial comments
- Improved Optional checks
- Perform null check for other parameters

* Avoid nested Optionals, returning Optional<CleanupPreferences> directly

* Refactor CleanupPreferences by keeping one assertion per test

* Converted tests to assertEquals

* Maintain consistent naming conventions

* Returns CleanupPreferences directly since value is always present

* Initial review refactor draft
- Create new ViewModel, pull logic from Action and SingleAction into ViewModel
- Move Apply button to each tab
- Remove categories from ENUM and keep enums of all jobs in each respective tab to be used for cleanup

* fix import error!

* Reformat codebase (more carefully) (#13885)

* Fix non record comments by carl

# Conflicts:
#	jabgui/src/main/java/org/jabref/gui/edit/automaticfiededitor/MoveFieldValueAction.java
#	jabgui/src/main/java/org/jabref/gui/mergeentries/threewaymerge/cell/sidebuttons/ToggleMergeUnmergeButton.java
#	jabgui/src/main/java/org/jabref/gui/mergeentries/threewaymerge/fieldsmerger/CommentMerger.java
#	jabgui/src/main/java/org/jabref/gui/mergeentries/threewaymerge/fieldsmerger/FieldMerger.java
#	jabgui/src/main/java/org/jabref/gui/mergeentries/threewaymerge/fieldsmerger/FileMerger.java
#	jabgui/src/main/java/org/jabref/gui/mergeentries/threewaymerge/fieldsmerger/GroupMerger.java
#	jabgui/src/main/java/org/jabref/gui/mergeentries/threewaymerge/fieldsmerger/KeywordMerger.java
#	jablib/src/main/java/org/jabref/logic/layout/format/HTMLChars.java
#	jablib/src/main/java/org/jabref/model/entry/identifier/ArXivIdentifier.java
#	jablib/src/main/java/org/jabref/model/entry/identifier/EprintIdentifier.java

* Add file exceptions

* Remove shebang line

* Remove shebang line

* Remove shebang line

* Expand variables & rename class

---------

Co-authored-by: Oliver Kopp <kopp.dev@gmail.com>

* fix import error & merge

* Apply OpenRewrite Cleanup

* Refactor Cleanup Tabs
- Moved cleanup panel logic into CleanupDialogViewModel for better separation of UI and logic
- Changed tabSupplier and taskExecutor from Optional to nullable parameters
- Moved updateWith logic into the record for cleaner preference updates.
- General design improvements: more maintainable.

* Fix getDisplayName method

* Fix formatting

* Trag-bot review and fix en properties

* fix indentation plssss

* format properly and change to observablelist

* fix formatting entriestoprocess (please)

* Updated names and changed optional dependencies back to nullable

* Refactored panels to use separate ViewModels
- Introduced ViewModels to encapsulate state and logic for panels.
- Replaced direct UI manipulation with bidirectional bindings.
- Ensures cleaner UI logic, easier maintenance

* Moved ALL_JOBS to respective ViewModels, small naming changes

* Replaced requireNotNull to @NotNull following #13957

* Address review feedback in CleanupDialogViewModel

- Remove redundant comments following self-explanatory code
- Add modifiedEntriesCount > 0 condition
- Use "entry(s)" localization form for clean up message

---------

Co-authored-by: Subhramit Basu <subhramit.bb@live.in>
Co-authored-by: Oliver Kopp <kopp.dev@gmail.com>
Co-authored-by: Christoph <siedlerkiller@gmail.com>
merlinymy pushed a commit to merlinymy/jabref that referenced this pull request Nov 19, 2025
* Add cleanup dialog tabs with individual tab preferences

* Fixed indentation and added commenting

* Fix Trag-bot review issues

- Removed trivial comments
- Renamed PDF-related variables
- Updated methods to return Optional
- Used Optional property for FieldFormatterCleanups

* Fix Trag-bot review issues

- Removed trivial comments
- Fixed CHANGELOG.md

* Fix Trag-bot review issues

- Removed trivial comments
- Improved Optional checks
- Perform null check for other parameters

* Avoid nested Optionals, returning Optional<CleanupPreferences> directly

* Refactor CleanupPreferences by keeping one assertion per test

* Converted tests to assertEquals

* Maintain consistent naming conventions

* Returns CleanupPreferences directly since value is always present

* Initial review refactor draft
- Create new ViewModel, pull logic from Action and SingleAction into ViewModel
- Move Apply button to each tab
- Remove categories from ENUM and keep enums of all jobs in each respective tab to be used for cleanup

* fix import error!

* Reformat codebase (more carefully) (JabRef#13885)

* Fix non record comments by carl

# Conflicts:
#	jabgui/src/main/java/org/jabref/gui/edit/automaticfiededitor/MoveFieldValueAction.java
#	jabgui/src/main/java/org/jabref/gui/mergeentries/threewaymerge/cell/sidebuttons/ToggleMergeUnmergeButton.java
#	jabgui/src/main/java/org/jabref/gui/mergeentries/threewaymerge/fieldsmerger/CommentMerger.java
#	jabgui/src/main/java/org/jabref/gui/mergeentries/threewaymerge/fieldsmerger/FieldMerger.java
#	jabgui/src/main/java/org/jabref/gui/mergeentries/threewaymerge/fieldsmerger/FileMerger.java
#	jabgui/src/main/java/org/jabref/gui/mergeentries/threewaymerge/fieldsmerger/GroupMerger.java
#	jabgui/src/main/java/org/jabref/gui/mergeentries/threewaymerge/fieldsmerger/KeywordMerger.java
#	jablib/src/main/java/org/jabref/logic/layout/format/HTMLChars.java
#	jablib/src/main/java/org/jabref/model/entry/identifier/ArXivIdentifier.java
#	jablib/src/main/java/org/jabref/model/entry/identifier/EprintIdentifier.java

* Add file exceptions

* Remove shebang line

* Remove shebang line

* Remove shebang line

* Expand variables & rename class

---------

Co-authored-by: Oliver Kopp <kopp.dev@gmail.com>

* fix import error & merge

* Apply OpenRewrite Cleanup

* Refactor Cleanup Tabs
- Moved cleanup panel logic into CleanupDialogViewModel for better separation of UI and logic
- Changed tabSupplier and taskExecutor from Optional to nullable parameters
- Moved updateWith logic into the record for cleaner preference updates.
- General design improvements: more maintainable.

* Fix getDisplayName method

* Fix formatting

* Trag-bot review and fix en properties

* fix indentation plssss

* format properly and change to observablelist

* fix formatting entriestoprocess (please)

* Updated names and changed optional dependencies back to nullable

* Refactored panels to use separate ViewModels
- Introduced ViewModels to encapsulate state and logic for panels.
- Replaced direct UI manipulation with bidirectional bindings.
- Ensures cleaner UI logic, easier maintenance

* Moved ALL_JOBS to respective ViewModels, small naming changes

* Replaced requireNotNull to @NotNull following JabRef#13957

* Address review feedback in CleanupDialogViewModel

- Remove redundant comments following self-explanatory code
- Add modifiedEntriesCount > 0 condition
- Use "entry(s)" localization form for clean up message

---------

Co-authored-by: Subhramit Basu <subhramit.bb@live.in>
Co-authored-by: Oliver Kopp <kopp.dev@gmail.com>
Co-authored-by: Christoph <siedlerkiller@gmail.com>
maorethians pushed a commit to maorethians/RefactoringMiner that referenced this pull request Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dev: adr dev: code-quality Issues related to code or architecture decisions status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants