diff --git a/src/main/java/org/openrewrite/micrometer/TimerToObservation.java b/src/main/java/org/openrewrite/micrometer/TimerToObservation.java index 68065bd..576db0f 100644 --- a/src/main/java/org/openrewrite/micrometer/TimerToObservation.java +++ b/src/main/java/org/openrewrite/micrometer/TimerToObservation.java @@ -49,8 +49,8 @@ public TreeVisitor, ExecutionContext> getVisitor() { return Preconditions.check( Preconditions.and( Preconditions.or( - new UsesMethod<>(TIMER + " record*(..)", false), - new UsesMethod<>(TIMER + " wrap(..)", false) + new UsesMethod<>(TIMER + " record*(*)", false), + new UsesMethod<>(TIMER + " wrap(*)", false) ), Preconditions.and( Preconditions.not(new UsesMethod<>(TIMER + " record(java.time.Duration)", false)), @@ -66,7 +66,7 @@ public TreeVisitor, ExecutionContext> getVisitor() { private final ChangeType changeTypeRegistry = new ChangeType("io.micrometer.core.instrument.MeterRegistry", "io.micrometer.observation.ObservationRegistry", null); private final ChangeType changeTypeTimer = new ChangeType("io.micrometer.core.instrument.Timer","io.micrometer.observation.Observation", null); - private final ChangeMethodName changeRecord = new ChangeMethodName(OBSERVATION + " record*(..)", "observe", null, null); + private final ChangeMethodName changeRecord = new ChangeMethodName(OBSERVATION + " record*(*)", "observe", null, null); @Override public J.CompilationUnit visitCompilationUnit(J.CompilationUnit compilationUnit, ExecutionContext executionContext) { diff --git a/src/main/java/org/openrewrite/micrometer/package-info.java b/src/main/java/org/openrewrite/micrometer/package-info.java index 6ad372c..e313075 100644 --- a/src/main/java/org/openrewrite/micrometer/package-info.java +++ b/src/main/java/org/openrewrite/micrometer/package-info.java @@ -1,3 +1,18 @@ +/* + * Copyright 2023 the original author or authors. + *
+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *
+ * https://www.apache.org/licenses/LICENSE-2.0 + *
+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ @NonNullApi @NonNullFields package org.openrewrite.micrometer; diff --git a/src/test/java/org/openrewrite/micrometer/TimerToObservationTest.java b/src/test/java/org/openrewrite/micrometer/TimerToObservationTest.java index 4cb3013..a408a75 100644 --- a/src/test/java/org/openrewrite/micrometer/TimerToObservationTest.java +++ b/src/test/java/org/openrewrite/micrometer/TimerToObservationTest.java @@ -173,7 +173,7 @@ void test(Runnable arg) { import io.micrometer.common.KeyValues; import io.micrometer.observation.Observation; import io.micrometer.observation.ObservationRegistry; - + class Test { private ObservationRegistry registry;