Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.gmf.codegen/templates/xpt/providers/ValidationProvider.xpt')
-rwxr-xr-xplugins/org.eclipse.gmf.codegen/templates/xpt/providers/ValidationProvider.xpt10
1 files changed, 1 insertions, 9 deletions
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/providers/ValidationProvider.xpt b/plugins/org.eclipse.gmf.codegen/templates/xpt/providers/ValidationProvider.xpt
index 0272747e6..78d48a337 100755
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/providers/ValidationProvider.xpt
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/providers/ValidationProvider.xpt
@@ -234,11 +234,6 @@ static boolean isInDefaultEditorContext(Object object) {
«EXPAND xpt::Common::generatedMemberComment»
public static class «getConstraintAdapterLocalClassName()» extends org.eclipse.emf.validation.AbstractModelConstraint {
-«IF rule.provider.getLanguage() <> gmfgen::GenLanguage::java-»
- «EXPAND xpt::Common::generatedMemberComment»
- private «container.getAbstractExpressionQualifiedClassName()» expression;
-
-«ENDIF-»
«EXPAND xpt::Common::generatedMemberComment»
public org.eclipse.core.runtime.IStatus validate(org.eclipse.emf.validation.IValidationContext ctx) {
«EXPAND constraintAdapter_initContext(self) FOR target-»
@@ -262,10 +257,7 @@ static boolean isInDefaultEditorContext(Object object) {
«DEFINE constraintAdapter_validateMethod(audit : gmfgen::GenAuditRule) FOR gmfgen::GenExpressionProviderBase»«ERROR 'No idea how to evaluate an audit rule for ' + self.repr()»«ENDDEFINE»
«DEFINE constraintAdapter_validateMethod(audit : gmfgen::GenAuditRule) FOR gmfgen::GenExpressionInterpreter-»
- if (expression == null) {
- expression = «EXPAND xpt::expressions::getExpression::getExpression(audit.rule, audit.target.getContext())»;
- }
- Object result = expression.evaluate(context);
+ Object result = «EXPAND xpt::expressions::getExpression::getExpression(audit.rule, audit.target.getContext())».evaluate(context);
if (result instanceof Boolean && ((Boolean) result).booleanValue()) {
return org.eclipse.core.runtime.Status.OK_STATUS;«REM»XXX why not ctx.createSuccessStatus()???«ENDREM»
}

Back to the top