Reports an error if the given name is not visible in the current context.

@param scope The current scope.
@param name The name node.
508688
private void checkNameVisibility(Scope scope, Node name) {
    if (!name.isName()) {
      return;
    }

    Var var = scope.getVar(name.getString());
    if (var == null) {
      return;
    }

    Visibility v = checkPrivateNameConvention(
        AccessControlUtils.getEffectiveNameVisibility(
            name, var, defaultVisibilityForFiles), name);

    switch (v) {
      case PACKAGE:
        if (!isPackageAccessAllowed(var, name)) {
          compiler.report(
              JSError.make(
                  name,
                  BAD_PACKAGE_PROPERTY_ACCESS,
                  name.getString(),
                  var.getSourceFile().getName()));
        }
        break;
      case PRIVATE:
        if (!isPrivateAccessAllowed(var, name)) {
          compiler.report(
              JSError.make(
                  name,
                  BAD_PRIVATE_GLOBAL_ACCESS,
                  name.getString(),
                  var.getSourceFile().getName()));
        }
        break;
      default:
        // Nothing to do for PUBLIC and PROTECTED
        // (which is irrelevant for names).
        break;
    }
  }
954447
void processScope(Scope scope) {
    boolean shouldAddToBlockStack = !scope.isHoistScope();
    this.narrowScope = scope;
    if (shouldAddToBlockStack) {
      blockStack.add(new BasicBlock(null, scope.getRootNode()));
    }
    (new NodeTraversal(compiler, this, scopeCreator)).traverseAtScope(scope);
    if (shouldAddToBlockStack) {
      pop(blockStack);
    }
    this.narrowScope = null;
  }
1017100
public static final void cellName(String name)
    {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "cellName", name);

        _cellName = name;

        if (tc.isEntryEnabled())
            Tr.exit(tc, "cellName");
    }
1133221
public boolean hasChildScope(ScopeType type, String name) {
        log.debug("Has child scope? {} in {}", name, this);
        return children.getBasicScope(type, name) != null;
    }
1283651
public void claimName(String name) {
    checkName(name);
    if (names.add(name, 1) != 0) {
      names.remove(name);
      // give a slightly better error message in this case
      if (reserved.contains(name)) {
        throw new IllegalArgumentException("Tried to claim a reserved name: " + name);
      }
      throw new IllegalArgumentException("Name: " + name + " was already claimed!");
    }
  }
652908
public void checkTableName(final String name) {
        if (name.charAt(0) == SINGLE_QUOTE) {
            throw new IllegalArgumentException(
                    "Table name should not start with " + SINGLE_QUOTE + ": " + name);
        }
        for (int i = 0; i < name.length(); i++) {
            final char c = name.charAt(i);
            for (final char fc : FORBIDDEN_CHARS) {
                if (c == fc) {
                    throw new IllegalArgumentException(
                            "Table name should not contain " + new String(FORBIDDEN_CHARS) +
                                    ": " + name);
                }
            }
        }
    }
109221
public IScope getScope(String name) {
        IBasicScope child = children.getBasicScope(ScopeType.UNDEFINED, name);
        log.debug("Child of {}: {}", this.name, child);
        if (child != null) {
            if (child instanceof IScope) {
                return (IScope) child;
            }
            log.warn("Requested scope: {} is not of IScope type: {}", name, child.getClass().getName());
        }
        return null;
    }
317635
public void setDisplayName(String name) {
		if(SipServletMessageImpl.isSystemHeader(isModifiable)) {
			throw new IllegalStateException("this Address is used in a context where it cannot be modified");
		}
		try {
			getAddress().setDisplayName(name);
		} catch (ParseException e) {
			throw new IllegalArgumentException("illegal name ", e);
		}

	}
1281131
public void setScope(String scopeName) {
        if ("page".equals(scopeName)) {
            scope = PageContext.PAGE_SCOPE;
        }
        else if ("request".equals(scopeName)) {
            scope = PageContext.REQUEST_SCOPE;
        }
        else if ("session".equals(scopeName)) {
            scope = PageContext.SESSION_SCOPE;
        }
        else if ("application".equals(scopeName)) {
            scope = PageContext.APPLICATION_SCOPE;
        }
    }
51600
private static Name checkNotReserved(Name name, String action) {
    if (isReserved(name)) {
      throw new IllegalArgumentException("cannot " + action + ": " + name);
    }
    return name;
  }
1180947
public static void checkProjectName(String name) {

        if (CmsStringUtil.isEmptyOrWhitespaceOnly(name)) {
            throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_PROJECTNAME_VALIDATION_0));
        }
    }
169402
protected void setScope(String scope) {
        requireArgument(scope != null && !scope.isEmpty(), "Scope cannot be null or empty.");
        _scope = scope;
    }
251185
public static void checkForValidName(final Node node, final String name)
    {
        if (!ValidationUtil.isSbeCppName(name))
        {
            handleWarning(node, "name is not valid for C++: " + name);
        }

        if (!ValidationUtil.isSbeJavaName(name))
        {
            handleWarning(node, "name is not valid for Java: " + name);
        }

        if (!ValidationUtil.isSbeGolangName(name))
        {
            handleWarning(node, "name is not valid for Golang: " + name);
        }

        if (!ValidationUtil.isSbeCSharpName(name))
        {
            handleWarning(node, "name is not valid for C#: " + name);
        }
    }
217697
private void beforeName() throws IOException {
    int context = peekScope();
    if (context == NONEMPTY_OBJECT) { // first in object
      sink.writeByte(',');
    } else if (context != EMPTY_OBJECT) { // not in an object!
      throw new IllegalStateException("Nesting problem.");
    }
    newline();
    replaceTop(DANGLING_NAME);
  }
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);
        }
    }
159416
public void setName(NameExpr name) {
        if (this.name != null) {
            updateReferences(this.name);
        }
        this.name = name;
        setAsParentNodeOf(name);
    }
125987
private void onRemove(final String name) {
        Feedback.confirm(Console.MESSAGES.deleteTitle(title),
                Console.MESSAGES.deleteConfirm(title + " '" + name + "'"),
                isConfirmed -> {
                    if (isConfirmed) {
                        circuit.dispatch(new DeleteConfig(addressTemplate, name));
                    }
                });
    }