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

Configure TCCL in InMemoryLargeSurceSet to enable ServiceLoader #5034

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

MBoegers
Copy link
Contributor

What's changed?

Forward ClassLoader to SourceFileWithReferences to enbale the used ServiceLoader to load classes from the recipe classpath.

What's your motivation?

Make Providers available that are defined in external recipe artifacts loaded at runtime.

Anything in particular you'd like reviewers to focus on?

Anyone you would like to review specifically?

Have you considered any alternatives or workarounds?

Any additional context

Checklist

  • I've added unit tests to cover both positive and negative cases
  • I've read and applied the recipe conventions and best practices
  • I've used the IntelliJ IDEA auto-formatter on affected files

…`ClassLoader` to enable `ServiceLoader` to find `Provider`s loaded by recipe `ClassLoader`s
@MBoegers MBoegers self-assigned this Feb 13, 2025
@MBoegers MBoegers added the bug Something isn't working label Feb 13, 2025
@MBoegers MBoegers force-pushed the load-provider-with-defined-classloader branch from 78f07e0 to 2eed22c Compare February 14, 2025 11:34
@MBoegers MBoegers force-pushed the load-provider-with-defined-classloader branch from 2eed22c to eacff9f Compare February 14, 2025 11:35
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Some suggestions could not be made:

  • rewrite-hcl/src/main/java/org/openrewrite/hcl/format/TabsAndIndentsVisitor.java
    • lines 255-256
  • rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/HclPrinter.java
    • lines 363-364
  • rewrite-java/src/main/java/org/openrewrite/java/internal/template/AnnotationTemplateGenerator.java
    • lines 158-159
  • rewrite-java/src/main/java/org/openrewrite/java/internal/template/BlockStatementTemplateGenerator.java
    • lines 281-282
    • lines 669-669
  • rewrite-java/src/main/java/org/openrewrite/java/search/FindEmptyClasses.java
    • lines 57-57
  • rewrite-xml/src/main/java/org/openrewrite/xml/internal/XmlPrinter.java
    • lines 106-106
  • rewrite-yaml/src/main/java/org/openrewrite/yaml/cleanup/RemoveUnusedVisitor.java
    • lines 76-76

@MBoegers MBoegers marked this pull request as ready for review February 17, 2025 13:35
@knutwannheden
Copy link
Contributor

Let's also adjust the PR description to reflect the new implementation.

@MBoegers MBoegers changed the title Use defined ClassLoader in ServiceLoader Configure TCCL in InMemoryLargeSurceSet to enable ServiceLoader Feb 25, 2025
@MBoegers MBoegers changed the title Configure TCCL in InMemoryLargeSurceSet to enable ServiceLoader Configure TCCL in InMemoryLargeSurceSet to enable ServiceLoader Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Ready to Review
Development

Successfully merging this pull request may close these issues.

3 participants