compiler.setVerifying(true); compiler.compile(); List<ErrorDetail> mvelErrors = parserContext.getErrorList(); if (mvelErrors != null) { for (Iterator<ErrorDetail> iterator = mvelErrors.iterator(); iterator.hasNext(); ) {
public CompiledExpression compile() { try { this.debugSymbols = pCtx.isDebugSymbols(); return _compile(); } finally { if (pCtx.isFatalError()) { StringAppender err = new StringAppender(); Iterator<ErrorDetail> iter = pCtx.getErrorList().iterator(); ErrorDetail e; while (iter.hasNext()) { e = iter.next(); e = ErrorUtil.rewriteIfNeeded(e, expr, cursor); if (e.getExpr() != expr) { iter.remove(); } else { err.append("\n - ").append("(").append(e.getLineNumber()).append(",").append(e.getColumn()).append(")") .append(" ").append(e.getMessage()); } } //noinspection ThrowFromFinallyBlock throw new CompileException("Failed to compileShared: " + pCtx.getErrorList().size() + " compilation error(s): " + err.toString(), pCtx.getErrorList(), expr, cursor, pCtx); } } }
public CompiledExpression compile() { try { this.debugSymbols = pCtx.isDebugSymbols(); return _compile(); } finally { if (pCtx.isFatalError()) { StringAppender err = new StringAppender(); Iterator<ErrorDetail> iter = pCtx.getErrorList().iterator(); ErrorDetail e; while (iter.hasNext()) { e = iter.next(); e = ErrorUtil.rewriteIfNeeded(e, expr, cursor); if (e.getExpr() != expr) { iter.remove(); } else { err.append("\n - ").append("(").append(e.getLineNumber()).append(",").append(e.getColumn()).append(")") .append(" ").append(e.getMessage()); } } //noinspection ThrowFromFinallyBlock throw new CompileException("Failed to compileShared: " + pCtx.getErrorList().size() + " compilation error(s): " + err.toString(), pCtx.getErrorList(), expr, cursor, pCtx); } } }
List<ErrorDetail> errors = pCtx.getErrorList().isEmpty() ? pCtx.getErrorList() : new ArrayList<ErrorDetail>(pCtx.getErrorList()); if (errors.size() < pCtx.getErrorList().size()) { for (ErrorDetail detail : pCtx.getErrorList()) { if (!errors.contains(detail)) { detail.setExpr(expr);
List<ErrorDetail> errors = pCtx.getErrorList().isEmpty() ? pCtx.getErrorList() : new ArrayList<ErrorDetail>(pCtx.getErrorList()); if (errors.size() < pCtx.getErrorList().size()) { for (ErrorDetail detail : pCtx.getErrorList()) { if (!errors.contains(detail)) { detail.setExpr(expr);
@Deprecated /** * @deprecated use {@link org.mvel2.MVEL#compileExpression(String, org.mvel2.ParserContext)} instead. * @param ctx * @return compile payload. */ public CompiledExpression compile(ParserContext ctx) { try { this.debugSymbols = (this.pCtx = ctx).isDebugSymbols(); newContext(ctx); return _compile(); } finally { //noinspection ThrowFromFinallyBlock removeContext(); if (pCtx.isFatalError()) { contextControl(REMOVE, null, null); StringAppender err = new StringAppender(); for (ErrorDetail e : pCtx.getErrorList()) { err.append("\n - ").append("(").append(e.getRow()).append(",").append(e.getCol()).append(")") .append(" ").append(e.getMessage()); } //noinspection ThrowFromFinallyBlock throw new CompileException("Failed to compile: " + pCtx.getErrorList().size() + " compilation error(s): " + err.toString(), pCtx.getErrorList()); } } }
compiler.setVerifying(true); compiler.compile(); List<ErrorDetail> mvelErrors = parserContext.getErrorList(); if (mvelErrors != null) { for (Iterator<ErrorDetail> iterator = mvelErrors.iterator(); iterator.hasNext(); ) {