Skip to content

Support for java.util.function.Function#196

Closed
basil wants to merge 1 commit into
jenkinsci:masterfrom
basil:function
Closed

Support for java.util.function.Function#196
basil wants to merge 1 commit into
jenkinsci:masterfrom
basil:function

Conversation

@basil

@basil basil commented Jan 22, 2025

Copy link
Copy Markdown
Member

Without breaking compatibility, allow for consumers to migrate from Guava to native Java Platform functionality.

Testing done

Tested in context by adapting FlowExecutionList in workflow-api.

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

@basil
basil requested a review from a team as a code owner January 22, 2025 00:18
@basil
basil requested a review from jglick January 22, 2025 17:40

@jglick jglick left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

AFAICT the compiler will default to using the deprecated overload when resolving a lambda that has not been explicitly cast to the new type, which is not what we want. It would be better to pick a new method name to ensure that the new code is selected without requiring a cumbersome cast. (See jenkinsci/jenkins-test-harness#894 for an example of a similar historical mistake.)

While we are here, the choice of Function<T, Void> does not make much sense. Consumer<T> would be the more natural functional interface. That would suggest acceptAll as the new method name.

Once released, we would of course want to update https://github.com/jenkinsci/workflow-api-plugin/blob/d104412f76ae88df02ee6012b4258d4beae06f19/src/main/java/org/jenkinsci/plugins/workflow/flow/FlowExecutionList.java#L328 accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants