Skip to content
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

Use StringUtil.intValueOf instead of StringUtil.intValueOfOptional or custom code #10779

Merged
merged 1 commit into from
Jan 14, 2024

Conversation

koppor
Copy link
Member

@koppor koppor commented Jan 14, 2024

While stumbling on an OpenRewrite issue (openrewrite/rewrite#3913), I found WTF code inside JabRef. We use that code for performance reasons.

Thus, I thought, let's really use it to gain performance. Here is my (first) change. In a follow-up PR, I will rewrite all Integer.parseInt to StringUtil.valueOf. This takes a bit time, since I don't know how to use refaster in OpenRewrite or how we can use error prone's refaster templates here.

Mandatory checks

  • Change in CHANGELOG.md described in a way that is understandable for the average user (if applicable)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • Checked developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • Checked 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 to the documentation repository.

Copy link
Contributor

github-actions bot commented Jan 14, 2024

The build for this PR is no longer available. Please visit https://builds.jabref.org/main/ for the latest build.

Copy link
Member

@Siedlerchr Siedlerchr left a comment

Choose a reason for hiding this comment

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

.We should get rid of our custom method for Int parsing in the long term. I doubt that it makes a hug difference nowadays and I guess the jdk standard implementation to be better optimized.
Measure not gues

@koppor
Copy link
Member Author

koppor commented Jan 14, 2024

@calixtus calixtus added this pull request to the merge queue Jan 14, 2024
Merged via the queue into main with commit 09af3ac Jan 14, 2024
18 checks passed
@calixtus calixtus deleted the speed-up-field-comparator branch January 14, 2024 18:39
Siedlerchr added a commit that referenced this pull request Jan 15, 2024
* upstream/main:
  Bump org.apache.lucene:lucene-queries from 9.9.0 to 9.9.1 (#10795)
  Bump com.google.guava:guava from 32.1.3-jre to 33.0.0-jre (#10793)
  Bump com.dlsc.gemsfx:gemsfx from 1.90.0 to 1.92.0 (#10796)
  Bump org.mockito:mockito-core from 5.8.0 to 5.9.0 (#10794)
  Bump lycheeverse/lychee-action from 1.9.0 to 1.9.1 (#10791)
  refactor: Transform calls to `Objects.isNull(..)` and `Objects.nonNull(..)` (#10788)
  refactor: Prefer `String#formatted(Object...)` (#10787)
  refactor: Adopt `SequencedCollection` (#10786)
  Update CSL styles (#10785)
  Initial Pseudonymization (#10776)
  Use StringUtil.intValueOf instead of StringUtil.intValueOfOptional or custom code (#10779)
  Refine loading code (#10780)
  Add wokraround for theme detector issue (#10777)
  Fix enablement of Aux dialog's "Generate" button (#10775)
  Fix package of TypedBibEntry (#10774)
  Fix labeling of PRs for newcomers (#10773)
  Update add-greeting-to-issue.yml
  Update add-greeting-to-issue.yml
  Update add-greeting-to-issue.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants