ProtocolLib

3M Downloads

Fix backward compatibility of StructureModifier.withType

osipxd opened this issue ยท 2 comments

commented

Describe the bug
Signature of method withType has been changed:

public <T> StructureModifier<T> withType(Class fieldType, EquivalentConverter<T> converter) {

public <T> StructureModifier<T> withType(Class fieldType, EquivalentConverter<T> converter, Class... paramTypes) {

Now I get:

java.lang.NoSuchMethodError: com.comphenix.protocol.reflect.StructureModifier.withType(Ljava/lang/Class;Lcom/comphenix/protocol/reflect/EquivalentConverter;)Lcom/comphenix/protocol/reflect/StructureModifier;

Sure I can recompile my plugin but then it will not work with older versions of ProtocolLib.
Can you provide a method with the old signature for compatibility?

Version Info
b474+

commented

Shoot. I thought that might happen, but I hoped Java would just gloss over the varargs there.

I'll add the old signature back tomorrow.

commented

There is a nice tool to prevent such cases:
https://lvc.github.io/japi-compliance-checker/