siom79 / japicmp

Comparison of two versions of a jar archive
https://siom79.github.io/japicmp
Apache License 2.0
712 stars 107 forks source link

METHOD_ABSTRACT_ADDED_IN_IMPLEMENTED_INTERFACE false positive #321

Closed rreich closed 2 years ago

rreich commented 2 years ago

Adding a new class implementing java.util.function.UnaryOperator produces a METHOD_ABSTRACT_ADDED_IN_IMPLEMENTED_INTERFACE entry marking the change as source incompatible, which it isn't.

Create this class to reproduce:

package com.acme.japicmp;

import java.util.function.UnaryOperator;

public class NewOperator implements UnaryOperator<Object> {
  @Override
  public Object apply(Object o) {
    return null;
  }
}

Excerpt from html report (without markup):

NEW (*) public class com.acme.japicmp.NewOperator

Compatibility Changes:
Change
INTERFACE_ADDED
METHOD_ABSTRACT_ADDED_IN_IMPLEMENTED_INTERFACE

Interfaces:
Status  Interface   Compatibility Changes:
NEW java.util.function.Function n.a.
NEW java.util.function.UnaryOperator    n.a.

Constructors:
Status  Modifier    Constructor Exceptions  Compatibility Changes:  Line Number
NEW public  NewOperator()   n.a.    n.a.    
Old file    New file
n.a.    5

Methods:
Status  Modifier    Type    Method  Exceptions  Compatibility Changes:  Line Number
NEW public  java.lang.Object    apply(java.lang.Object) n.a.    
Change
METHOD_ADDED_TO_PUBLIC_CLASS    
Old file    New file
n.a.    8
siom79 commented 2 years ago

Thanks for the detailed report.

Fixed in 0.15.7