Skip to content

Commit c7b5bd2

Browse files
committed
Directly include the generated recipes here, as rewrite-third-party requires Java 17
Fixes #262
1 parent bb35e78 commit c7b5bd2

File tree

2 files changed

+57
-1
lines changed

2 files changed

+57
-1
lines changed

build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ dependencies {
3131
implementation("org.openrewrite:rewrite-xml")
3232
implementation("org.openrewrite.recipe:rewrite-java-dependencies:${rewriteVersion}")
3333
implementation("org.openrewrite.recipe:rewrite-static-analysis:${rewriteVersion}")
34-
implementation("org.openrewrite.recipe:rewrite-third-party:${rewriteVersion}")
3534
runtimeOnly("org.openrewrite:rewrite-java-21")
3635

3736
compileOnly("org.apache.logging.log4j:log4j-core:2.+")
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#
2+
# Copyright 2025 the original author or authors.
3+
# <p>
4+
# Licensed under the Moderne Source Available License (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# <p>
8+
# https://docs.moderne.io/licensing/moderne-source-available-license
9+
# <p>
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
#
18+
# Generated InlineMe recipes from TypeTable
19+
#
20+
21+
type: specs.openrewrite.org/v1beta/recipe
22+
name: org.apache.logging.log4j.InlineLog4jApiMethods
23+
displayName: Inline `log4j-api-2` methods annotated with `@InlineMe`
24+
description: >-
25+
Automatically generated recipes to inline method calls based on `@InlineMe` annotations
26+
discovered in the type table.
27+
recipeList:
28+
# From org.apache.logging.log4j:log4j-api:2.25.2
29+
- org.openrewrite.java.InlineMethodCalls:
30+
methodPattern: 'org.apache.logging.log4j.message.ParameterizedMessage ParameterizedMessage(java.lang.String, java.lang.String[], java.lang.Throwable)'
31+
replacement: 'this(pattern, Arrays.stream(args).toArray(Object[]::new), throwable)'
32+
imports:
33+
- 'java.util.Arrays'
34+
classpathFromResources:
35+
- 'log4j-api-2'
36+
- org.openrewrite.java.InlineMethodCalls:
37+
methodPattern: 'org.apache.logging.log4j.message.StructuredDataId StructuredDataId(java.lang.String, int, java.lang.String[], java.lang.String[])'
38+
replacement: 'this(name, String.valueOf(enterpriseNumber), required, optional)'
39+
classpathFromResources:
40+
- 'log4j-api-2'
41+
- org.openrewrite.java.InlineMethodCalls:
42+
methodPattern: 'org.apache.logging.log4j.message.StructuredDataId StructuredDataId(java.lang.String, int, java.lang.String[], java.lang.String[], int)'
43+
replacement: 'this(name, String.valueOf(enterpriseNumber), required, optional, maxLength)'
44+
classpathFromResources:
45+
- 'log4j-api-2'
46+
- org.openrewrite.java.InlineMethodCalls:
47+
methodPattern: 'org.apache.logging.log4j.message.StructuredDataId makeId(java.lang.String, int)'
48+
replacement: 'this.makeId(defaultId, String.valueOf(anEnterpriseNumber))'
49+
classpathFromResources:
50+
- 'log4j-api-2'
51+
- org.openrewrite.java.InlineMethodCalls:
52+
methodPattern: 'org.apache.logging.log4j.MarkerManager getMarker(java.lang.String, org.apache.logging.log4j.Marker)'
53+
replacement: 'MarkerManager.getMarker(name).addParents(parent)'
54+
imports:
55+
- 'org.apache.logging.log4j.MarkerManager'
56+
classpathFromResources:
57+
- 'log4j-api-2'

0 commit comments

Comments
 (0)