codeshovel icon indicating copy to clipboard operation
codeshovel copied to clipboard

Annotation Arguments Change

Open braxtonhall opened this issue 4 years ago • 1 comments

At the moment any change to an annotation is just seen as a Yannotationchange, but to get a finer grained look, we could introduce a Yannotationargumentschange for when an argument to a parameterized annotation changes.

This may require changing Yannotationchange to hold onto a list of Yannotations that each have their own arguments instead of just a single string.

Example from @ishtiaque05

@JsonSerializable
public class Person {
    @JsonElement
    private String firstName;
    @JsonElement
    private String lastName;
    @JsonElement(key = "personAge")
    private String age;
    private String address;
    @Init
    private void initNames() {
        this.firstName = this.firstName.substring(0, 1).toUpperCase() 
          + this.firstName.substring(1);
        this.lastName = this.lastName.substring(0, 1).toUpperCase() 
          + this.lastName.substring(1);
    }
    // Standard getters and setters
}

In this example, "personAge" may change. This change would be kept as an Yannotationargschange

braxtonhall avatar Feb 19 '21 01:02 braxtonhall

Also an example from one of our own test cases: https://github.com/apache/flink/commit/6ba5fcdf85f802748fd47218ce8c41a617d224c9

braxtonhall avatar Feb 19 '21 01:02 braxtonhall