diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ConstraintVerificationService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ConstraintVerificationService.java index 85829320f37a0a39ff4693224b22ec5d8ec92f5c..a9f84a4386c51ba4b3e94e85f97880bdb5afba3b 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ConstraintVerificationService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ConstraintVerificationService.java @@ -43,7 +43,7 @@ import org.fortiss.tooling.kernel.utils.LoggingUtils; * @author aravantinos * @author $Author$ * @version $Rev$ - * @ConQAT.Rating YELLOW Hash: 3B0A06C0FED81082CCDD8AC5F8C593B1 + * @ConQAT.Rating YELLOW Hash: 7BEACA97ADA94E9730616EAB079DED86 */ public final class ConstraintVerificationService extends EObjectAwareServiceBase<IConstraintVerifier<IConstraint>> implements @@ -95,9 +95,12 @@ public final class ConstraintVerificationService extends modelContext.runAsCommand(new Runnable() { @Override public void run() { + // We update the checksums before verification to avoid detecting some fake + // changes during the verification. + updateChecksums(constraint); verifier.verify(constraint); - // Updating checksums must be done *after* verification because the verification - // can have side effects. + // And we also update the checksums after in case the verification had some side + // effects... updateChecksums(constraint); constraint.getVerificationStatus().setConstraint(constraint); } @@ -118,11 +121,7 @@ public final class ConstraintVerificationService extends return fixes != null ? fixes : new ArrayList<IFix>(); } - /** - * @param constraint - * @return <code>true</code> if <code>constraint</code> is up to date, <code>false</code> - * otherwise. - */ + /** {@inheritDoc} */ @Override public boolean isUpToDate(IConstraint constraint) { for(ConstrainedWithChecksum cwc : constraint.getConstrainedsWithChecksum()) { @@ -154,8 +153,9 @@ public final class ConstraintVerificationService extends } /** - * Flag to print the object which is actually checksummed in a file. - * TODO: remove when the experimental phase for constraints is over. + * Flag to print objects which are actually checksummed in various files. + * This is useful since it is essential to control very precisely how checksums are computed. + * Should however only be set to <code>true</code> on a local machine, not commited! */ private final boolean DEBUG = false;