You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by gp...@apache.org on 2009/11/17 19:09:01 UTC
svn commit: r881421 -
/myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/AbstractCompareStrategy.java
Author: gpetracek
Date: Tue Nov 17 18:09:01 2009
New Revision: 881421
URL: http://svn.apache.org/viewvc?rev=881421&view=rev
Log:
cleanup
Modified:
myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/AbstractCompareStrategy.java
Modified: myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/AbstractCompareStrategy.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/AbstractCompareStrategy.java?rev=881421&r1=881420&r2=881421&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/AbstractCompareStrategy.java (original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/AbstractCompareStrategy.java Tue Nov 17 18:09:01 2009
@@ -158,9 +158,12 @@
{
ValidatorException validatorException = new ValidatorException(message);
+ boolean isSourceMetaDataUsed = false;
+
if(entryOfTarget.getMetaDataEntry() == null)
{
- entryOfTarget.setMetaDataEntry(entryOfSource.getMetaDataEntry());
+ prepareTargetMetaDataForSeverityAwareInterception(entryOfSource, entryOfTarget);
+ isSourceMetaDataUsed = true;
}
if(ExtValUtils.executeAfterThrowingInterceptors(
@@ -170,9 +173,25 @@
ExtValUtils.tryToAddViolationMessageForComponentId(entryOfTarget.getClientId(),
ExtValUtils.convertFacesMessage(validatorException.getFacesMessage()));
}
+
+ if(isSourceMetaDataUsed)
+ {
+ resetTargetMetaData(entryOfTarget);
+ }
}
}
+ private void prepareTargetMetaDataForSeverityAwareInterception(
+ CrossValidationStorageEntry entryOfSource, CrossValidationStorageEntry entryOfTarget)
+ {
+ entryOfTarget.setMetaDataEntry(entryOfSource.getMetaDataEntry());
+ }
+
+ private void resetTargetMetaData(CrossValidationStorageEntry entryOfTarget)
+ {
+ entryOfTarget.setMetaDataEntry(null);
+ }
+
@SuppressWarnings({"ThrowableInstanceNeverThrown"})
private void processTargetComponentAsSourceComponentAfterViolation(CrossValidationStorageEntry entryOfSource)
{