Override in child classes
330755
protected function loadRelatedData()
    {
        /** @var \modResource $this->xPDOSimpleObject */
        $this->xPDOSimpleObject;
        // no IDs only TV name
        $tvs = []; // TemplateVarResources modTemplateVarResource

        $template = false;
        $resource_groups = [];
        if (is_object($this->xPDOSimpleObject)) {
            /** @var \modTemplate $template */
            $template = $this->xPDOSimpleObject->getOne('Template');
            $resource_groups = $this->xPDOSimpleObject->getResourceGroupNames();
        }
        if (is_object($template)) {

            // get all TemplateValues
            $tvTemplates = $template->getMany('TemplateVarTemplates');
            /** @var \modTemplateVarTemplates $tvTemplate */
            foreach ($tvTemplates as $tvTemplate) {
                /** @var \modTemplateVar $tv */
                $tv = $tvTemplate->getOne('TemplateVar');
                $tv_name = $tv->get('name');

                // Raw TV value:
                $tvResource = $this->modx->getObject(
                    'modTemplateVarResource',
                    ['tmplvarid' => $tv->get('id'), 'contentid' => $this->xPDOSimpleObject->get('id')]
                );

                if ($tvResource instanceof \modTemplateVarResource) {
                    $tvs[$tv_name] = $this->makePortableTVData($tv_name, $tv->get('type'), $tvResource->get('value'));
                }
            }
        }

        $extras = [];
        // tagger:
        $tagger = $this->blender->getTagger();
        if ($tagger instanceof \Tagger) {
            $extras['tagger'] = $this->getResourceTags();
        }

        $this->related_data = [
            'extras' => $extras,
            'tvs' => $tvs,
            'resource_groups' => $resource_groups
        ];

        // Calls on the event: OnBlendLoadRelatedData
        parent::loadRelatedData();
    }
820155
function SubClass() {
		var ret;
		// Call the parent constructor.
		parent.apply(this, arguments);

		// Only call initialize in self constructor.
		if(this.constructor === SubClass && this.initialize) {
			ret = this.initialize.apply(this, arguments);
		}
		return ret ? ret : this;
	}
1147804
public static boolean overrides(
      TypeElement type, Types types, String methodName, TypeMirror... params) {
    return override(type, types, methodName, params).isPresent();
  }
363724
def child_class(self, child):
        
        for prop, klassdef in self.c_children.values():
            if child == prop:
                if isinstance(klassdef, list):
                    return klassdef[0]
                else:
                    return klassdef
        return None
27902
def get_inheritors(cls):
    """"""
    subclasses = set()
    work = [cls]
    while work:
        parent = work.pop()
        for child in parent.__subclasses__():
            if child not in subclasses:
                subclasses.add(child)
                work.append(child)
    return subclasses
1011707
static void overrideBlackList(List<String> originList, String overrideStr) {
        List<String> adds = new ArrayList<String>();
        String[] overrideItems = StringUtils.splitWithCommaOrSemicolon(overrideStr);
        for (String overrideItem : overrideItems) {
            if (StringUtils.isNotBlank(overrideItem)) {
                if (overrideItem.startsWith("!") || overrideItem.startsWith("-")) {
                    overrideItem = overrideItem.substring(1);
                    if ("*".equals(overrideItem) || "default".equals(overrideItem)) {
                        originList.clear();
                    } else {
                        originList.remove(overrideItem);
                    }
                } else {
                    if (!originList.contains(overrideItem)) {
                        adds.add(overrideItem);
                    }
                }
            }
        }
        if (adds.size() > 0) {
            originList.addAll(adds);
        }
    }
467850
private void visitOverride(AnnotatedNode node, AnnotationNode visited) {
        ClassNode annotationClassNode = visited.getClassNode();
        if (annotationClassNode.isResolved() && annotationClassNode.getName().equals("java.lang.Override")) {
            if (node instanceof MethodNode && !Boolean.TRUE.equals(node.getNodeMetaData(Verifier.DEFAULT_PARAMETER_GENERATED))) {
                boolean override = false;
                MethodNode origMethod = (MethodNode) node;
                ClassNode cNode = origMethod.getDeclaringClass();
                if (origMethod.hasDefaultValue()) {
                    List<MethodNode> variants = cNode.getDeclaredMethods(origMethod.getName());
                    for (MethodNode m : variants) {
                        if (m.getAnnotations().contains(visited) && isOverrideMethod(m)) {
                            override = true;
                            break;
                        }
                    }
                } else {
                    override = isOverrideMethod(origMethod);
                }

                if (!override) {
                    addError("Method '" + origMethod.getName() + "' from class '" + cNode.getName() + "' does not override " +
                            "method from its superclass or interfaces but is annotated with @Override.", visited);
                }
            }
        }
    }
374948
def inherited(child_klass)
      inherited_config_klass = Class.new(@__qonfig_config_klass__)

      child_klass.instance_variable_set(:@__qonfig_definition_lock__, Mutex.new)
      child_klass.instance_variable_set(:@__qonfig_access_lock__, Mutex.new)
      child_klass.instance_variable_set(:@__qonfig_config_klass__, inherited_config_klass)
      child_klass.instance_variable_set(:@__qonfig_config__, nil)

      super
    end
899304
public static boolean overrides(
      DeclaredType type, Types types, String methodName, TypeMirror... params) {
    return overrides(asElement(type), types, methodName, params);
  }
231261
def auto_override_class(cls, force = False, force_recursive = False):
    
    if not pytypes.checking_enabled:
        return cls
    assert(isclass(cls))
    if not force and is_no_type_check(cls):
        return cls
    # To play it safe we avoid to modify the dict while iterating over it,
    # so we previously cache keys.
    # For this we don't use keys() because of Python 3.
    # Todo: Better use inspect.getmembers here
    keys = [key for key in cls.__dict__]
    for key in keys:
        memb = cls.__dict__[key]
        if force_recursive or not is_no_type_check(memb):
            if isfunction(memb) or ismethod(memb) or ismethoddescriptor(memb):
                if util._has_base_method(memb, cls):
                    setattr(cls, key, override(memb))
            elif isclass(memb):
                auto_override_class(memb, force_recursive, force_recursive)
    return cls
1093959
def overrides(method):
    '''
    
    '''
    def wrapper(func):
        if func.__name__ != method.__name__:
            msg = "Wrong @override: %r expected, but overwriting %r."
            msg = msg % (func.__name__, method.__name__)
            raise AssertionError(msg)

        if func.__doc__ is None:
            func.__doc__ = method.__doc__

        return func

    return wrapper
635122
def overrideable_partial(func, *args, **default_kwargs):
    
    import functools
    @functools.wraps(func)
    def partial_wrapper(*given_args, **given_kwargs):
        kwargs = default_kwargs.copy()
        kwargs.update(given_kwargs)
        return func(*(args + given_args), **kwargs)
    return partial_wrapper
39654
@Override
    public void manipulateChildElements(List<HierarchyWrapper> children) {
        if (!children.isEmpty()) {
            builder.append(baseIndent).append("children=").append("\n");
        }
    }
1310707
function overrideTags (parent, child, telegraf) {
  const childCopy = {};
  const toAppend = [];
  formatTags(child, telegraf).forEach(tag => {
    const idx = typeof tag === 'string' ? tag.indexOf(':') : -1;
    if (idx < 1) { // Not found or first character
      toAppend.push(tag);
    } else {
      childCopy[tag.substring(0, idx)] = tag.substring(idx + 1);
    }
  });
  const result = parent.map(tag => {
    const idx = typeof tag === 'string' ? tag.indexOf(':') : -1;
    if (idx < 1) { // Not found or first character
      return tag;
    }
    const key = tag.substring(0, idx);
    if (childCopy.hasOwnProperty(key)) {
      const value = childCopy[key];
      delete childCopy[key];
      return `${key}:${value}`;
    }
    return tag;
  });
  Object.keys(childCopy).forEach(key => {
    result.push(`${key}:${childCopy[key]}`);
  });
  return result.concat(toAppend);
}
189629
private void overrideAbstractMethods() throws IOException
    {
        for (final ExecutableElement method : El.getEffectiveMethods(superClass))
        {
            if (method.getModifiers().contains(Modifier.ABSTRACT))
            {
                if (
                        method.getAnnotation(Terminal.class) != null || 
                        method.getAnnotation(Rule.class) != null || 
                        method.getAnnotation(Rules.class) != null )
                {
                    implementedAbstractMethods.add(method);
                    MethodCompiler mc = new MethodCompiler()
                    {
                        @Override
                        protected void implement() throws IOException
                        {
                            TypeMirror returnType = method.getReturnType();
                            List<? extends VariableElement> params = method.getParameters();
                            if (returnType.getKind() != TypeKind.VOID && params.size() == 1)
                            {
                                nameArgument(ARG, 1);
                                try
                                {
                                    convert(ARG, returnType);
                                }
                                catch (IllegalConversionException ex)
                                {
                                    throw new IOException("bad conversion with "+method, ex);
                                }
                                treturn();
                            }
                            else
                            {
                                if (returnType.getKind() == TypeKind.VOID && params.size() == 0)
                                {
                                    treturn();
                                }
                                else
                                {
                                    throw new IllegalArgumentException("cannot implement abstract method "+method);
                                }
                            }
                        }
                    };
                    subClass.overrideMethod(mc, method, Modifier.PROTECTED);
                }
            }
        }
    }
795661
final public function addOverride($class, $type, array $options)
    {
        if (!isset($this->overrides[$class])) {
            $this->overrides[$class] = [];
        }

        if (!isset($this->overrides[$class][$type])) {
            $this->overrides[$class][$type] = [];
        }

        $this->overrides[$class][$type][] = $options;
    }
235894
public void overrideSetting(String name, int value) {
        overrides.put(name, Integer.toString(value));
    }