Skip to content

Commit 4560408

Browse files
authored
Merge branch 'main' into pipenv-lockfiles
2 parents c25ae87 + 3964f44 commit 4560408

5 files changed

Lines changed: 36 additions & 5 deletions

File tree

rewrite-docker/src/main/resources/META-INF/rewrite/examples.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ examples:
141141
RUN apt-get install -y curl
142142
ENTRYPOINT /app/start.sh
143143
after: |
144-
~~(EOL: ubuntu:20.04 (ended 2025-05-31, suggest noble (24.04)))~~>~~(Missing HEALTHCHECK instruction)~~>FROM ubuntu:20.04
144+
~~(EOL: ubuntu:20.04 (ended 2025-05-31, suggest plucky (26.04)))~~>~~(Missing HEALTHCHECK instruction)~~>FROM ubuntu:20.04
145145
COPY app.jar /app/
146146
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
147147
ENTRYPOINT ["/app/start.sh"]

rewrite-docker/src/test/java/org/openrewrite/docker/DockerBestPracticesTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ void appliesBestPractices() {
4242
ENTRYPOINT /app/start.sh
4343
""",
4444
"""
45-
~~(EOL: ubuntu:20.04 (ended 2025-05-31, suggest noble (24.04)))~~>~~(Missing HEALTHCHECK instruction)~~>FROM ubuntu:20.04
45+
~~(EOL: ubuntu:20.04 (ended 2025-05-31, suggest plucky (26.04)))~~>~~(Missing HEALTHCHECK instruction)~~>FROM ubuntu:20.04
4646
COPY app.jar /app/
4747
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
4848
ENTRYPOINT ["/app/start.sh"]

rewrite-docker/src/test/java/org/openrewrite/docker/search/FindEndOfLifeImagesTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ void detectUbuntuXenial() {
102102
RUN apt-get update
103103
""",
104104
"""
105-
~~(EOL: ubuntu:16.04 (ended 2021-04-02, suggest noble (24.04)))~~>FROM ubuntu:16.04
105+
~~(EOL: ubuntu:16.04 (ended 2021-04-02, suggest plucky (26.04)))~~>FROM ubuntu:16.04
106106
RUN apt-get update
107107
"""
108108
)
@@ -118,7 +118,7 @@ void detectUbuntuBionic() {
118118
RUN apt-get update
119119
""",
120120
"""
121-
~~(EOL: ubuntu:bionic (ended 2023-05-31, suggest noble (24.04)))~~>FROM ubuntu:bionic
121+
~~(EOL: ubuntu:bionic (ended 2023-05-31, suggest plucky (26.04)))~~>FROM ubuntu:bionic
122122
RUN apt-get update
123123
"""
124124
)

rewrite-groovy/src/main/java/org/openrewrite/groovy/GroovyParserVisitor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2743,7 +2743,7 @@ public TypeTree visitVariableExpressionType(@Nullable VariableExpression express
27432743
emptyList(),
27442744
typeName,
27452745
type, null);
2746-
if (expression.getOriginType().getGenericsTypes() != null) {
2746+
if (expression.getOriginType().getGenericsTypes() != null && !expression.getOriginType().isGenericsPlaceHolder() && sourceStartsWith("<")) {
27472747
return new J.ParameterizedType(randomId(), prefix, Markers.EMPTY, ident, visitTypeParameterizations(
27482748
staticType((org.codehaus.groovy.ast.expr.Expression) expression).getGenericsTypes()), type);
27492749
}

rewrite-groovy/src/test/java/org/openrewrite/groovy/tree/VariableDeclarationsTest.java

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,4 +233,35 @@ void defVariableStartsWithDef() {
233233
)
234234
);
235235
}
236+
237+
@Test
238+
void typeParameterAsLocalVariableType() {
239+
rewriteRun(
240+
groovy(
241+
"""
242+
class TaskRunner<E> {
243+
void run() {
244+
E task = null
245+
}
246+
}
247+
"""
248+
)
249+
);
250+
}
251+
252+
@Test
253+
void typeParameterAsLocalVariableTypeFromMethodCall() {
254+
rewriteRun(
255+
groovy(
256+
"""
257+
class TaskRunner<E> {
258+
java.util.concurrent.BlockingQueue<E> queue
259+
void run() {
260+
E task = queue.take()
261+
}
262+
}
263+
"""
264+
)
265+
);
266+
}
236267
}

0 commit comments

Comments
 (0)