-
Notifications
You must be signed in to change notification settings - Fork 360
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
Partial support Lombok for java 8 (mostly done) #4855
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jevanlingen
commented
Jan 7, 2025
rewrite-java-8/src/main/java/org/openrewrite/java/ReloadableJava8Parser.java
Outdated
Show resolved
Hide resolved
jevanlingen
force-pushed
the
lombok-java-8
branch
from
January 7, 2025 15:16
00ccdd9
to
80e9ead
Compare
timtebeek
reviewed
Jan 7, 2025
rewrite-java-tck/src/main/java/org/openrewrite/java/tree/LombokTest.java
Show resolved
Hide resolved
rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21ParserVisitor.java
Outdated
Show resolved
Hide resolved
rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11ParserVisitor.java
Outdated
Show resolved
Hide resolved
rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17ParserVisitor.java
Outdated
Show resolved
Hide resolved
rewrite-java-8/src/main/java/org/openrewrite/java/ReloadableJava8ParserVisitor.java
Outdated
Show resolved
Hide resolved
jevanlingen
commented
Jan 8, 2025
rewrite-java-tck/src/main/java/org/openrewrite/java/tree/LombokTest.java
Show resolved
Hide resolved
Co-authored-by: Knut Wannheden <[email protected]>
jevanlingen
changed the title
Support Lombok for java 8
Partial support Lombok for java 8 (mostly done)
Jan 9, 2025
timtebeek
reviewed
Jan 9, 2025
rewrite-java-tck/src/main/java/org/openrewrite/java/tree/LombokTest.java
Outdated
Show resolved
Hide resolved
# Conflicts: # rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17ParserVisitor.java # rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21ParserVisitor.java # rewrite-java-8/src/main/java/org/openrewrite/java/ReloadableJava8ParserVisitor.java
timtebeek
approved these changes
Jan 10, 2025
sambsnyd
pushed a commit
that referenced
this pull request
Jan 15, 2025
* Support Lombok for java 8 * Support Lombok for java 8 * Support Lombok for java 8 * Add rewrite-java-lombok to classpath * Improve message * Remove `TimedTodo` to be more like the other java parsers * cleanup * Add JavaCompiler `delegate` fix * Support Lomboks `var` and `val` for Java 8 * Cleanup * Cleanup * Cleanup of `isLombokGenerated` methods * Cleanup of `isLombokGenerated` methods * Cleanup of `isLombokGenerated` methods * Cleanup of `isLombokGenerated` methods * Cleanup of `isLombokGenerated` methods * Cleanup * Improve `onConstructor` and `onConstructorNoArgs` args * Fix missing `onConstructor_` check * Cleanup * Apply suggestions from code review Co-authored-by: Knut Wannheden <[email protected]> * Improve tests * Merge branch 'main' into lombok-java-8 * Rename JavacAnnotationHandler with no action to XNoOpHandler * Rename JavacAnnotationHandler with no action to XNoOpHandler * Improve lomboks `ExampleException` test --------- Co-authored-by: Knut Wannheden <[email protected]>
sambsnyd
pushed a commit
that referenced
this pull request
Jan 15, 2025
* Support Lombok for java 8 * Support Lombok for java 8 * Support Lombok for java 8 * Add rewrite-java-lombok to classpath * Improve message * Remove `TimedTodo` to be more like the other java parsers * cleanup * Add JavaCompiler `delegate` fix * Support Lomboks `var` and `val` for Java 8 * Cleanup * Cleanup * Cleanup of `isLombokGenerated` methods * Cleanup of `isLombokGenerated` methods * Cleanup of `isLombokGenerated` methods * Cleanup of `isLombokGenerated` methods * Cleanup of `isLombokGenerated` methods * Cleanup * Improve `onConstructor` and `onConstructorNoArgs` args * Fix missing `onConstructor_` check * Cleanup * Apply suggestions from code review Co-authored-by: Knut Wannheden <[email protected]> * Improve tests * Merge branch 'main' into lombok-java-8 * Rename JavacAnnotationHandler with no action to XNoOpHandler * Rename JavacAnnotationHandler with no action to XNoOpHandler * Improve lomboks `ExampleException` test --------- Co-authored-by: Knut Wannheden <[email protected]>
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What's changed?
<LombokAnnotation>NoOpHandler
(half of the JavacAnnotationHandler classes that had this behavior were already named that way)What's does not work yet?
@AllArgsConstructorHandler
,@NoArgsConstructorHandler
and@NoArgsConstructorHandler
with the onConstructor_ param.@Jacksonized
Further research should be done in a follow up ticket. The rest of this code is good as it is and is mergeable. Especially since the onX feature is still very much in the experimental status and @Jacksonized is not used that often.
What's your motivation?
Any additional context
I tried to bring the Java 8 and Java 17 code as close to each other as possible. That's why I added the
parseInputsToCompilerAst
method and removed the customTodo
class (just like the java 11, 17 and 21 parser).Furthermore I squeezed the lombok code in all parsers as much as possible. By having just one
isLombokGenerated
method which works for whatever com.sun.source.tree.Tree as input, the code is easier to follow.Checklist