Skip to content
Snippets Groups Projects
Commit 9a60f474 authored by Vincent Aravantinos's avatar Vincent Aravantinos
Browse files

improves handling of checksum in case a verification triggers itself falsly

refs 2553
parent c676b75a
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment