Issue discovered on `src/main/java/org/springframework/data/repository/query/Parameters.java` with `Use method references in lambda`

Open
#15 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

Research direction

Start by reviewing src/main/java/org/springframework/data/repository/query/Parameters.java and the ReplaceLambdaWithMethodReference recipe named in the issue. Compare the example diff with the recipe's behavior and verify that the lambda is reported or transformed to the shown method-reference form.

Written by the indexing model from the issue text.

Description

bug
Problem

Describe the issue you are experiencing.

Expected behavior

Describe what you expected to see.

Example diff

From: src/main/java/org/springframework/data/repository/query/Parameters.java

   		this.pageableIndex = pageableIndexTemp;
	this.sortIndex = sortIndexTemp;
	this.dynamicProjectionIndex = dynamicProjectionTemp;
-		this.bindable = Lazy.of(() -> (S) this);
+		this.bindable = Lazy.of({{8ba5867a-1e2c-4faf-8e0c-03935957b7a2}}() -> (S) this{{8ba5867a-1e2c-4faf-8e0c-03935957b7a2}});
}

private S getBindable() {
Recipes in example diff:
  • org.openrewrite.java.cleanup.ReplaceLambdaWithMethodReference
References:
  • View original result
  • Recipe ID: org.openrewrite.java.cleanup.ReplaceLambdaWithMethodReference
  • Recipe Name: Use method references in lambda
  • Repository: spring-projects/spring-data-commons/main
  • Created at Tue Dec 27 2022 18:47:01 GMT-0500 (Eastern Standard Time)

This issue originally created by @jkschneider on: https://github.com/moderneinc/support-public/issues/16

Dominant language
Java
Stars
62
Forks
112
Avg merge
1d 19h
Merged PRs (30d)
40

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.

More from openrewrite/rewrite-static-analysis

All issues in openrewrite/rewrite-static-analysis

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.