Maracas Analyzing the impact of libraries evolution

Field Removed

A field is removed from its owning class.


Example

The field name is removed from the class Person in the library project.

public class Person {
-  public String name;

}

Broken Uses

Hereafter, we list the broken uses that are currently detected by Maracas.


1. Read accesses of the now-removed field

Example

The method displayPerson()—defined in the PeopleInfo class in a client project—accesses the name field. Then, a broken use is reported pointing to the field access expression.

public class PeopleInfo {
  public void displayPerson(Person person) {
    // Broken use reported here
    String personName = person.name;
    System.out.println(personName);
  }

}

2. Write accesses of the now-removed field

Example

The method addLastname()—defined in the PeopleInfo class in a client project—accesses the name field. Then, a broken use is reported pointing to the field access expression.

public class PeopleInfo {
  public void addLastname(Person person, String lastname) {
    // Broken use reported here
    person.name += " " + lastname;
  }

}