Quick fix: remove tabs and unused AI exports#15791
Conversation
Review Summary by QodoRemove unused AI exports and fix formatting
WalkthroughsDescription• Remove unused AI-related exports from jablib module-info.java • Clean up tabs in build.gradle.kts file for consistency Diagramflowchart LR
A["module-info.java"] -->|"Remove 8 unused AI exports"| B["Cleaned exports"]
C["build.gradle.kts"] -->|"Replace tabs with spaces"| D["Consistent formatting"]
File Changes1. jablib/src/main/java/module-info.java
|
Code Review by Qodo
1. Hidden chat repository API
|
| exports org.jabref.logic.ai.ingestion.repositories; | ||
| exports org.jabref.logic.ai.ingestion.logic; | ||
| exports org.jabref.logic.ai.chatting.tasks; | ||
| exports org.jabref.logic.ai.chatting.repositories; |
There was a problem hiding this comment.
1. Hidden chat repository api 🐞 Bug ≡ Correctness
AiService#getChatHistoryRepository() is public but returns ChatHistoryRepository from org.jabref.logic.ai.chatting.repositories, which is no longer exported by jablib's module-info, so other modules cannot legally use that return type. Any downstream module calling this method (or trying to reference its return type) will fail to compile under JPMS.
Agent Prompt
## Issue description
`jablib` no longer exports `org.jabref.logic.ai.chatting.repositories`, but `org.jabref.logic.ai.AiService` (in an exported package) still exposes `ChatHistoryRepository` in a public method. This makes that method effectively unusable to other modules and is a breaking change for any JPMS consumer relying on it.
## Issue Context
In JPMS, public signatures used across modules must reference types in exported packages, otherwise downstream compilation/access is blocked.
## Fix Focus Areas
Choose one of:
1) Restore the export(s) needed by public signatures.
2) Refactor `AiService` public API to not expose repository types from non-exported packages (e.g., remove the getter, make it package-private, or return an exported abstraction located in an exported package).
- jablib/src/main/java/module-info.java[121-155]
- jablib/src/main/java/org/jabref/logic/ai/AiService.java[8-15]
- jablib/src/main/java/org/jabref/logic/ai/AiService.java[186-188]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| exports org.jabref.logic.ai.ingestion.tasks.generateembeddingsforseveral; | ||
| exports org.jabref.logic.ai.ingestion.tasks.generateembeddings; | ||
| exports org.jabref.logic.ai.rag.util; | ||
| exports org.jabref.logic.ai.tokenization.logic; |
There was a problem hiding this comment.
2. Hidden tokenizer return type 🐞 Bug ≡ Correctness
ChatModel#getTokenizer() is public and part of an exported package, but returns TokenEstimator from org.jabref.logic.ai.tokenization.logic, which is no longer exported by jablib's module-info. Downstream modules can no longer call or implement this API under JPMS, which is a breaking change for any consumer that previously used it.
Agent Prompt
## Issue description
`jablib` no longer exports `org.jabref.logic.ai.tokenization.logic`, but `org.jabref.logic.ai.chatting.ChatModel` (exported) exposes `TokenEstimator` in a public method signature. This makes `getTokenizer()` unusable from other modules and breaks any external implementations/callers.
## Issue Context
JPMS requires that types appearing in accessible public signatures across modules reside in exported packages.
## Fix Focus Areas
Choose one of:
1) Re-add `exports org.jabref.logic.ai.tokenization.logic;` (and possibly `...tokenization.util` if needed by the intended public surface).
2) Refactor `ChatModel` to avoid exposing `TokenEstimator` publicly (e.g., move token estimation behind methods on `ChatModel` that only use exported types).
- jablib/src/main/java/module-info.java[121-155]
- jablib/src/main/java/org/jabref/logic/ai/chatting/ChatModel.java[1-16]
- jablib/src/main/java/org/jabref/logic/ai/tokenization/logic/TokenEstimator.java[1-14]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
|
This is a follow-up to #15688 |
* upstream/main: Add github-actions output format to jabkit check (#15789) Fixes of some nullaway warnings (#15792) Citations: Double click on entry should add and focus it (#15624) fix(ai): hide LLM varians if AI is disabled (#15812) Initial implementation for OCRmyPDF (#15712) fix(null): fix nullable warnings in CSLAdapter (#15803) Chore(deps): Bump com.autonomousapps:dependency-analysis-gradle-plugin (#15808) Chore(deps): Bump com.autonomousapps:dependency-analysis-gradle-plugin (#15809) New translations jabref_en.properties (Italian) (#15807) New Crowdin updates (#15796) Chore(deps): Bump com.autonomousapps:dependency-analysis-gradle-plugin (#15802) Chore(deps): Bump org.openrewrite.recipe:rewrite-recipe-bom (#15800) Chore(deps): Bump org.openrewrite.rewrite from 7.32.2 to 7.33.0 (#15801) Chore(deps): Bump com.autonomousapps:dependency-analysis-gradle-plugin (#15795) Chore(deps): Bump com.autonomousapps:dependency-analysis-gradle-plugin (#15794) Chore(deps): Bump jablib/src/main/resources/csl-styles (#15793) fix: remove tabs and unused AI exports (#15791)
Related issues and pull requests
No related issue.
PR Description
Just quick changes:
build gradlefile.Steps to test
Run
checkAllModuleInfo- should be green.AI usage
No AI usage (though originally discovered not by me, I think by a user that used AI to find this).
Checklist
CHANGELOG.mdin a way that can be understood by the average user (if change is visible to the user)