Checks if a named output name is valid token.

@param namedOutput named output Name
@throws IllegalArgumentException if the output name is not valid.
496826
private static void checkTokenName(String namedOutput) {
    if (namedOutput == null || namedOutput.length() == 0) {
      throw new IllegalArgumentException(
        "Name cannot be NULL or emtpy");
    }
    for (char ch : namedOutput.toCharArray()) {
      if ((ch >= 'A') && (ch <= 'Z')) {
        continue;
      }
      if ((ch >= 'a') && (ch <= 'z')) {
        continue;
      }
      if ((ch >= '0') && (ch <= '9')) {
        continue;
      }
      throw new IllegalArgumentException(
        "Name cannot be have a '" + ch + "' char");
    }
  }
223290
public static void encodeSingle(final int input, final byte[] output,
                                    final int outoff) {

        if (output == null) {
            throw new NullPointerException("output");
        }

        if (outoff < 0) {
            throw new IllegalArgumentException("outoff(" + outoff + ") < 0");
        }

        if (outoff >= output.length - 1) {
            throw new IllegalArgumentException(
                "outoff(" + outoff + ") >= output.length(" + output.length
                + ") - 1");
        }

        output[outoff] = (byte) encodeHalf((input >> 4) & 0x0F);
        output[outoff + 1] = (byte) encodeHalf(input & 0x0F);
    }
953695
private static String getNamedOutputFormatInstanceFile(JobContext job, String namedOutput) {
		return job.getConfiguration().get(MO_PREFIX + namedOutput + FORMAT_INSTANCE_FILE, null);
	}
125801
static void checkUnqualifiedName(int version, final String name,
            final String msg) {
        if ((version & 0xFFFF) < Opcodes.V1_5) {
            checkIdentifier(name, msg);
        } else {
            for (int i = 0; i < name.length(); ++i) {
                if (".;[/".indexOf(name.charAt(i)) != -1) {
                    throw new IllegalArgumentException("Invalid " + msg
                            + " (must be a valid unqualified name): " + name);
                }
            }
        }
    }
663286
public static <T> void checkEachParameterNotNull(final String name,
                                                     final T... parameters) {
        if (parameters == null) {
            throw new IllegalArgumentException("Parameter named '" + name + "' should be not null!");
        }
        for (final Object parameter : parameters) {
            if (parameter == null) {
                throw new IllegalArgumentException("Parameter named '" + name + "' should be not null!");
            }
        }
    }
1319553
public void setDefaultNamedOutput(OutputFormat outputFormat, Class keyClass, Class valueClass, Map<String, String> specificContext)  throws TupleMRException {
  	namedOutputs.add(new Output(true, "DEFAULT", outputFormat, keyClass, valueClass, specificContext));
  }
1055949
@GwtIncompatible("Unnecessary")
  private void outputNameMaps() throws IOException {

    String propertyMapOutputPath = null;
    String variableMapOutputPath = null;

    // Check the create_name_map_files FLAG.
    if (config.createNameMapFiles) {
      String basePath = getMapPath(config.jsOutputFile);

      propertyMapOutputPath = basePath + "_props_map.out";
      variableMapOutputPath = basePath + "_vars_map.out";
    }

    // Check the individual FLAGS.
    if (!config.variableMapOutputFile.isEmpty()) {
      if (variableMapOutputPath != null) {
        throw new FlagUsageException("The flags variable_map_output_file and "
            + "create_name_map_files cannot both be used simultaneously.");
      }

      variableMapOutputPath = config.variableMapOutputFile;
    }

    if (!config.propertyMapOutputFile.isEmpty()) {
      if (propertyMapOutputPath != null) {
        throw new FlagUsageException("The flags property_map_output_file and "
            + "create_name_map_files cannot both be used simultaneously.");
      }

      propertyMapOutputPath = config.propertyMapOutputFile;
    }

    // Output the maps.
    if (variableMapOutputPath != null && compiler.getVariableMap() != null) {
      compiler.getVariableMap().save(variableMapOutputPath);
    }

    if (propertyMapOutputPath != null && compiler.getPropertyMap() != null) {
      compiler.getPropertyMap().save(propertyMapOutputPath);
    }
  }
