Skip to content

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

@banszelj

Description

@banszelj

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions