mdedetrich commented on code in PR #857:
URL: https://github.com/apache/incubator-pekko/pull/857#discussion_r1435541494


##########
actor/src/main/mima-filters/1.1.0.backwards.excludes/option-converters.excludes 
:
##########
@@ -0,0 +1,30 @@
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOption.toJava$extension")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOption.toJavaPrimitive$extension")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOption.toJava")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOption.toJavaPrimitive")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOption.toJava$extension")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOption.toJavaPrimitive$extension")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptional.toJavaPrimitive$extension")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptional.toScala$extension")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptional.toScala")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptional.toJavaPrimitive")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptional.toScala$extension")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptional.toJavaPrimitive$extension")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptionalDouble.toJavaGeneric$extension")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptionalDouble.toScala$extension")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptionalDouble.toScala")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptionalDouble.toJavaGeneric")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptionalDouble.toScala$extension")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptionalDouble.toJavaGeneric$extension")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptionalInt.toJavaGeneric$extension")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptionalInt.toScala$extension")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptionalInt.toScala")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptionalInt.toJavaGeneric")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptionalInt.toScala$extension")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptionalInt.toJavaGeneric$extension")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptionalLong.toJavaGeneric$extension")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptionalLong.toScala$extension")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptionalLong.toScala")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptionalLong.toJavaGeneric")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptionalLong.toScala$extension")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptionalLong.toJavaGeneric$extension")

Review Comment:
   It will still have no effect, quoting from original post and bolding the 
relevant part
   
   >  
`OptionConverters`/`FutureConverters`/`FunctionConverters`/`PartialFunction` 
the `@inline` annotation has been kept in place and for Scala 3 specifically 
the `inline` keyword is used (which achieves the same effect).
     * This is because there is no reason **NOT** to inline these functions as 
they are just delegation wrappers
     * All this code will be dropped when Scala 2.12 support is removed anyways
   * The general idea is that once this is merged into Pekko 1.1.x series we 
can start enabling the inliner in the other Pekko modules. Of particular 
import, aside from the standard inline settings would be adding
     ```scala
     Seq(
       "-opt-inline-from:org.apache.pekko.util.OptionConverters**",
       "-opt-inline-from:org.apache.pekko.util.FutureConverters**",
       "-opt-inline-from:org.apache.pekko.util.FunctionConverters**",
       "-opt-inline-from:org.apache.pekko.util.PartialFunction**"
     )
     ```
     To the other Pekko modules in the 1.1.x series for Scala 2 inliner 
settings (with Scala 3 this is not necessary). What this 
     will essentially do is that for Scala 2.12 any calls to the converters 
(i.e. lets say `org.apache.pekko.util.OptionConverters.toScala`) will directly 
call the method from 
[scala-collection-compat](https://github.com/scala/scala-collection-compat) and 
for Scala 2.13+ it will directly call the Scala stdlib version. This means that 
aside from a possible performance improvement, when Scala 2.12 support is 
dropped there won't be any difference in bytecode because `@inline final def 
toScala[A](o: Optional[A]): Option[A] = 
scala.jdk.javaapi.OptionConverters.toScala(o)`/`inline final def toScala[A](o: 
Optional[A]): Option[A] = scala.jdk.javaapi.OptionConverters.toScala(o)` will 
be inlined away.
     * **It may be that for the Pekko module 1.1.x series they will have to 
build against Pekko core 1.1.x because while the `@inline` annotations existed 
in Pekko 1.0.x, the `inline` keyword for Scala 3 in various places was only 
added in Scala 3. This however shouldn't cause any issues because a Pekko 
module built against Pekko core 1.1.x would inline all relevant code, so even 
if a Pekko core 1.0.x is linked at runtime in a Pekko 1.1.x module, all it 
means is that the Pekko 1.0.x will bring in some unused code.**
     * This is considered safe because all of this converter code won't be 
changed and is considered entirely stable and when Scala 2.12 is dropped its 
just going to be calling the exact same method from stdlib anyways.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to