Checks if the specified {@code arg} is positive, and throws {@code IllegalArgumentException} if it is not.

@param arg
@param argNameOrErrorMsg
@throws IllegalArgumentException if the specified {@code arg} is negative.
1261
public static int checkArgPositive(final int arg, final String argNameOrErrorMsg) {
        if (arg <= 0) {
            if (argNameOrErrorMsg.indexOf(' ') == N.INDEX_NOT_FOUND) {
                throw new IllegalArgumentException("'" + argNameOrErrorMsg + "' can not be zero or negative: " + arg);
            } else {
                throw new IllegalArgumentException(argNameOrErrorMsg);
            }
        }

        return arg;
    }
1266613
protected boolean narrowArguments(Object[] args) {
    boolean narrowed = false;
    for (int a = 0; a < args.length; ++a) {
      Object arg = args[a];
      if (arg instanceof Number) {
        Object narg = narrow((Number) arg);
        if (narg != arg) {
          narrowed = true;
        }
        args[a] = narg;
      }
    }
    return narrowed;
  }
77130
public static void checkFlagsArgument(final int requestedFlags, final int allowedFlags) {
        if ((requestedFlags & allowedFlags) != requestedFlags) {
            throw new IllegalArgumentException("Requested flags 0x"
                    + Integer.toHexString(requestedFlags) + ", but only 0x"
                    + Integer.toHexString(allowedFlags) + " are allowed");
        }
    }
1042950
public static void fatalError(Logger logger, Throwable t, String format, Object... args) {
    String message = String.format("Fatal error: " + format, args);
    if (t != null) {
      message += "\n" + ExceptionUtils.getStackTrace(t);
    }
    if (ServerConfiguration.getBoolean(PropertyKey.TEST_MODE)) {
      throw new RuntimeException(message);
    }
    logger.error(message);
    System.exit(-1);
  }
28871
public static void assertTrue(boolean condition, String message, Object... args) {
		verify(condition, message, args);
	}
288905
public void error(final String msg)
    {
        errors++;

        if (!suppressOutput)
        {
            out.println("ERROR: " + msg);
        }

        if (stopOnError)
        {
            throw new IllegalArgumentException(msg);
        }
    }
586574
public static <T> T assertNotNull(T argument, String msg) {
        if (argument == null) throw new IllegalArgumentException(msg);
        return argument;
    }
280209
@SuppressWarnings("unchecked")
    protected void messageParameters(Object[] args){
        for( int i=0; i<args.length; i++ ) {
            if(args[i] instanceof Holder && params[i].getNoByRef()!=null) {
                // massage the value of Holder, not the Holder itself
                Holder h = (Holder)args[i];
                h.value = params[i].getNoByRef().toNative(h.value);
            } else {
                args[i] = params[i].toNative(args[i]);
            }
        }
    }
159516
private static boolean checkAboutNormalization(String args[]) {
    boolean normalize = false ;
    if (args.length == 4) {
      if (args[3].equals("TRUE")) {
        normalize = true;
      } else if (args[3].equals("FALSE")) {
        normalize = false;
      } else {
        throw new JMetalException("The value for normalizing must be TRUE or FALSE");
      }
    }

    return normalize ;
  }
1022977
protected final void args(Object... args) {
        if (args == null) args = NO_ARGS;
        this.args = args;
        retry();
    }
893495
public static boolean checkArgs(String[] args) {
	if (args.length < 5) {
	    return false;
	}
	
	if (!(args[0].compareToIgnoreCase("-all") == 0 ||
		    args[0].compareToIgnoreCase("-trn") == 0 ||
		    args[0].compareToIgnoreCase("-tst") == 0) || 
		    args[0].compareToIgnoreCase("-cont") == 0) {
	    return false;
	}
	
	if (args[1].compareToIgnoreCase("-d") != 0) {
	    return false;
	}
	
	if (args[3].compareToIgnoreCase("-o") != 0)
		return false; 
	
	return true;
    }
1059456
static IllegalArgumentException error(String message, String str, int pos) {
    return new IllegalArgumentException(message + "\n" + context(str, pos));
  }
209153
public static <T extends CharSequence> T checkArgNotNullOrEmpty(final T arg, final String argNameOrErrorMsg) {
        if (N.isNullOrEmpty(arg)) {
            if (argNameOrErrorMsg.indexOf(' ') == N.INDEX_NOT_FOUND) {
                throw new IllegalArgumentException("'" + argNameOrErrorMsg + "' can not be null or empty");
            } else {
                throw new IllegalArgumentException(argNameOrErrorMsg);
            }
        }

        return arg;
    }
194004
public static <T> T checkNotNull(T argument, String errorMessage) {
        if (argument == null) {
            throw new NullPointerException(errorMessage);
        }
        return argument;
    }
630990
public CmdLineAction arg(String arg) {
		if (!CmdLineProcessor.isActionArg(arg)) {
			throw new IllegalArgumentException(arg);
		}
		this.args.add(arg);
		return this;
	}
756269
public static void warnWithException(Logger logger, String message, Object ...args) {
    if (logger.isDebugEnabled()) {
      logger.debug(message, args);
    } else {
      if (args.length > 0 && args[args.length - 1] instanceof Throwable) {
        args[args.length - 1] = ((Throwable) args[args.length - 1]).getMessage();
      }
      logger.warn(message + ": {}", args);
    }
  }
571565
private boolean isKwarg(Map<String, Object> arg) {
        Object kwarg = arg.get(KWARG_KEY);
        return kwarg != null
                && kwarg instanceof Boolean
                && ((Boolean) kwarg);
    }