private boolean enforceDecpRule3_visibilityChanges(BcelClassWeaver weaver, ResolvedType newParent, ResolvedMember superMethod,
LazyMethodGen subMethod) {
boolean cont = true;
- if (superMethod.isPublic()) {
+ if (Modifier.isPublic(superMethod.getModifiers())) {
if (subMethod.isProtected() || subMethod.isDefault() || subMethod.isPrivate()) {
weaver.getWorld().getMessageHandler().handleMessage(
MessageUtil.error("Cannot reduce the visibility of the inherited method '" + superMethod + "' from "
+ newParent.getName(), superMethod.getSourceLocation()));
cont = false;
}
- } else if (superMethod.isProtected()) {
+ } else if (Modifier.isProtected(superMethod.getModifiers())) {
if (subMethod.isDefault() || subMethod.isPrivate()) {
weaver.getWorld().getMessageHandler().handleMessage(
MessageUtil.error("Cannot reduce the visibility of the inherited method '" + superMethod + "' from "
// look for the method there
for (Iterator<ResolvedMember> iterator = appearsDeclaredBy.getMethods(true, true); iterator.hasNext();) {
ResolvedMember method = iterator.next();
- if (method.isStatic()) {
+ if (Modifier.isStatic(method.getModifiers())) {
if (name.equals(method.getName()) && signature.equals(method.getSignature())) {
// we found it
declaringType = method.getDeclaringType();
ResolvedMember[] fields = type.getDeclaredFields();
for (int i = 0; i < fields.length; i++) {
ResolvedMember field = fields[i];
- if (field.getName().equals("serialVersionUID") && field.isStatic() && field.getType().equals(ResolvedType.LONG)) {
+ if (field.getName().equals("serialVersionUID") && Modifier.isStatic(field.getModifiers()) && field.getType().equals(ResolvedType.LONG)) {
return true;
}
}
public static Instruction createSet(InstructionFactory fact, Member signature) {
short kind;
- if (signature.isStatic()) {
+ if (Modifier.isStatic(signature.getModifiers())) {
kind = Constants.PUTSTATIC;
} else {
kind = Constants.PUTFIELD;