[BUILD-439] Binary compatibility check fails on abstract method addition in new parent class Created: 24/Feb/21  Updated: 12/Mar/21

Status: Accepted
Project: Build
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Roman Kovařík Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Date of First Response:

 Description   

Steps to reproduce

Original code:

public class LinkField<T> extends CustomField<T> { 

New code:

public abstract class AbstractLinkField<T, P> extends CustomField<T> {
    public abstract Optional<P> getSelectedItem();
}

public class LinkField<T> extends AbstractLinkField<T, T> {
    @Override
    public Optional<T> getSelectedItem() {
        return getOptionalValue();
    }
}

Expected results

Is this false negative, can we configure the check to accept this?
Anyway, this ticket at least for the record. 

Actual results

WARNING: Incompatibility detected: Requires semantic version level	 MINOR: JApiSuperclass [jApiClass=JApiClass [fullyQualifiedName=info.magnolia.ui.field.LinkField, changeStatus=MODIFIED, compatibilityChanges=[METHOD_ABSTRACT_ADDED_IN_IMPLEMENTED_INTERFACE]], oldSuperclass=com.vaadin.ui.CustomField, newSuperclass=info.magnolia.ui.field.AbstractLinkField, changeStatus=MODIFIED, compatibilityChanges=[SUPERCLASS_ADDED]]
Feb 24, 2021 10:57:02 AM japicmp.output.incompatible.IncompatibleErrorOutput warn
WARNING: Incompatibility detected: Requires semantic version level	 MINOR: JApiClass [fullyQualifiedName=info.magnolia.ui.field.LinkField, changeStatus=MODIFIED, compatibilityChanges=[METHOD_ABSTRACT_ADDED_IN_IMPLEMENTED_INTERFACE]]

Workaround

Exclude class in the compatibility check.

Development notes



 Comments   
Comment by Mikaël Geljić [ 12/Mar/21 ]

Indeed, the JLS seems ok with that (Section 13.4.4). Worth looking up why japicmp considers that worth a warning.

Generated at Sun Feb 11 23:41:55 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.