You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pekko.apache.org by he...@apache.org on 2025/08/23 23:33:02 UTC
(pekko) branch 1.2.x updated: chore: Depreacte FI (#2075)
This is an automated email from the ASF dual-hosted git repository.
hepin pushed a commit to branch 1.2.x
in repository https://gitbox.apache.org/repos/asf/pekko.git
The following commit(s) were added to refs/heads/1.2.x by this push:
new eaf5bc9c9a chore: Depreacte FI (#2075)
eaf5bc9c9a is described below
commit eaf5bc9c9abc25b7b80c5aa8d86b46eb82205315
Author: He-Pin(kerr) <he...@gmail.com>
AuthorDate: Sun Aug 24 07:32:57 2025 +0800
chore: Depreacte FI (#2075)
---
.../org/apache/pekko/japi/MatchBuilderTest.java | 1 +
.../apache/pekko/actor/typed/BehaviorSpec.scala | 2 ++
.../src/main/java/org/apache/pekko/japi/pf/FI.java | 24 ++++++++++++++++++++++
.../scala/org/apache/pekko/actor/AbstractFSM.scala | 3 +++
.../org/apache/pekko/japi/pf/CaseStatements.scala | 4 ++++
5 files changed, 34 insertions(+)
diff --git a/actor-tests/src/test/java/org/apache/pekko/japi/MatchBuilderTest.java b/actor-tests/src/test/java/org/apache/pekko/japi/MatchBuilderTest.java
index b68592f2f2..6b2e2c5edb 100644
--- a/actor-tests/src/test/java/org/apache/pekko/japi/MatchBuilderTest.java
+++ b/actor-tests/src/test/java/org/apache/pekko/japi/MatchBuilderTest.java
@@ -22,6 +22,7 @@ import scala.MatchError;
import static org.junit.Assert.*;
+@SuppressWarnings("deprecation")
public class MatchBuilderTest extends JUnitSuite {
@Test
diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/BehaviorSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/BehaviorSpec.scala
index 47acbd0cd0..270df41bc7 100644
--- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/BehaviorSpec.scala
+++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/BehaviorSpec.scala
@@ -194,6 +194,8 @@ object BehaviorSpec {
new F1[PFBuilder[Command, Command], PFBuilder[Command, Command]] {
override def apply(in: PFBuilder[Command, Command]) = f(in)
}
+
+ @nowarn("msg=deprecated")
def fi(f: Command => Command) =
new FI.Apply[Command, Command] {
override def apply(in: Command) = f(in)
diff --git a/actor/src/main/java/org/apache/pekko/japi/pf/FI.java b/actor/src/main/java/org/apache/pekko/japi/pf/FI.java
index 5e2247af9a..f1567efe69 100644
--- a/actor/src/main/java/org/apache/pekko/japi/pf/FI.java
+++ b/actor/src/main/java/org/apache/pekko/japi/pf/FI.java
@@ -30,14 +30,17 @@ public final class FI {
*
* @param <I> the input type, that this Apply will be applied to
* @param <R> the return type, that the results of the application will have
+ * @deprecated Will be removed in 2.0.0
*/
@FunctionalInterface
+ @Deprecated
public interface Apply<I, R> {
/**
* The application to perform.
*
* @param i an instance that the application is performed on
* @return the result of the application
+ * @deprecated Will be removed in 2.0.0
*/
R apply(I i) throws Exception;
}
@@ -51,8 +54,10 @@ public final class FI {
* @param <I1> the first input type, that this Apply will be applied to
* @param <I2> the second input type, that this Apply will be applied to
* @param <R> the return type, that the results of the application will have
+ * @deprecated Will be removed in 2.0.0
*/
@FunctionalInterface
+ @Deprecated
public interface Apply2<I1, I2, R> {
/**
* The application to perform.
@@ -60,6 +65,7 @@ public final class FI {
* @param i1 an instance that the application is performed on
* @param i2 an instance that the application is performed on
* @return the result of the application
+ * @deprecated Will be removed in 2.0.0
*/
R apply(I1 i1, I2 i2) throws Exception;
}
@@ -71,7 +77,9 @@ public final class FI {
* java.util.function.Predicate} or {@link org.apache.pekko.japi.function.Predicate}.
*
* @param <T> the type that the predicate will operate on.
+ * @deprecated Will be removed in 2.0.0
*/
+ @Deprecated
@FunctionalInterface
public interface TypedPredicate<T> {
/**
@@ -88,8 +96,10 @@ public final class FI {
*
* @param <T> the type that the predicate will operate on.
* @param <U> the type that the predicate will operate on.
+ * @deprecated Will be removed in 2.0.0
*/
@FunctionalInterface
+ @Deprecated
public interface TypedPredicate2<T, U> {
/**
* The predicate to evaluate.
@@ -108,8 +118,10 @@ public final class FI {
* org.apache.pekko.japi.function.Procedure}.
*
* @param <I> the input type, that this Apply will be applied to
+ * @deprecated Will be removed in 2.0.0
*/
@FunctionalInterface
+ @Deprecated
public interface UnitApply<I> {
/**
* The application to perform.
@@ -124,8 +136,10 @@ public final class FI {
*
* @param <I1> the first input type, that this Apply will be applied to
* @param <I2> the second input type, that this Apply will be applied to
+ * @deprecated Will be removed in 2.0.0
*/
@FunctionalInterface
+ @Deprecated
public interface UnitApply2<I1, I2> {
/**
* The application to perform.
@@ -142,8 +156,10 @@ public final class FI {
* @param <I1> the first input type, that this Apply will be applied to
* @param <I2> the second input type, that this Apply will be applied to
* @param <I3> the third input type, that this Apply will be applied to
+ * @deprecated Will be removed in 2.0.0
*/
@FunctionalInterface
+ @Deprecated
public interface UnitApply3<I1, I2, I3> {
/**
* The application to perform.
@@ -162,8 +178,10 @@ public final class FI {
* @param <I2> the second input type, that this Apply will be applied to
* @param <I3> the third input type, that this Apply will be applied to
* @param <I4> the fourth input type, that this Apply will be applied to
+ * @deprecated Will be removed in 2.0.0
*/
@FunctionalInterface
+ @Deprecated
public interface UnitApply4<I1, I2, I3, I4> {
/**
* The application to perform.
@@ -181,8 +199,11 @@ public final class FI {
*
* <p>This class is kept for compatibility, but for future API's please prefer {@link
* org.apache.pekko.japi.function.Effect}.
+ *
+ * @deprecated Will be removed in 2.0.0
*/
@FunctionalInterface
+ @Deprecated
public interface UnitApplyVoid {
/** The application to perform. */
void apply() throws Exception;
@@ -194,8 +215,11 @@ public final class FI {
*
* <p>This class is kept for compatibility, but for future API's please prefer {@link
* java.util.function.Predicate} or {@link org.apache.pekko.japi.function.Predicate}.
+ *
+ * @deprecated Will be removed in 2.0.0
*/
@FunctionalInterface
+ @Deprecated
interface Predicate {
/**
* The predicate to evaluate.
diff --git a/actor/src/main/scala/org/apache/pekko/actor/AbstractFSM.scala b/actor/src/main/scala/org/apache/pekko/actor/AbstractFSM.scala
index d9b63c6a3e..01eff922e8 100644
--- a/actor/src/main/scala/org/apache/pekko/actor/AbstractFSM.scala
+++ b/actor/src/main/scala/org/apache/pekko/actor/AbstractFSM.scala
@@ -18,6 +18,8 @@ import scala.concurrent.duration.FiniteDuration
import org.apache.pekko
import pekko.util.JavaDurationConverters._
+import scala.annotation.nowarn
+
/**
* Java API: compatible with lambda expressions
*/
@@ -39,6 +41,7 @@ object AbstractFSM {
*
* Finite State Machine actor abstract base class.
*/
+@nowarn("msg=deprecated")
abstract class AbstractFSM[S, D] extends FSM[S, D] {
import java.util.{ List => JList }
diff --git a/actor/src/main/scala/org/apache/pekko/japi/pf/CaseStatements.scala b/actor/src/main/scala/org/apache/pekko/japi/pf/CaseStatements.scala
index 511ff4db7c..5f0b9245d7 100644
--- a/actor/src/main/scala/org/apache/pekko/japi/pf/CaseStatements.scala
+++ b/actor/src/main/scala/org/apache/pekko/japi/pf/CaseStatements.scala
@@ -15,10 +15,13 @@ package org.apache.pekko.japi.pf
import FI.{ Apply, Predicate, UnitApply }
+import scala.annotation.nowarn
+
private[pf] object CaseStatement {
def empty[F, T](): PartialFunction[F, T] = PartialFunction.empty
}
+@nowarn("msg=deprecated")
private[pf] class CaseStatement[-F, +P, T](predicate: Predicate, apply: Apply[P, T]) extends PartialFunction[F, T] {
override def isDefinedAt(o: F) = predicate.defined(o)
@@ -26,6 +29,7 @@ private[pf] class CaseStatement[-F, +P, T](predicate: Predicate, apply: Apply[P,
override def apply(o: F) = apply.apply(o.asInstanceOf[P])
}
+@nowarn("msg=deprecated")
private[pf] class UnitCaseStatement[F, P](predicate: Predicate, apply: UnitApply[P]) extends PartialFunction[F, Unit] {
override def isDefinedAt(o: F) = predicate.defined(o)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pekko.apache.org
For additional commands, e-mail: commits-help@pekko.apache.org