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

preserve annotation values when parsing compiled classes #1

Draft
wants to merge 183 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
183 commits
Select commit Hold shift + click to select a range
b373d9f
refactor: update OWASP suppression date bounds (#4739)
zieka Dec 3, 2024
9936a7a
Enrich GradleDependency.Matcher to match on cases where a ResolvedDep…
shanman190 Dec 4, 2024
cd4a37f
Fix `JavaNamingService` license header year
Laurens-W Dec 4, 2024
f9d71bc
Fix multiline example in CreateYamlFile
timtebeek Dec 4, 2024
c30f37d
Fix gradle/groovy parser issue with gradle 6 (#4742)
Laurens-W Dec 4, 2024
efc38e3
Take J.Case statements into account in JavaTemplate (#4744)
Laurens-W Dec 4, 2024
334b9e2
preserve annotation values when parsing compiled classes
Dec 3, 2024
8998388
use Collectors.toList() instead for compatiability and consistency
Dec 4, 2024
f9737d5
Remove extra semi-colons
zexblue01 Dec 4, 2024
6530337
Added a few missing `@Nullable` annotations to `JavaType`
knutwannheden Dec 5, 2024
fcd9bcb
Store actual annotation values
knutwannheden Dec 5, 2024
228585e
Map some more annotation attribute value types
knutwannheden Dec 5, 2024
0749964
Include source retention annotations for Java 1.8 and Java 11
knutwannheden Dec 5, 2024
a551727
A `J.Case`, like `J.Block` is a scope that ends statements with a sem…
Laurens-W Dec 5, 2024
72793ae
Fix AddImport match variable's name (#4747)
SiBorea Dec 5, 2024
20de532
feat: Added option to comment out property in yaml (#4741)
ashakirin Dec 5, 2024
45f228a
Fix #4705 Groovy parser does not correctly handle redundant "def" pre…
sambsnyd Dec 5, 2024
7013518
Support variable expressions in parenthesis (#4751)
jevanlingen Dec 6, 2024
e571da7
Update get classpath by artifact name to support bazel (#4750)
amishra-u Dec 6, 2024
4c0f0ca
IncrementProjectVersion should only update matching old version
timtebeek Dec 6, 2024
4e723d8
Add RegExp support to ChangeTagValue recipe (#4733)
anthochristen Dec 6, 2024
14a0776
Include source retention annotations for Java 1.8 and Java 11
knutwannheden Dec 5, 2024
104f705
Add initial support for java references for yaml (#4698)
nielsdebruin Dec 6, 2024
16df13a
Adding master password decrypting (#4753)
svaningelgem Dec 8, 2024
1095923
Make sure provided download target exist before writing files to it (…
lkerford Dec 9, 2024
3403f7e
`AddOrUpdateAnnotationAttribute` should also visit nested annotations
timtebeek Dec 10, 2024
54a2057
`RemoveMethodInvocationsVisitor` can remove static method (#4754)
dralagen Dec 10, 2024
a117884
Various refactorings
knutwannheden Dec 10, 2024
19bd9ce
Merge remote-tracking branch 'refs/remotes/origin/main' into eason-pr…
knutwannheden Dec 10, 2024
bdb85c5
Polish
knutwannheden Dec 10, 2024
865540c
Polish
knutwannheden Dec 10, 2024
99ad9cd
Fix failing tests
knutwannheden Dec 10, 2024
d86eeaa
Polish
knutwannheden Dec 10, 2024
bee3e2f
Remove redundant versions for Gradle (#4492)
shanman190 Dec 11, 2024
1c90a62
Change return type of `JavaType.Annotation.ElementValue#getElement()`
knutwannheden Dec 11, 2024
ecfb0e5
Allow building uri from origin, path and service type (#4767)
pstreef Dec 11, 2024
7489e3a
Apply OpenRewrite best practices, and make those easier to apply
timtebeek Dec 11, 2024
2bcf394
Document the use of `rewrite.yml`
timtebeek Dec 11, 2024
d789bcb
Performance improvements of `Find` recipe (#4758)
nielsdebruin Dec 11, 2024
ecc2d62
Strip origin in findRemoteServer (#4771)
pstreef Dec 11, 2024
a473f26
Groovy parser does not support multiple closure arguments without par…
jevanlingen Dec 11, 2024
15f2502
Correct `J.FieldAccess#isFullyQualifiedClassReference()` (#4774)
knutwannheden Dec 12, 2024
f4f1996
Normalize server URLs to avoid missing scheme (#4780)
pstreef Dec 12, 2024
fdc042b
Remove a few `String#substring()` calls from Groovy parser
knutwannheden Dec 12, 2024
ceb3dab
Fix duplicate data table entries.
sambsnyd Dec 12, 2024
5cb3945
Drop unused GraphvizResolutionEventListener & dependency (#4778)
timtebeek Dec 12, 2024
abb80e1
Allow pom download failures (#4738)
adastraperangusta Dec 12, 2024
8cfcf0c
Remove `Find#findAllNewLineIndexes()`
knutwannheden Dec 13, 2024
51d340d
`Find`: Small improvement
knutwannheden Dec 13, 2024
4201b5c
`Find`: Small improvement
knutwannheden Dec 13, 2024
cdb945f
Move the OkHttpSender to rewrite-maven tests (#4782)
timtebeek Dec 13, 2024
601fec7
Add explicit imports to avoid conflicts with classes added to java.la…
BramliAK Dec 15, 2024
36acd59
Always add import for `Record` classes not from `java.lang` package, …
BramliAK Dec 15, 2024
d449490
Add `testRuntimeOnly` dependency on `junit-platform-launcher` with Gr…
timtebeek Dec 15, 2024
5f2d11c
Fix groovy multivariable declaration (#4757)
Laurens-W Dec 17, 2024
372246c
enhance UpgradeDependencyVersionTest (#4788)
sullis Dec 17, 2024
65c9cf1
Add a "latest minor" semver selector. We have them for major versions…
sambsnyd Dec 18, 2024
2882fdc
Expand `SimplifyBooleanExpressionVisitor` to include String comparisons
timtebeek Dec 18, 2024
6b2b63c
fix[maven]: update plugin dependencies (#4798)
jonblack Dec 18, 2024
e5d9337
Handle erroneous nodes in open rewrite (#4412)
vudayani Dec 19, 2024
91a031a
Make Groovy Parser correctly handle nested parenthesis (#4801)
Laurens-W Dec 19, 2024
2631a7e
suppress javax.json (#4804)
pstreef Dec 20, 2024
697ae15
Refactor SpringReference (#4805)
Laurens-W Dec 20, 2024
59273da
refactor: Update Gradle wrapper (#4808)
shanman190 Dec 20, 2024
dd2886c
Add recipe to remove Gradle Enterprise and Develocity (#4809)
timtebeek Dec 21, 2024
e93ec04
Add a UsesType precondition to ReplaceConstant
timtebeek Dec 21, 2024
da6561e
Allow file scheme in `RemoteArchive` to simplify testing (#4791)
pstreef Dec 23, 2024
e59e48b
Try alternative way of determining parenthesis level for `BinaryExpre…
Laurens-W Dec 23, 2024
804dea0
Add a `isClassAvailable` method to the ReflectionUtils (#4810)
jevanlingen Dec 24, 2024
da57352
Update rewrite.yml to enforce CompareEnumsWithEqualityOperator
timtebeek Dec 24, 2024
ef0f845
Correctly map generic return and parameter types in `JavaReflectionTy…
jkschneider Dec 24, 2024
321c93b
Polish formatting
jkschneider Dec 24, 2024
4ca0c8e
Add more scenarios to JavaTypeGoat for simply typed fields and method…
jkschneider Dec 24, 2024
15740e4
Support mapping of generic thrown exception types (#4813)
jkschneider Dec 25, 2024
5b14eb0
refactor: Enum values should be compared with "==" (#4811)
timtebeek Dec 25, 2024
6dc9d50
Keep the names of generic type variables defined by methods. (#4814)
jkschneider Dec 25, 2024
f4038c2
Fix Java reflection mapping of generic typed fields. (#4815)
jkschneider Dec 25, 2024
b91499c
Revert parenthesis changes (#4818)
timtebeek Dec 27, 2024
7444d1c
JavaTemplate bug when inserting `final var` into for-each (#4806)
timtebeek Dec 27, 2024
2375e31
Fix StringIndexOutOfBoundsException for YamlReferences that end in a dot
timtebeek Dec 29, 2024
a8946ac
Add Docker Image reference, to be used for gitlab, docker, etc (#4793)
jevanlingen Dec 30, 2024
9cfddab
Fix regression in `SimplifyBooleanExpressionVisitor`
timtebeek Dec 30, 2024
af162a3
Add support for lombok @Builder.Default Annotation (#4823)
amishra-u Dec 31, 2024
9fbda22
Put multiple parenthesis support back, fixes modifiers in for loop an…
jevanlingen Dec 31, 2024
2b8cdd0
Groovy parsers should be able to support `.class` (#4824)
jevanlingen Dec 31, 2024
000a4f0
`AddAnnotationProcessor` should compare and update versions using a p…
nielsdebruin Dec 31, 2024
2a8bf2d
Add lombok support for java-11 (#4769)
amishra-u Dec 31, 2024
424575a
Add missing override annotation (#4828)
timtebeek Jan 2, 2025
0185820
Don't skip type attribution on compilation error (#4826)
amishra-u Jan 2, 2025
1f83ea3
UT for slash signs in string literals (#4829)
greg-at-moderne Jan 2, 2025
1aee2af
Support inner classes for groovy (#4825)
jevanlingen Jan 2, 2025
30f1716
Support nested annotations with properties and annotations with empty…
jevanlingen Jan 2, 2025
1b1f1fe
Hcl - allow for expression on LHS in objectelem (#4831)
greg-at-moderne Jan 2, 2025
56be668
Prevent class cast exception on Unknown annotation type (#4833)
timtebeek Jan 2, 2025
2bf57b9
Improve discovery of parentheses level for MethodCallExpression (#4834)
jevanlingen Jan 2, 2025
f9201dd
Add Support for Builder.Default annotation for final vars (#4835)
amishra-u Jan 2, 2025
e69e413
Allow to add Maven test scoped dependency (#4837)
timtebeek Jan 3, 2025
988390a
UT for expressionOnLeftHandSideOfAMapLiteral (#4841)
greg-at-moderne Jan 3, 2025
38d92b0
HCL - Fixing handling of multi-line empty maps (#4839)
greg-at-moderne Jan 3, 2025
10a1661
Cleanup groovy parser (#4838)
jevanlingen Jan 3, 2025
8a9a449
Fix parsing string literal with line breaks and spaces (#4843)
jevanlingen Jan 3, 2025
02411bd
Add TOML language parser (#4845)
shanman190 Jan 3, 2025
19dfd6a
Polish toml
shanman190 Jan 3, 2025
6dd029f
Do not match unnamed variables in NameCaseConvention
timtebeek Jan 3, 2025
e6a8499
Adding option cutOffDate to RemoveOwaspSuppressions (#4846)
lkerford Jan 3, 2025
c455436
Support pattern operator for groovy (#4847)
jevanlingen Jan 6, 2025
a3249f2
Skip parsing groovy generated transform methods (#4848)
jevanlingen Jan 6, 2025
a490f18
Merge branch 'main' into eason-preserve_annotation_values
timtebeek Jan 6, 2025
a1d0f36
Support semicolon for groovy packages (#4850)
jevanlingen Jan 6, 2025
28d88c4
Standardize semicolon-delineated path separation in file patterns
sambsnyd Jan 6, 2025
621dcfa
Use our StringUtils
sambsnyd Jan 6, 2025
15f7751
Add recipe to enable Develocity build cache in xml configuration (#4856)
nielsdebruin Jan 7, 2025
fd71955
HCL - comments in multilines `for` (#4858)
greg-at-moderne Jan 7, 2025
b3f17ce
Rename recipe options and inline visitor and method
timtebeek Jan 7, 2025
6ddcc37
Lombok support for java 21 (#4860)
jevanlingen Jan 7, 2025
0e5b439
HCL - comments as the final lines (#4861)
greg-at-moderne Jan 7, 2025
c2e5624
Replacing dependency on commons-compress with commons-lang3 (#4863)
greg-at-moderne Jan 8, 2025
789ac5f
Fixing handing of # or // within multiline comments (#4864)
greg-at-moderne Jan 8, 2025
6bfac94
Mark `PlainText` all-args constructor as private
knutwannheden Jan 8, 2025
3b3a56c
Check for `null` in `TabsAndIndentsVisitor#visitContainer()`
knutwannheden Jan 8, 2025
13b6168
fixing comment nesting in positionOfNext() (#4866)
greg-at-moderne Jan 8, 2025
1bb9da0
fix: create dependencyResourceLoaders in 2 passes (#4870)
natedanner Jan 9, 2025
7566b00
HCL - Fixing empty comment handling (#4871)
greg-at-moderne Jan 9, 2025
0826417
RemoveUnusedProperties should not fail on Quarks
timtebeek Jan 9, 2025
d11eae9
ExplicitPluginGroupId should only add groupId if artifactId is present
timtebeek Jan 9, 2025
82b61de
Map trailing commas as `TrailingComma` `Marker`, to fix `J.Erroneous`…
timtebeek Jan 9, 2025
4c901ff
Don't cache filePatterns at Recipe class level... caused strange beha…
sambsnyd Jan 9, 2025
e69e8ca
Fix broken RSPEC links
sambsnyd Jan 10, 2025
fa1fc56
Fix #4877 where the groovy parser would fail to parse variables whose…
sambsnyd Jan 10, 2025
9fc0dba
I transiently forgot about transient
sambsnyd Jan 10, 2025
50d160e
Partial support Lombok for java 8 (mostly done) (#4855)
jevanlingen Jan 10, 2025
6609c8c
Update VariableDeclarationsTest.java
timtebeek Jan 10, 2025
6ff7a03
Add recipe to enable Develocity build cache for Gradle (#4859)
nielsdebruin Jan 10, 2025
cd013f4
Add dark/light svg logo
mike-solomon Jan 10, 2025
882291b
Swap name of dark/light logo
mike-solomon Jan 10, 2025
cb5a059
Update readme with new logo
mike-solomon Jan 10, 2025
dd67fe6
Add test for inner annotations and fix (#4885)
danielshamis Jan 10, 2025
4a8a38b
Enable `AnnotationMatcher` to match values in `J.NewArray` (#4889)
MBoegers Jan 12, 2025
6a818cf
Print cursor when tests fail to run a recipe (#4891)
timtebeek Jan 13, 2025
6f3416f
Add TomlVisitorTest after seeing ClassCastException in arrays (#4892)
timtebeek Jan 13, 2025
aeb5bf2
Lombok's generated @With method misses type information; fix for Java…
jevanlingen Jan 13, 2025
30c9156
Add `slf4j-nop` transitively through rewrite-test (#4895)
timtebeek Jan 13, 2025
cce9f3e
`LatestRelease` should replace `metadataPattern` as regex, as documen…
ZhyliaievD Jan 13, 2025
8a060c6
chore: update suppressions (#4903)
zieka Jan 15, 2025
db9f188
HCL - support for legacy syntax for attribute expressions (#4901)
greg-at-moderne Jan 15, 2025
09dfe06
Add new parameter `oldAttributeValue` to `AddOrUpdateAnnotationAttrib…
MBoegers Jan 15, 2025
c80874b
TOML model cleanups (#4907)
knutwannheden Jan 15, 2025
2586748
When resolving maven pom properties give system properties precedence.
sambsnyd Jan 16, 2025
6cd1e2a
Refactoring, extract normalizeNewLines() (#4904)
greg-at-moderne Jan 16, 2025
462dc74
Correct TOML table parsing (#4910)
knutwannheden Jan 16, 2025
36efb73
Add a test validation that execution context is not mutated during re…
sambsnyd Jan 16, 2025
68f86ee
Optionally update maven plugin version in ChangePluginGroupIdAndArtif…
JesseEstum Jan 16, 2025
1fd511c
Fix AddOrUpdateAnnotationAttribute unable to handle FieldAccess (#4898)
SiBorea Jan 16, 2025
3d9653d
Fixed missing version on multiple dependency management sections in m…
t-huebner-id Jan 16, 2025
a6afce0
Tweak AddDependency to be a bit more permissive when adding a depende…
sambsnyd Jan 16, 2025
c1b258e
Fix issue parsing string with Java8ReloadableParser (#4914)
rlsanders4 Jan 17, 2025
b7746cf
Groovy parser fail with single line comment (#4887)
jonesbusy Jan 17, 2025
b2a641d
YAML Parser not to take @variables@ in the middle of scalar (#4917)
greg-at-moderne Jan 17, 2025
fa191cb
Add missing `@Contract` to `ListUtils#map()` method
knutwannheden Jan 17, 2025
9ddbb83
Support JEP-441: Pattern Matching for switch for Java 21+ (#4661)
nielsdebruin Jan 17, 2025
1d96858
Pull up recipes from rewrite-migrate-java (#4918)
timtebeek Jan 17, 2025
afa160e
Autodetect formatting style of JSON code (#4916)
greg-at-moderne Jan 17, 2025
ca96499
Tweak PathUtils so that multi-segment paths can be negated
sambsnyd Jan 18, 2025
04cfcf5
Prevent NPE on test resources without Gradle project marker
timtebeek Jan 20, 2025
dd01ca4
Support Groovy methods declaring generic type parameters (#4923)
knutwannheden Jan 20, 2025
0b3dfb9
Fixing YAML handling of multiline literals in some cases (#4924)
greg-at-moderne Jan 20, 2025
d8971bf
Refactoring, renaming visitors not to use Java in their name (#4926)
greg-at-moderne Jan 20, 2025
5c787c4
Allow Groovy class to extend `groovy.lang.Script` (#4922)
knutwannheden Jan 20, 2025
d49141c
Remove now duplicate test
timtebeek Jan 20, 2025
675ca5f
Map compiler type information for `SwitchExpression` (#4929)
Laurens-W Jan 21, 2025
1f4956b
Add "acceptTransitive" parameter to recipes which add gradle plugins.
sambsnyd Jan 22, 2025
2aadb97
Catch corner case in Java `TabsAndIndentsVisitor`
knutwannheden Jan 22, 2025
354101d
Add backwards compatibility constructors (#4933)
knutwannheden Jan 22, 2025
11a0924
Correct signature of deprecated `J.Case` constructor
knutwannheden Jan 22, 2025
7661418
`TypeTable` as a substitute for packing whole jars into `META-INF/rew…
jkschneider Jan 22, 2025
7e6da9a
Remove duplicate newline at the end of JavaParser
timtebeek Jan 22, 2025
af6e18c
Merge branch 'main' into eason-preserve_annotation_values
timtebeek Jan 22, 2025
8b39237
Restore `selectType instanceof Type.ErrorType` check
timtebeek Jan 22, 2025
574223d
Remove unused imports and apply formatter
timtebeek Jan 22, 2025
5eb553c
Do not remove print statements from tests for now
timtebeek Jan 22, 2025
c399296
Merge branch 'main' into eason-preserve_annotation_values
timtebeek Jan 22, 2025
474aae3
Fix Jackson serialization support
knutwannheden Jan 23, 2025
cf83f5e
Add `JavaTypeVisitor#visitAnnotation()`
knutwannheden Jan 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
61 changes: 0 additions & 61 deletions .github/workflows/receive-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,64 +17,3 @@ jobs:
uses: openrewrite/gh-automation/.github/workflows/receive-pr.yml@main
with:
recipe: 'org.openrewrite.recipes.OpenRewriteBestPracticesSubset'
rewrite_yml: |
---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.recipes.OpenRewriteBestPracticesSubset
displayName: OpenRewrite best practices
description: Best practices for OpenRewrite recipe development.
recipeList:
- org.openrewrite.recipes.JavaRecipeBestPracticesSubset
- org.openrewrite.recipes.RecipeTestingBestPracticesSubset
- org.openrewrite.recipes.RecipeNullabilityBestPracticesSubset
#- org.openrewrite.java.OrderImports
- org.openrewrite.java.format.EmptyNewlineAtEndOfFile
- org.openrewrite.staticanalysis.InlineVariable
- org.openrewrite.staticanalysis.MissingOverrideAnnotation
- org.openrewrite.staticanalysis.UseDiamondOperator
---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.recipes.JavaRecipeBestPracticesSubset
displayName: Java Recipe best practices
description: Best practices for Java recipe development.
preconditions:
- org.openrewrite.java.search.FindTypes:
fullyQualifiedTypeName: org.openrewrite.Recipe
checkAssignability: true
recipeList:
- org.openrewrite.java.recipes.BlankLinesAroundFieldsWithAnnotations
- org.openrewrite.java.recipes.ExecutionContextParameterName
- org.openrewrite.java.recipes.MissingOptionExample
- org.openrewrite.java.recipes.RecipeEqualsAndHashCodeCallSuper
- org.openrewrite.java.recipes.UseTreeRandomId
- org.openrewrite.staticanalysis.NeedBraces
#- org.openrewrite.staticanalysis.RemoveSystemOutPrintln
---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.recipes.RecipeTestingBestPracticesSubset
displayName: Recipe testing best practices
description: Best practices for testing recipes.
preconditions:
- org.openrewrite.java.search.FindTypes:
fullyQualifiedTypeName: org.openrewrite.test.RewriteTest
checkAssignability: true
recipeList:
- org.openrewrite.java.recipes.RewriteTestClassesShouldNotBePublic
#- org.openrewrite.java.recipes.SelectRecipeExamples
- org.openrewrite.java.recipes.SourceSpecTextBlockIndentation
- org.openrewrite.java.testing.cleanup.RemoveTestPrefix
- org.openrewrite.java.testing.cleanup.TestsShouldNotBePublic
- org.openrewrite.staticanalysis.NeedBraces
- org.openrewrite.staticanalysis.RemoveSystemOutPrintln
---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.recipes.RecipeNullabilityBestPracticesSubset
displayName: Recipe nullability best practices
description: Use OpenRewrite internal nullability annotations; drop JetBrains annotations; use `package-info.java` instead.
recipeList:
- org.openrewrite.staticanalysis.NullableOnMethodReturnType
- org.openrewrite.java.RemoveAnnotation:
annotationPattern: '@org.jetbrains.annotations.NotNull'
- org.openrewrite.java.RemoveAnnotation:
annotationPattern: '@jakarta.annotation.Nonnull'
#- org.openrewrite.java.jspecify.MigrateToJspecify
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<p align="center">
<img src="./doc/logo-oss.png" alt="OpenRewrite"/>
<a href="https://docs.openrewrite.org">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/openrewrite/rewrite/raw/main/doc/logo-oss-dark.svg">
<source media="(prefers-color-scheme: light)" srcset="https://github.com/openrewrite/rewrite/raw/main/doc/logo-oss-light.svg">
<img alt="OpenRewrite Logo" src="https://github.com/openrewrite/rewrite/raw/main/doc/logo-oss-light.svg" width='600px'>
</picture>
</a>
</p>

<div align="center">
Expand Down
3 changes: 3 additions & 0 deletions doc/logo-oss-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading