-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Delete temp file on exit #12923
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
base: main
Are you sure you want to change the base?
Delete temp file on exit #12923
Conversation
src/test/java/org/jabref/logic/importer/fetcher/ACMPortalFetcherTest.java
Show resolved
Hide resolved
ACMPortalFetcher fetcherSpy = spy(new ACMPortalFetcher()); | ||
|
||
BibEntry expectedEntry = new BibEntry(); | ||
expectedEntry.setField("title", "Machine Learning: A Probabilistic Perspective"); |
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.
When creating a new BibEntry object, 'withers' should be used instead of 'setField' to improve code readability and maintainability.
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.
Yeah, trag-bot is right. Check other test code, there are examples
Your pr has changes from another branch or unrelated, you shoudl fix that first |
Thanks for the heads up! Just merged in main and pushed again, should be all good now, let me know if anything else looks off. |
@trag-bot didn't find any issues in the code! ✅✨ |
Just wanted to check, this seems unrelated to my changes (since I didn't touch .gitmodules or submodules at all). Is there a recent change to main that I should pull in to resolve this? Or is this an infra thin |
JUnit tests are failing. You can see which checks are failing by locating the box "Some checks were not successful" on the pull request page. To see the test output, locate "Tests / Unit tests (pull_request)" and click on it. You can then run these tests in IntelliJ to reproduce the failing tests locally. We offer a quick test running howto in the section Final build system checks in our setup guide. |
try {Optional<String> deleteWhenClosingPath = Optional.empty(); | ||
JabKit.deleteWhenClosingPath = deleteWhenClosingPath; | ||
|
||
for (String arg : args) { |
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.
Wrong formatting
*/ | ||
public URL getURLForQuery(QueryNode query) throws FetcherException { | ||
|
||
/** |
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.
Misformatted
uriBuilder.addParameter("AllField", transformedQuery); | ||
uriBuilder.addParameter("startPage", String.valueOf(pageNumber + 1)); // ACM uses 1-based page numbers | ||
|
||
// Placeholder: empty result list (real fetching logic happens elsewhere) |
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.
Placeholder?
Maybe then add this notice to the doc of the metod?
ACMPortalFetcher fetcherSpy = spy(new ACMPortalFetcher()); | ||
|
||
BibEntry expectedEntry = new BibEntry(); | ||
expectedEntry.setField("title", "Machine Learning: A Probabilistic Perspective"); |
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.
Yeah, trag-bot is right. Check other test code, there are examples
Closes #11048
Describe the changes you have made here: what, where, why, ...
Added support for deleting temporary files on shutdown when using the
--deleteWhenClosing
argument. This fixes the issue where temp files created by the browser extension were not being removed after JabRef closed.Changes made:
JabKit.java
→ Added shutdown hook to delete temp files if provided.processArguments()
→ Added handling for--deleteWhenClosing
argument.ACMPortalFetcher
with correct usage ofwithField
.assertEquals
instead ofassertNotNull
/assertFalse
.Mandatory checks
CHANGELOG.md
described in a way that is understandable for the average user (if change is visible to the user)