The aim of below code is to change the visibility of a filed to package:
public void transform(){
super.transform();
VisibilityModifier visMod=fd.getVisibilityModifier();
if (visMod instanceof Private)
detach(visMod)
}
While the code changes visibility of fd to package. However, it also shifts field one line up. As an example see “firstName” in below example:
Input:
Public class Person{
//comment
private String firstName;
}
Output:
public class Person{
//comment String firstName;
}
It creates a compiler error if firstName is referenced in the program.