358754
public static Class<? extends WritableComparable> getNamedOutputKeyClass(JobConf conf,
                                                String namedOutput) {
    checkNamedOutput(conf, namedOutput, false);
    return conf.getClass(MO_PREFIX + namedOutput + KEY, null,
	WritableComparable.class);
  }
1044787
public static ErrorCode isNameValid(String name) {
        if (!isMustFieldValid(name, nameRegEx)) {
            return ErrorCode.SERVICE_INSTANCE_NAME_FORMAT_ERROR;
        }
        return ErrorCode.OK;
    }
789626
@GwtIncompatible("Unnecessary")
  private boolean shouldGenerateOutputPerModule(String output) {
    return !config.module.isEmpty()
        && output != null && output.contains("%outname%");
  }
108602
static void checkInternalName(final String name, final String msg) {
        if (name == null || name.length() == 0) {
            throw new IllegalArgumentException("Invalid " + msg
                    + " (must not be null or empty)");
        }
        if (name.charAt(0) == '[') {
            checkDesc(name, false);
        } else {
            checkInternalName(name, 0, -1, msg);
        }
    }
1194560
public static boolean checkName(String nameSpec, String identifier, LombokNode<?, ?, ?> errorNode) {
		if (identifier.isEmpty()) {
			errorNode.addError(nameSpec + " cannot be the empty string.");
			return false;
		}
		
		if (!JavaIdentifiers.isValidJavaIdentifier(identifier)) {
			errorNode.addError(nameSpec + " must be a valid java identifier.");
			return false;
		}
		
		return true;
	}
409140
private void validateArgumentDefinitions() {
        for (final NamedArgumentDefinition mutexSourceDef : namedArgumentDefinitions) {
            for (final String mutexTarget : mutexSourceDef.getMutexTargetList()) {
                final NamedArgumentDefinition mutexTargetDef = namedArgumentsDefinitionsByAlias.get(mutexTarget);
                if (mutexTargetDef == null) {
                    throw new CommandLineException.CommandLineParserInternalException(
                            String.format("Argument '%s' references a nonexistent mutex argument '%s'",
                                    mutexSourceDef.getArgumentAliasDisplayString(),
                                    mutexTarget)
                    );
                } else {
                    // Add at least one alias for the mutex source to the mutex target to ensure the
                    // relationship is symmetric for purposes of usage/help doc display.
                    mutexTargetDef.addMutexTarget(mutexSourceDef.getLongName());
                }
            }
        }
    }
861906
public final boolean hasAnnotation(final String name) {
        if (name == null) {
            throw new IllegalArgumentException("The argument 'name' cannot be NULL!");
        }
        for (int i = 0; i < annotations.size(); i++) {
            final SgAnnotation annotation = annotations.get(i);
            if (annotation.getName().equals(name)) {
                return true;
            }
        }
        return false;
    }
1173461
public static String addNamedOutput(Job job, String namedOutput, OutputFormat outputFormat,
	    Class<?> keyClass, Class<?> valueClass) throws FileNotFoundException, IOException,
	    URISyntaxException {
		checkNamedOutputName(job, namedOutput, true);
		Configuration conf = job.getConfiguration();
		String uniqueName = UUID.randomUUID().toString() + '.' + "out-format.dat";
		InstancesDistributor.distribute(outputFormat, uniqueName, conf);
		conf.set(MULTIPLE_OUTPUTS, conf.get(MULTIPLE_OUTPUTS, "") + " " + namedOutput);
		conf.set(MO_PREFIX + namedOutput + FORMAT_INSTANCE_FILE, uniqueName);
		conf.setClass(MO_PREFIX + namedOutput + KEY, keyClass, Object.class);
		conf.setClass(MO_PREFIX + namedOutput + VALUE, valueClass, Object.class);
		return uniqueName;
	}
1266468
public static void addNamedOutputContext(Job job, String namedOutput, String key, String value) {
		// Check that this named output has been configured before
		Configuration conf = job.getConfiguration();
		// Add specific configuration
		conf.set(MO_PREFIX + namedOutput + CONF + "." + key, value);
	}
175143
public static boolean isValidNcName( String name ) {
        if (name == null || name.length() == 0) return false;
        CharacterIterator iter = new StringCharacterIterator(name);
        char c = iter.first();
        if (!isValidNcNameStart(c)) return false;
        while (c != CharacterIterator.DONE) {
            if (!isValidNcName(c)) return false;
            c = iter.next();
        }
        return true;
    }