Check if aliases are listed completely.

@param parent Parent class
@param classname Class name
@param parts Splitted sevice line
351037
@SuppressWarnings("unchecked")
  private void checkAliases(Class<?> parent, String classname, String[] parts) {
    Class<?> c = ELKIServiceRegistry.findImplementation((Class<Object>) parent, classname);
    if(c == null) {
      return;
    }
    Alias ann = c.getAnnotation(Alias.class);
    if(ann == null) {
      if(parts.length > 1) {
        StringBuilder buf = new StringBuilder(100) //
            .append("Class ").append(classname) //
            .append(" in ").append(parent.getCanonicalName()) //
            .append(" has the following extraneous aliases:");
        for(int i = 1; i < parts.length; i++) {
          buf.append(' ').append(parts[i]);
        }
        LOG.warning(buf);
      }
      return;
    }
    HashSet<String> aliases = new HashSet<String>();
    for(int i = 1; i < parts.length; i++) {
      aliases.add(parts[i]);
    }
    StringBuilder buf = null;
    for(String a : ann.value()) {
      if(!aliases.remove(a)) {
        if(buf == null) {
          buf = new StringBuilder(100) //
              .append("Class ").append(classname) //
              .append(" in ").append(parent.getCanonicalName()) //
              .append(" is missing the following aliases:");
        }
        buf.append(' ').append(a);
      }
    }
    if(!aliases.isEmpty()) {
      buf = (buf == null ? new StringBuilder() : buf.append(FormatUtil.NEWLINE)) //
          .append("Class ").append(classname) //
          .append(" in ").append(parent.getCanonicalName()) //
          .append(" has the following extraneous aliases:");
      for(String a : aliases) {
        buf.append(' ').append(a);
      }
    }
    if(buf != null) {
      LOG.warning(buf);
    }
  }
668032
protected boolean containsProperty(String alias) {
		String k = resolveKey(alias);
		return k == null ? false : resolver.containsProperty(k);
	}
1243906
public boolean hasClass(String className) {
        final String classAttr = attributes().getIgnoreCase("class");
        final int len = classAttr.length();
        final int wantLen = className.length();

        if (len == 0 || len < wantLen) {
            return false;
        }

        // if both lengths are equal, only need compare the className with the attribute
        if (len == wantLen) {
            return className.equalsIgnoreCase(classAttr);
        }

        // otherwise, scan for whitespace and compare regions (with no string or arraylist allocations)
        boolean inClass = false;
        int start = 0;
        for (int i = 0; i < len; i++) {
            if (Character.isWhitespace(classAttr.charAt(i))) {
                if (inClass) {
                    // white space ends a class name, compare it with the requested one, ignore case
                    if (i - start == wantLen && classAttr.regionMatches(true, start, className, 0, wantLen)) {
                        return true;
                    }
                    inClass = false;
                }
            } else {
                if (!inClass) {
                    // we're in a class name : keep the start of the substring
                    inClass = true;
                    start = i;
                }
            }
        }

        // check the last entry
        if (inClass && len - start == wantLen) {
            return classAttr.regionMatches(true, start, className, 0, wantLen);
        }

        return false;
    }
1000638
void verifyAllReferencesInlined(String name, FunctionState functionState) {
    for (Reference ref : functionState.getReferences()) {
      if (!ref.inlined) {
        Node parent = ref.callNode.getParent();
        throw new IllegalStateException(
            "Call site missed ("
                + name
                + ").\n call: "
                + ref.callNode.toStringTree()
                + "\n parent:  "
                + ((parent == null) ? "null" : parent.toStringTree()));
      }
    }
  }
1230549
public void setAliases(java.util.Collection<String> aliases) {
        if (aliases == null) {
            this.aliases = null;
            return;
        }

        this.aliases = new java.util.ArrayList<String>(aliases);
    }
854698
protected static void register(Class<?> parent, String cname) {
    Entry e = data.get(parent);
    if(e == null) {
      data.put(parent, e = new Entry());
    }
    e.addName(cname);
  }
798014
public boolean isClassUnmarkedForRemoval(String className) {
		for (ControlEntry controlEntry : controlList) {
			if (controlEntry.pattern.matcher(className).matches() && controlEntry.controlMode == ControlMode.KEEP) {
				return true;
			}
		}

		return false;
	}
