Skip to content

Conversation

knutwannheden
Copy link
Contributor

Avoiding calling Class.forName() is important in concurrent environments. As the method always returns a parser that corresponds to the JDK version and the JavaParser class should be loaded by the system class loader, it should be safe to cache the result.

Avoiding calling `Class.forName()` is important in concurrent environments. As the method always returns a parser that corresponds to the JDK version and the `JavaParser` class should be loaded by the system class loader, it should be safe to cache the result.
@knutwannheden knutwannheden merged commit 83efdf8 into main Sep 24, 2025
2 checks passed
@knutwannheden knutwannheden deleted the cache-java-parser-from-java-version branch September 24, 2025 05:24
@github-project-automation github-project-automation bot moved this from In Progress to Done in OpenRewrite Sep 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants