Skip to content

refactor: Transform calls to Objects.isNull(..) and Objects.nonNull(..)#10788

Merged
koppor merged 3 commits into
mainfrom
refactor/transform-calls-to-objects-is-null-and-objects-non-null
Jan 15, 2024
Merged

refactor: Transform calls to Objects.isNull(..) and Objects.nonNull(..)#10788
koppor merged 3 commits into
mainfrom
refactor/transform-calls-to-objects-is-null-and-objects-non-null

Conversation

@koppor

@koppor koppor commented Jan 15, 2024

Copy link
Copy Markdown
Member

Applies https://docs.openrewrite.org/recipes/java/removeobjectsisnull

Replace calls to Objects.isNull(..) and Objects.nonNull(..) with a simple null check. Using these methods outside of stream predicates is not idiomatic.

Use this link to re-run the recipe: https://app.moderne.io/recipes/org.openrewrite.java.RemoveObjectsIsNull?organizationId=SmFiUmVm

@Siedlerchr

Copy link
Copy Markdown
Member

that does not work /home/runner/work/jabref/jabref/src/main/java/org/jabref/logic/shared/DBMSConnectionProperties.java:191: error: bad operand types for binary operator '!='
&& port != null
^
first type: int
second type:

@koppor koppor added the dev: code-quality Issues related to code or architecture decisions label Jan 15, 2024
@koppor koppor marked this pull request as draft January 15, 2024 12:00
calixtus
calixtus previously approved these changes Jan 15, 2024
@calixtus

Copy link
Copy Markdown
Member

fails

@calixtus

Copy link
Copy Markdown
Member
DBMSConnectionProperties.java:191: error: bad operand types for binary operator '!='
                && port != null
                        ^

@koppor

koppor commented Jan 15, 2024

Copy link
Copy Markdown
Member Author

Reported issue (openrewrite/rewrite#3915) and fixed code to check int for a valid TCP IP port value.

@koppor koppor marked this pull request as ready for review January 15, 2024 14:05
@koppor koppor enabled auto-merge January 15, 2024 14:06
@koppor koppor added this pull request to the merge queue Jan 15, 2024
@github-actions

github-actions Bot commented Jan 15, 2024

Copy link
Copy Markdown
Contributor

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

Merged via the queue into main with commit be959d2 Jan 15, 2024
@koppor koppor deleted the refactor/transform-calls-to-objects-is-null-and-objects-non-null branch January 15, 2024 14:26
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

dev: code-quality Issues related to code or architecture decisions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants