Hi!
I am wondering if this code is a bug or can be optimized (Hibernate 3.6.8.Final):
Code:
public final class EntityEntry implements Serializable {
public boolean requiresDirtyCheck(Object entity) {
return isModifiableEntity() && (getPersister().hasMutableProperties() || !FieldInterceptionHelper.isInstrumented(entity) || FieldInterceptionHelper.extractFieldInterceptor(entity).isDirty());
}
If my entity is modifiable and not mutable and instrumentized, then I want to return the result of isDirty().
I would expected something like:
Code:
public boolean requiresDirtyCheck(Object entity) {
if (!isModifiableEntity() || !getPersister().hasMutableProperties()) {
return false;
}
if (FieldInterceptionHelper.isInstrumented(entity) && !FieldInterceptionHelper.extractFieldInterceptor(entity).isDirty()) {
return false;
}
return true;
}
Can someone give me a reason for the original implementation or is it a bug?