Assertion which generate an exception if expression is not true.

@param expression
the expression
@param messageFormat
the message format
@param args
the args
776438
public static void assertTrue(boolean expression, String messageFormat, Object... args) {
		if (!expression)
			throw (new KriptonProcessorException(String.format(messageFormat, args)));

	}
322936
@Override
    public void debug(String format, Object arg) {
        if (logger.isDebugEnabled()) {
            FormattingTuple ft = MessageFormatter.format(format, arg);
            logger.debug(ft.getMessage(), ft.getThrowable());
        }
    }
787577
public static void warnFormatted(final Exception exception) {
        logWriterInstance.warn(exception);

        UaiWebSocketLogManager.addLogText("[WARN] An exception just happened: " + exception.getMessage());
    }
708367
protected void buildExpression(String expression) throws ParseException {
        expressionParsed = true;

        try {

            if (seconds == null) {
                seconds = new TreeSet<Integer>();
            }
            if (minutes == null) {
                minutes = new TreeSet<Integer>();
            }
            if (hours == null) {
                hours = new TreeSet<Integer>();
            }
            if (daysOfMonth == null) {
                daysOfMonth = new TreeSet<Integer>();
            }
            if (months == null) {
                months = new TreeSet<Integer>();
            }
            if (daysOfWeek == null) {
                daysOfWeek = new TreeSet<Integer>();
            }
            if (years == null) {
                years = new TreeSet<Integer>();
            }

            int exprOn = SECOND;

            StringTokenizer exprsTok = new StringTokenizer(expression, " \t",
                    false);

            while (exprsTok.hasMoreTokens() && exprOn <= YEAR) {
                String expr = exprsTok.nextToken().trim();

                // throw an exception if L is used with other days of the month
                if(exprOn == DAY_OF_MONTH && expr.indexOf('L') != -1 && expr.length() > 1 && expr.indexOf(",") >= 0) {
                    throw new ParseException("Support for specifying 'L' and 'LW' with other days of the month is not implemented", -1);
                }
                // throw an exception if L is used with other days of the week
                if(exprOn == DAY_OF_WEEK && expr.indexOf('L') != -1 && expr.length() > 1  && expr.indexOf(",") >= 0) {
                    throw new ParseException("Support for specifying 'L' with other days of the week is not implemented", -1);
                }
                if(exprOn == DAY_OF_WEEK && expr.indexOf('#') != -1 && expr.indexOf('#', expr.indexOf('#') +1) != -1) {
                    throw new ParseException("Support for specifying multiple \"nth\" days is not imlemented.", -1);
                }
                
                StringTokenizer vTok = new StringTokenizer(expr, ",");
                while (vTok.hasMoreTokens()) {
                    String v = vTok.nextToken();
                    storeExpressionVals(0, v, exprOn);
                }

                exprOn++;
            }

            if (exprOn <= DAY_OF_WEEK) {
                throw new ParseException("Unexpected end of expression.",
                            expression.length());
            }

            if (exprOn <= YEAR) {
                storeExpressionVals(0, "*", YEAR);
            }

            TreeSet<Integer> dow = getSet(DAY_OF_WEEK);
            TreeSet<Integer> dom = getSet(DAY_OF_MONTH);

            // Copying the logic from the UnsupportedOperationException below
            boolean dayOfMSpec = !dom.contains(NO_SPEC);
            boolean dayOfWSpec = !dow.contains(NO_SPEC);

            if (dayOfMSpec && !dayOfWSpec) { 
                // skip
            } else if (dayOfWSpec && !dayOfMSpec) { 
                // skip
            } else {
                throw new ParseException(
                        "Support for specifying both a day-of-week AND a day-of-month parameter is not implemented.", 0);
            }
        } catch (ParseException pe) {
            throw pe;
        } catch (Exception e) {
            throw new ParseException("Illegal cron expression format ("
                    + e.toString() + ")", 0);
        }
    }
1278699
@Nonnull
  public static Value evalExpression(@Nonnull final String expression, @Nonnull final PreprocessorContext context) {
    try {
      final ExpressionTree tree = ExpressionParser.getInstance().parse(expression, context);
      return evalTree(tree, context);
    } catch (IOException unexpected) {
      throw context.makeException("[Expression]Wrong expression format detected [" + expression + ']', unexpected);
    }
  }
844169
@SuppressWarnings("checkstyle:regexp")
	public static void showError(String message, Throwable exception) {
		try (PrintWriter logger = new PrintWriter(getConsoleLogger())) {
			if (message != null && !message.isEmpty()) {
				logger.println(message);
			} else if (exception != null) {
				exception.printStackTrace(logger);
			}
			logger.println();
			logger.flush();
			showHelp(logger, false);
			showVersion(true);
		}
	}
605211
public static void isFalse(Boolean expression) {
		if(!validation) return;
		notNull(expression);
		if(expression)
			throw new ParameterException(ErrorCode.CONSTRAINT);
	}
1005438
public static String formatException(final Exception e) {
    final StringBuilder sb = new StringBuilder();
    Throwable t = e;
    while (t != null) {
      sb.append(t.getMessage()).append("\n");
      t = t.getCause();
    }
    return sb.toString();
  }
94375
static void checkArgument(boolean check, String msg, Object... args) {
    if (!check) {
      throw new IllegalArgumentException(String.format(msg, args));
    }
  }
299471
public static String formatException(Throwable exception) {
		StringBuilder buffer = new StringBuilder();

		formatException(exception, buffer);

		return buffer.toString();
	}
1297692
public void debug( String format, Object arg )
    {
        if( m_delegate.isDebugEnabled() )
        {
            FormattingTuple tuple = MessageFormatter.format( format, arg );
            m_delegate.debug( tuple.getMessage(), tuple.getThrowable() );
        }
    }
81248
public void assertAuthFail(byte[] expectedSignature, BuilderMode builderMode, String errorMessage) {
        if (isHashEquals(expectedSignature, builderMode)) {
            if (Validator.isEmpty(errorMessage)) {
                throw new IllegalArgumentException();
            } else {
                throw new IllegalArgumentException(errorMessage);
            }
        }
    }
410305
@Override
    public void trace(String format, Object arg) {
        if (logger.isTraceEnabled()) {
            FormattingTuple ft = MessageFormatter.format(format, arg);
            logger.trace(ft.getMessage(), ft.getThrowable());
        }
    }
1031116
public String parse(String expression) throws InvalidExpressionException {

        this.expression = expression;

        try {
            var = check();
        } catch (InvalidExpressionException e) {
            e.printStackTrace();
        }

        this.expression = formatString(expression);
        System.out.println(this.expression);
        tokens = tokenize(this.expression);

        return this.expression;
    }
506059
@NonNull
    public static Expression avg(@NonNull Expression expression) {
        if (expression == null) {
            throw new IllegalArgumentException("expression cannot be null.");
        }
        return new Expression.FunctionExpression("AVG()", Arrays.asList(expression));
    }
410645
public static void assertFalse(boolean condition, String format, Object... args) {
		if (imp != null && condition) {
			imp.assertFailed(StringUtils.format(format, args));
		}
	}
118291
@FormatMethod
  private void reportError(Token token, @FormatString String message, Object... arguments) {
    if (token == null) {
      reportError(message, arguments);
    } else {
      errorReporter.reportError(token.getStart(), message, arguments);
    }
  }