public Object evaluate(final XExpression expression, final JvmTypeReference expectedType) { try { final Object result = this.interpreter.evaluate(expression, expectedType); return this.translate(result); } catch (final Throwable _t) { if (_t instanceof ConstantExpressionEvaluationException) { final ConstantExpressionEvaluationException e = (ConstantExpressionEvaluationException)_t; String _message = e.getMessage(); final EObjectDiagnosticImpl error = new EObjectDiagnosticImpl(Severity.ERROR, "constant_expression_evaluation_problem", _message, expression, null, (-1), null); expression.eResource().getErrors().add(error); return null; } else { throw Exceptions.sneakyThrow(_t); } } }
public String apply() { StringConcatenation _builder = new StringConcatenation(); _builder.append("Error during call to "); String _simpleName = field.getSimpleName(); _builder.append(_simpleName); _builder.append(" : "); String _message = cause.getMessage(); _builder.append(_message); return _builder.toString(); } }.apply(), expression, cause);
@Override public Object getValue(final String property) { try { final JvmOperation op = this.findOperation(property); final Function1<JvmAnnotationValue, Boolean> _function = (JvmAnnotationValue it) -> { return Boolean.valueOf((Objects.equal(it.getOperation(), op) || ((it.getOperation() == null) && Objects.equal(op.getSimpleName(), "value")))); }; final JvmAnnotationValue annotationValue = IterableExtensions.<JvmAnnotationValue>findFirst(this.getDelegate().getValues(), _function); final boolean isArrayType = ((op != null) && this.getCompilationUnit().getTypeReferences().isArray(op.getReturnType())); if ((annotationValue != null)) { return this.getCompilationUnit().translateAnnotationValue(annotationValue, isArrayType); } } catch (final Throwable _t) { if (_t instanceof ConstantExpressionEvaluationException) { final ConstantExpressionEvaluationException e = (ConstantExpressionEvaluationException)_t; this.getCompilationUnit().getProblemSupport().addError(this, e.getMessage()); } else { throw Exceptions.sneakyThrow(_t); } } return null; }