From e295816ae39403e902ca3d457f713603aa3a78fe Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Mon, 4 Aug 2025 15:32:51 +0100 Subject: [PATCH 1/3] avoid deprecated function interfaces --- .../java/org/apache/pekko/http/caching/javadsl/Cache.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/http-caching/src/main/java/org/apache/pekko/http/caching/javadsl/Cache.java b/http-caching/src/main/java/org/apache/pekko/http/caching/javadsl/Cache.java index 5c67cdf589..e44239d628 100644 --- a/http-caching/src/main/java/org/apache/pekko/http/caching/javadsl/Cache.java +++ b/http-caching/src/main/java/org/apache/pekko/http/caching/javadsl/Cache.java @@ -15,8 +15,8 @@ import org.apache.pekko.annotation.ApiMayChange; import org.apache.pekko.annotation.DoNotInherit; -import org.apache.pekko.japi.Creator; -import org.apache.pekko.japi.Procedure; +import org.apache.pekko.japi.function.Creator; +import org.apache.pekko.japi.function.Procedure; import java.util.Optional; import java.util.concurrent.CompletableFuture; From 631d5a372f9dc1c0f62ed346a6e39aa26ada02c5 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Mon, 4 Aug 2025 15:49:29 +0100 Subject: [PATCH 2/3] more changes --- .../scala/org/apache/pekko/http/caching/LfuCache.scala | 9 ++++----- .../org/apache/pekko/http/caching/scaladsl/Cache.scala | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/http-caching/src/main/scala/org/apache/pekko/http/caching/LfuCache.scala b/http-caching/src/main/scala/org/apache/pekko/http/caching/LfuCache.scala index 18d521e884..9ea73de70d 100755 --- a/http-caching/src/main/scala/org/apache/pekko/http/caching/LfuCache.scala +++ b/http-caching/src/main/scala/org/apache/pekko/http/caching/LfuCache.scala @@ -16,19 +16,18 @@ package org.apache.pekko.http.caching import java.util.concurrent.{ CompletableFuture, Executor, TimeUnit } import java.util.function.BiFunction -import org.apache.pekko -import pekko.actor.ActorSystem -import pekko.annotation.{ ApiMayChange, InternalApi } - import scala.collection.JavaConverters._ import scala.concurrent.duration.Duration import scala.concurrent.{ ExecutionContext, Future } + import com.github.benmanes.caffeine.cache.{ AsyncCache, Caffeine } +import org.apache.pekko +import pekko.actor.ActorSystem +import pekko.annotation.{ ApiMayChange, InternalApi } import pekko.http.caching.LfuCache.toJavaMappingFunction import pekko.http.caching.scaladsl.Cache import pekko.http.impl.util.JavaMapping.Implicits._ import pekko.http.caching.CacheJavaMapping.Implicits._ - import pekko.util.FutureConverters._ import pekko.util.FunctionConverters._ diff --git a/http-caching/src/main/scala/org/apache/pekko/http/caching/scaladsl/Cache.scala b/http-caching/src/main/scala/org/apache/pekko/http/caching/scaladsl/Cache.scala index 3003046b76..b5e3005bca 100755 --- a/http-caching/src/main/scala/org/apache/pekko/http/caching/scaladsl/Cache.scala +++ b/http-caching/src/main/scala/org/apache/pekko/http/caching/scaladsl/Cache.scala @@ -18,7 +18,7 @@ import java.util.concurrent.{ CompletableFuture, CompletionStage } import org.apache.pekko import pekko.annotation.{ ApiMayChange, DoNotInherit } -import pekko.japi.{ Creator, Procedure } +import pekko.japi.function.{ Creator, Procedure } import pekko.util.FutureConverters._ import scala.collection.JavaConverters._ From 1f97a82845ec0b7bcc009d1f3336c8b59758804c Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Mon, 4 Aug 2025 15:57:34 +0100 Subject: [PATCH 3/3] mima --- .../switch-functional-interfaces.excludes | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 http-caching/src/main/mima-filters/2.0.x.backwards.excludes/switch-functional-interfaces.excludes diff --git a/http-caching/src/main/mima-filters/2.0.x.backwards.excludes/switch-functional-interfaces.excludes b/http-caching/src/main/mima-filters/2.0.x.backwards.excludes/switch-functional-interfaces.excludes new file mode 100644 index 0000000000..6ae645529e --- /dev/null +++ b/http-caching/src/main/mima-filters/2.0.x.backwards.excludes/switch-functional-interfaces.excludes @@ -0,0 +1,27 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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 +# +# http://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. + +# Change to pekko.util.function Functional Interfaces +ProblemFilters.exclude[IncompatibleMethTypeProblem]("org.apache.pekko.http.caching.javadsl.Cache.getFuture") +ProblemFilters.exclude[IncompatibleMethTypeProblem]("org.apache.pekko.http.caching.javadsl.Cache.getOrFulfil") +ProblemFilters.exclude[IncompatibleMethTypeProblem]("org.apache.pekko.http.caching.javadsl.Cache.getOrCreateStrict") +ProblemFilters.exclude[ReversedMissingMethodProblem]("org.apache.pekko.http.caching.javadsl.Cache.getFuture") +ProblemFilters.exclude[ReversedMissingMethodProblem]("org.apache.pekko.http.caching.javadsl.Cache.getOrFulfil") +ProblemFilters.exclude[ReversedMissingMethodProblem]("org.apache.pekko.http.caching.javadsl.Cache.getOrCreateStrict") +ProblemFilters.exclude[IncompatibleMethTypeProblem]("org.apache.pekko.http.caching.scaladsl.Cache.getFuture") +ProblemFilters.exclude[IncompatibleMethTypeProblem]("org.apache.pekko.http.caching.scaladsl.Cache.getOrFulfil") +ProblemFilters.exclude[IncompatibleMethTypeProblem]("org.apache.pekko.http.caching.scaladsl.Cache.getOrCreateStrict")