-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Implement performSearchPaged for ACMPortalFetcher #12922
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?
Conversation
Runtime.getRuntime().addShutdownHook(new Thread(() -> { | ||
deleteWhenClosingPath.ifPresent(path -> { | ||
try { | ||
Files.deleteIfExists(Paths.get(path)); | ||
} catch (IOException e) { | ||
LOGGER.warn("Failed to delete temporary file: " + path, e); | ||
} | ||
}); | ||
})); |
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.
Using 'new Thread()' is discouraged. Instead, 'org.jabref.logic.util.BackgroundTask' and its 'executeWith' should be used for better resource management and consistency.
assertNotNull(results); | ||
assertFalse(results.isEmpty()); |
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.
The test should assert the contents of the results using assertEquals instead of checking for Boolean conditions with assertNotNull and assertFalse.
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.
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. |
@@ -2,5 +2,6 @@ | |||
"java.configuration.updateBuildConfiguration": "interactive", | |||
"java.format.settings.url": "/config/VSCode Code Style.xml", | |||
"java.checkstyle.configuration": "${workspaceFolder}/config/checkstyle/checkstyle_reviewdog.xml", | |||
"java.checkstyle.version": "10.21.0" | |||
"java.checkstyle.version": "10.21.0", |
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.
I think this shouldn't be modified
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.
Oh, this is from other PRs of yours, right?
Is this code related to this PR or not?
Closes #10507
Describe the changes you have made here: what, where, why, ...
I implemented
performSearchPaged
inACMPortalFetcher.java
to enable paging support for ACM search results. This aligns the ACM fetcher with the existing structure used by other fetchers likeGoogleScholarFetcher
. The method builds the correct URL for a given page, supports pagination, and returns the appropriatePage<BibEntry>
object.Mandatory checks
CHANGELOG.md
described in a way that is understandable for the average user (if change is visible to the user)