This PR adds support for indexing impact of changes on fields on downstream dependencies. Prior to this PR, Annotator might make a field @Nullable that can trigger errors on downstream dependencies, with this PR, Annotator is aware of these impacts and if changes on fields, create an unresolvable error on downstream dependencies, the containing fix tree is rejected.
See example below:
On Target
public class Foo {
public Object f0;
public Object f1;
public Object f2 = new Object();
}
On Dependency (Dep)
package test.depa;
import test.target.Foo;
public class Dep {
public void directAccess(Foo foo){
// making f0 will create an unresolvable error here.
foo.f0.toString();
}
public void flowF1BackToF2(Foo foo) {
// If f1 is annotated as @Nullable, the corresponding error on f2 can be resolved on target.
foo.f2 = foo.f1;
}
}
Prior to this PR, Annotator would have made f0@Nullable even thought it causes an unresolvable error in Dep module. With this PR,
Annotator is aware of this impact and will avoid making f0@Nullable
Annotator is aware that the triggered error by making f1@Nullable is resolvable by making f2@Nullable, therefore it includes the corresponding fix (f2) in any tree containing f1.
This PR adds support for indexing impact of changes on fields on downstream dependencies. Prior to this PR, Annotator might make a field
@Nullable
that can trigger errors on downstream dependencies, with this PR, Annotator is aware of these impacts and if changes on fields, create an unresolvable error on downstream dependencies, the containing fix tree is rejected.See example below:
On Target
On Dependency (Dep)
Prior to this PR, Annotator would have made
f0
@Nullable
even thought it causes an unresolvable error inDep
module. With this PR,f0
@Nullable
f1
@Nullable
is resolvable by makingf2
@Nullable
, therefore it includes the corresponding fix (f2
) in any tree containingf1
.