Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes report includes unchanged properties, e.g. class file format #353

Open
banszelj opened this issue Dec 9, 2022 · 0 comments
Open

Comments

@banszelj
Copy link

banszelj commented Dec 9, 2022

When the library (0.17.1) generates list of (binary incompatible or all) changes, it lists also some unchanged properties,
like unchanged class file format or unchanged superclass.

I think unchanged properties should be skipped, in the same way as e.g. unchanged methods are skipped,
so that the problematic changes are highlighted.

Example

Old version:

package com.example;

public class Example {

    private Object value;
    
    public Example(Object value) {
	    this.value = value;
    }
    
    public Object getValue() {
	    return value;
    }

}

New version (new method + incompatible change of constructor):

package com.example;

public class Example {

    private Object value;
    
    public Example(int value) {
	    this.value = value;
    }
    
    public Object getValue() {
	    return value;
    }
    
    public void setValue(Object value) {
	    this.value = value;
    }

}

Reported binary incompatible changes using java -jar japicmp-0.17.1-jar-with-dependencies.jar -b -o example-old.jar -n example-new.jar:

Comparing binary compatibility of C:\Temp\example-new.jar against C:\Temp\example-old.jar
***! MODIFIED CLASS: PUBLIC com.example.Example  (not serializable)
		===  CLASS FILE FORMAT VERSION: 55.0 <- 55.0
		===  UNCHANGED SUPERCLASS: java.lang.Object (<- java.lang.Object)
		---! REMOVED CONSTRUCTOR: PUBLIC(-) Example(java.lang.Object)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant