You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you for example call copy on a ClassName, you get TypeName returned.
The copy with tags parameter is overridden in the subclasses and returns the respective subclass.
But the copy without tags parameter always returns TypeName.
It would be nice if TypeName could get a type parameter that the subclass sets to itself and then both copy functions return the actual subclass.
The text was updated successfully, but these errors were encountered:
Are you sure it breaks binary backwards compatibility?
I remember a similar case where in the JVM stdlib ByteBuffer.flip was changed to be overwritten and return ByteBuffer in Java 9 when before it was inherited from the superclass and thus returned Buffer.
If you now compile ByteBuffer.allocate(2).flip(); with Java 8 it runs on Java 8 and Java 11.
If you instead compile with Java 11 (with source and target set to 8), it runs on Java 11 but throws java.lang.NoSuchMethodError: java.nio.ByteBuffer.flip()Ljava/nio/ByteBuffer; on Java 8.
Derived from that, I'd say it is a backwards compatible change but not a forward compatible one.
So as long you do not support compiling against 1.19.0 while running against 1.18.1, I'd say it should be fine.
This should of course be tested, and I'm not in a rush as I have a work-around.
Just wanted to mention that I think this might not be breaking.
Not more than adding a new method for example.
If you for example call
copy
on aClassName
, you getTypeName
returned.The
copy
withtags
parameter is overridden in the subclasses and returns the respective subclass.But the
copy
withouttags
parameter always returnsTypeName
.It would be nice if
TypeName
could get a type parameter that the subclass sets to itself and then bothcopy
functions return the actual subclass.The text was updated successfully, but these errors were encountered: