boolean allProtected = true;
for (final Iterator jit = set.iterator(); jit.hasNext();) {
final IJavaElement elem = (IJavaElement) jit.next();
if (elem.getElementType() == IJavaElement.FIELD) {
final IField field = (IField) elem;
final Object constValue = field.getConstant();
if (constValue != null) {
allPublic &= Flags.isPublic(field.getFlags());
allPrivate &= Flags.isPrivate(field.getFlags());
allProtected &= Flags.isProtected(field.getFlags());
allPackage &= Flags.isPackageDefault(field.getFlags());
}
}
}
if (!(allPublic || allPrivate || allPackage || allProtected))
ret.remove(set);