I'm writing a equals(Object obj)
function for a class. I see that it is possible to access the private fields of obj
from the caller. So instead of using a getter:
Odp other = (Odp) obj;
if (! other.getCollection().contains(ftw)) {
}
I can just access the field directly:
Odp other = (Odp) obj;
if (! other.collection.contains(ftw)) {
}
Is this bad practice?