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; ...@@ -43,7 +43,7 @@ import org.fortiss.tooling.kernel.utils.LoggingUtils;
* @author aravantinos * @author aravantinos
* @author $Author$ * @author $Author$
* @version $Rev$ * @version $Rev$
* @ConQAT.Rating YELLOW Hash: 3B0A06C0FED81082CCDD8AC5F8C593B1 * @ConQAT.Rating YELLOW Hash: 7BEACA97ADA94E9730616EAB079DED86
*/ */
public final class ConstraintVerificationService extends public final class ConstraintVerificationService extends
EObjectAwareServiceBase<IConstraintVerifier<IConstraint>> implements EObjectAwareServiceBase<IConstraintVerifier<IConstraint>> implements
...@@ -95,9 +95,12 @@ public final class ConstraintVerificationService extends ...@@ -95,9 +95,12 @@ public final class ConstraintVerificationService extends
modelContext.runAsCommand(new Runnable() { modelContext.runAsCommand(new Runnable() {
@Override @Override
public void run() { public void run() {
// We update the checksums before verification to avoid detecting some fake
// changes during the verification.
updateChecksums(constraint);
verifier.verify(constraint); verifier.verify(constraint);
// Updating checksums must be done *after* verification because the verification // And we also update the checksums after in case the verification had some side
// can have side effects. // effects...
updateChecksums(constraint); updateChecksums(constraint);
constraint.getVerificationStatus().setConstraint(constraint); constraint.getVerificationStatus().setConstraint(constraint);
} }
...@@ -118,11 +121,7 @@ public final class ConstraintVerificationService extends ...@@ -118,11 +121,7 @@ public final class ConstraintVerificationService extends
return fixes != null ? fixes : new ArrayList<IFix>(); return fixes != null ? fixes : new ArrayList<IFix>();
} }
/** /** {@inheritDoc} */
* @param constraint
* @return <code>true</code> if <code>constraint</code> is up to date, <code>false</code>
* otherwise.
*/
@Override @Override
public boolean isUpToDate(IConstraint constraint) { public boolean isUpToDate(IConstraint constraint) {
for(ConstrainedWithChecksum cwc : constraint.getConstrainedsWithChecksum()) { for(ConstrainedWithChecksum cwc : constraint.getConstrainedsWithChecksum()) {
...@@ -154,8 +153,9 @@ public final class ConstraintVerificationService extends ...@@ -154,8 +153,9 @@ public final class ConstraintVerificationService extends
} }
/** /**
* Flag to print the object which is actually checksummed in a file. * Flag to print objects which are actually checksummed in various files.
* TODO: remove when the experimental phase for constraints is over. * 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; 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