diff options
author | acolyer <acolyer> | 2005-09-12 20:17:18 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2005-09-12 20:17:18 +0000 |
commit | 056db42f1697ed27a47e04759bfb8162acd92590 (patch) | |
tree | 3dc54476bd1499898f669af72162f03df065e90b /tests/bugs150/SimpleInsuranceFailure/model/validation/BusinessRulesValidation.aj | |
parent | 776613eebf410baacd178bf73f3de0783f5df98f (diff) | |
download | aspectj-056db42f1697ed27a47e04759bfb8162acd92590.tar.gz aspectj-056db42f1697ed27a47e04759bfb8162acd92590.zip |
tests and a fix for the bug with no name, in which Pooh gets carried away and tries to create raw types all the time, but Christopher Robin kindly explains that raw types should only be created in -1.5 mode.
Diffstat (limited to 'tests/bugs150/SimpleInsuranceFailure/model/validation/BusinessRulesValidation.aj')
-rw-r--r-- | tests/bugs150/SimpleInsuranceFailure/model/validation/BusinessRulesValidation.aj | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/bugs150/SimpleInsuranceFailure/model/validation/BusinessRulesValidation.aj b/tests/bugs150/SimpleInsuranceFailure/model/validation/BusinessRulesValidation.aj new file mode 100644 index 000000000..b733b110a --- /dev/null +++ b/tests/bugs150/SimpleInsuranceFailure/model/validation/BusinessRulesValidation.aj @@ -0,0 +1,29 @@ +package insurance.model.validation; + +import java.util.*; +import insurance.model.*; + +public aspect BusinessRulesValidation { + + private Map validatorsByType = new HashMap(); + + // RequiresValidation interface + + public interface RequiresValidation {} + + public List RequiresValidation.getValidationErrors() { + if (this.validationErrors == null) { + this.validationErrors = new ArrayList(); + } + return validationErrors; + } + + private List RequiresValidation.validationErrors; + + // Triggering validation + void foo(RequiresValidation domainObject) { + throw new SIValidationException( + domainObject, domainObject.getValidationErrors()); + } + +} |