Difference (final Proto past) { int diff = Difference.NONE; if (past.access != access) { diff |= Difference.ACCESS; } if (past.signature != signature) { diff |= Difference.SIGNATURE; } final Difference.Specifier<TypeRepr.ClassType, Difference> ann = Difference.make(past.annotations, annotations); if (!ann.unchanged()) { diff |= Difference.ANNOTATIONS; } final int base = diff; return new Difference() { @Override public int base() { return base; } @Override public boolean no() { return base == NONE; } @Override public int addedModifiers() { return ~past.access & access; } @Override public int removedModifiers() { return ~access & past.access; } @Override public boolean packageLocalOn() { return !past.isPackageLocal() && Proto.this.isPackageLocal(); } @Override public boolean hadValue() { return false; } @Override public boolean accessRestricted() { return Difference.weakerAccess(access, past.access); } @Override public boolean accessExpanded() { return Difference.weakerAccess(past.access, access); } @Override public Specifier<TypeRepr.ClassType, Difference> annotations() { return ann; } }; }