399086
protected boolean checkPackageLocators(String classPackageName) {
		if (packageLocators != null && !disablePackageLocatorsScanning && classPackageName.length() > 0
				&& (packageLocatorsBasePackage == null || classPackageName.startsWith(packageLocatorsBasePackage))) {
			for (String packageLocator : packageLocators) {
				String[] splitted = classPackageName.split("\\.");

				if (es.cenobit.struts2.json.util.StringUtils.contains(splitted, packageLocator, false))
					return true;
			}
		}
		return false;
	}
219871
private boolean isParentLoader(ClassLoader parent, ClassLoader child)
  {
    for (; child != null; child = child.getParent()) {
      if (child == parent)
        return true;
    }

    return false;
  }
1114413
def check_public_methods(method, parent)
      return if !method || !parent
      @@public_methods.each{ |alias_item|
        parent_is_used_module = nil
        alias_item["used_modules"].each{ |used_module|
          if used_module == parent ||
              used_module.upcase == parent.upcase &&
              @options.ignore_case
            parent_is_used_module = true
          end
        }
        next if !parent_is_used_module

        if method.name == alias_item["name"] ||
            method.name.upcase == alias_item["name"].upcase &&
            @options.ignore_case

          new_meth = initialize_public_method(method, parent)
          if alias_item["local_name"]
            new_meth.name = alias_item["local_name"]
          end

          progress "e"
          @stats.num_methods += 1
          alias_item["file_or_module"].add_method new_meth
        end
      }
    end
827774
public static boolean parentContainsOnlyLeaves(ParentNode parentNode) {
        for (Node child : parentNode.children()) {
            if (!isLeaf(child)) return false;
        }
        return true;
    }
65549
public boolean hasParents(final Class<?> group) {
    final Set<Class<?>> possibleParents = getParentsOfGroup(group);
    return possibleParents != null && !possibleParents.isEmpty();
  }
345258
def sort_aliases(self, aliases):
        
        self._cache_init()
        if not aliases:
            return aliases
        parent_aliases = self._cache_get_entry(self.CACHE_NAME_PARENTS).keys()
        return [parent_alias for parent_alias in parent_aliases if parent_alias in aliases]
881949
function (root, className) {
    var all = ReactTestUtils.scryRenderedDOMComponentsWithClass(root, className);
    if (all.length !== 1) {
      throw new Error('Did not find exactly one match (found: ' + all.length + ') ' + 'for class:' + className);
    }
    return all[0];
  }
1135629
public void deleteTargettingAliases()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "deleteTargettingAliases");

    //Delete any aliases that target this destination
    if (aliasesThatTargetThisDest != null)
    {
      DynamicConfigManager dcm = messageProcessor.getDynamicConfigManager();
      
      synchronized(aliasesThatTargetThisDest)
      {
        Iterator i = aliasesThatTargetThisDest.iterator();
        while (i.hasNext())
        {
          AbstractAliasDestinationHandler abstractAliasDestinationHandler = 
            (AbstractAliasDestinationHandler) i.next();
          abstractAliasDestinationHandler.deleteTargettingAliases();
          
          //Delete the alias/foreign destination
          dcm.deleteAbstractAliasDestinationHandler(abstractAliasDestinationHandler);
          
          i.remove();
        }
      }
    }
    
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "deleteTargettingAliases");

    return;
  }
1086427
protected function registerClassAliases(): void
	{
		$aliases = $this->config->get('application.class_aliases');

		if(!empty($aliases))
		{
			$aliasLoader = new AliasLoader($aliases);

			spl_autoload_register([$aliasLoader, 'load']);
		}
	}
47956
def _get_parents_from_parts(kwargs):
    
    parent_builder = []
    if kwargs['last_child_num'] is not None:
        parent_builder.append('{type}/{name}/'.format(**kwargs))
        for index in range(1, kwargs['last_child_num']):
            child_namespace = kwargs.get('child_namespace_{}'.format(index))
            if child_namespace is not None:
                parent_builder.append('providers/{}/'.format(child_namespace))
            kwargs['child_parent_{}'.format(index)] = ''.join(parent_builder)
            parent_builder.append(
                '{{child_type_{0}}}/{{child_name_{0}}}/'
                .format(index).format(**kwargs))
        child_namespace = kwargs.get('child_namespace_{}'.format(kwargs['last_child_num']))
        if child_namespace is not None:
            parent_builder.append('providers/{}/'.format(child_namespace))
        kwargs['child_parent_{}'.format(kwargs['last_child_num'])] = ''.join(parent_builder)
    kwargs['resource_parent'] = ''.join(parent_builder) if kwargs['name'] else None
    return kwargs