spring-projects / spring-projects/spring-data-couchbase

Refactor to instanceof pattern variable

Open
#2,018 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage
Dominant language
Java
Stars
284
Forks
197
PR merge metrics
No merged PRs in 30d

Description

In some of our cases, we are currently using the traditional instanceof checks followed by explicit type casting. With the introduction of Pattern Matching in recent Java versions, we can refactor these checks to make the code more concise and readable.

Please see https://github.com/spring-projects/spring-data-couchbase/pull/2017

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the linked pull request at https://github.com/spring-projects/spring-data-couchbase/pull/2017 to identify the affected cases and files. Confirm the refactoring scope there and run the relevant project checks; done means the eligible instanceof checks use pattern variables without changing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
databases
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.