Checks if the given String is empty.
@param string The String to validate.
@param message The error message to include in the Exception in case the validation fails.
@throws ParameterException if the given String is empty.
776491
public static void notEmpty(String string, String message)  {
		if(!validation) return;
		notNull(message);
		notNull(string, message);
		if(string.length() == 0)
			throw new ParameterException(ErrorCode.EMPTY, message);
	}
522303
public static void checkNotEmpty(final String name,
                                     final Map<?, ?> parameter) {
        if (parameter == null || parameter.size() == 0) {
            throw new IllegalArgumentException("Parameter named '" + name + "' should be filled!");
        }
    }
796251
public static void validateStringValue(String value) throws ParameterException {
		Validate.notNull(value);
		Validate.notEmpty(value);
	}
128010
public static void validate(final String string, final List<String> params) {
        final List<String> vars = findVars(string);
        for (String param : params) {
            Preconditions.checkState(vars.contains(param),
                    "Variable '%s' not found in target string '%s'", param, string);
        }
        vars.removeAll(params);
        Preconditions.checkState(vars.isEmpty(),
                "No parameter binding defined for variables '%s' from string '%s'",
                Joiner.on(',').join(vars), string);
    }
753280
@Override
    @SuppressFBWarnings("DM_EXIT")
    public void logError(String message) {
        System.err.println("Error: " + message);
        System.exit(1);
    }
1202794
public void assertAtLeastOneDefined(final String param1, final String param2) {
    if (!isPresent(param1) && !isPresent(param2)) {
      throw new ParameterException(
          String.format("At least one of %s and %s must be defined.", param1, param2));
    }
  }
295663
public static String checkNotEmpty(final String name,
                                       final String parameter) {
        if (parameter == null || parameter.trim().length() == 0) {
            throw new IllegalArgumentException("Parameter named '" + name + "' should be filled!");
        }
        return parameter;
    }
249112
public static void notEmpty(final CharSequence str, final String parameterName) {
		if (str == null || str.length() == 0) {
			throw new IllegalArgumentException('"' + parameterName + "\" must not be null or empty, but was: " + str);
		}
	}
1342804
private void checkString(String string) {

        if (CmsStringUtil.isEmptyOrWhitespaceOnly(string)) {
            throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_EMPTY_STRING_0));
        }
    }
988324
@Override
    public void validate(String name, String value) throws ParameterException {
        if(!value.equals(ArbiterCliGenerator.REGRESSION) || value.equals(ArbiterCliGenerator.CLASSIFICIATION)) {
            throw new ParameterException("Problem type can only be " + ArbiterCliGenerator.REGRESSION + " or " + ArbiterCliGenerator.CLASSIFICIATION);

        }
    }
1024597
private void checkMessage(Message msg) throws MessagingException {
        if (msg == null) {
            throw new MessagingException("Message is null");
        }
        if (!(msg instanceof MimeMessage)) {
            throw new MessagingException(
                    "AWS Mail Service can only send MimeMessages");
        }
    }
196719
public void parse(String... args) {
        try {
            parse(true /* validate */, args);
        } catch(ParameterException ex) {
            ex.setJCommander(this);
            throw ex;
        }
    }
871748
private boolean validateParameters() {

        boolean allOk = true;

        StringBuffer validationErrors = new StringBuffer(32);
        CmsMessages messages = Messages.get().getBundle(getLocale());

        // check resource parameter presence
        if (CmsStringUtil.isEmptyOrWhitespaceOnly(getParamResource()) || !getCms().existsResource(getParamResource())) {
            allOk = false;
            validationErrors.append(messages.key(Messages.GUI_PROP_CHANGE_VALIDATE_VFS_RESOURCE_0)).append("<br>");
        }

        // check selected property name
        if (CmsStringUtil.isEmptyOrWhitespaceOnly(getParamPropertyName())) {
            allOk = false;
            validationErrors.append(messages.key(Messages.GUI_PROP_CHANGE_VALIDATE_SELECT_PROPERTY_0)).append("<br>");
        }

        // check old property value to look up
        if (CmsStringUtil.isEmptyOrWhitespaceOnly(getParamOldValue())) {
            allOk = false;
            validationErrors.append(messages.key(Messages.GUI_PROP_CHANGE_VALIDATE_OLD_PROP_VALUE_0)).append("<br>");
        } else {
            try {
                // check if there is a place holder in the expression pattern
                // remove it here, because otherwise this is no valid expression pattern
                String oldValue = getParamOldValue();
                if (oldValue.contains(CmsStringUtil.PLACEHOLDER_START)
                    && oldValue.contains(CmsStringUtil.PLACEHOLDER_END)) {
                    oldValue = oldValue.replace(CmsStringUtil.PLACEHOLDER_START, "");
                    oldValue = oldValue.replace(CmsStringUtil.PLACEHOLDER_END, "");
                }
                // compile regular expression pattern
                Pattern.compile(oldValue);
            } catch (PatternSyntaxException e) {
                allOk = false;
                validationErrors.append(messages.key(Messages.GUI_PROP_CHANGE_VALIDATE_OLD_PROP_PATTERN_0)).append(
                    "<br>");
            }
        }

        // check new property value
        if (CmsStringUtil.isEmptyOrWhitespaceOnly(getParamNewValue())) {
            // if no new value was given, set it to the delete value
            setParamNewValue(CmsProperty.DELETE_VALUE);
        }

        setErrorMessage(validationErrors.toString());
        setValidationErrors(!allOk);
        return allOk;
    }
1321249
public void sendMessage(final String message) {
        try {
            session.sendMessage(new TextMessage(message));
        }
        catch (IOException e) {
            logger.error("[sendTextMessage]", e);
        }
    }
1025909
public static void check(final boolean condition, final String message, final Object... args) {
        if (!condition) {
            throw new MethodDefinitionException(String.format(message, args));
        }
    }
90947
protected String createExceptionMessage(final String message, final Object... messageParameters) {

        if (ArrayUtils.isEmpty(messageParameters)) {
            return message;
        } else {
            return String.format(message, messageParameters);
        }
    }
658862
public String getString(final String param) {
    checkNotNull(param);
    checkArgument(!param.isEmpty());

    final String ret = params.get(param);
    observeWithListeners(param);

    if (ret != null) {
      return ret;
    } else {
      throw new MissingRequiredParameter(fullString(param));
    }
  }