package sandbox.changeset; import java.util.EnumSet; /** How to handle a strict rename. I.e. a field/method is renamed, * but type, signature and semantics have not changed. * In addition all invocations have been appropriately renamed. * Best solution would probably be to either: * 1) preprocess the new classfiles to undo/hide the rename, OR * 2) preprocess the old classfiles/coverage info to reflect the new name. * * In addition, we need to somehow detect a renaming. */ public enum Status { SAME, OLD, NEW, CHANGED; public static Status valueOfToUpper(String s){ return valueOf(s.toUpperCase()); } public static Status[] defaultOrder(){ return new Status[]{SAME,OLD,NEW,CHANGED}; } public static EnumSet set(Status... includes){ EnumSet ret = EnumSet.noneOf(Status.class); for(Status s : includes) ret.add(s); return ret; } public static EnumSet setExcl(Status... excludes){ return EnumSet.complementOf(set(excludes)); } }