Overrides DAO acts as the root, it handles incorporating attributes from the attribute
swapper utility, wraps the caching DAO
342042
@Bean(name = "personAttributeDao")
    @Qualifier("personAttributeDao")
    public IPersonAttributeDao getPersonAttributeDao() {
        final PortalRootPersonAttributeDao rslt = new PortalRootPersonAttributeDao();
        rslt.setDelegatePersonAttributeDao(getRequestAttributeMergingDao());
        rslt.setAttributeOverridesMap(getSessionAttributesOverridesMap());
        return rslt;
    }
801443
function(key, val, options={}){

    if(this.returnType === null){ return void 0; }
    var attrs = key;
    var value = this.value();

    // Noralize the data passed in
    if(this.returnType === 'model'){
      if (typeof key === 'object') {
        attrs = (key.isModel) ? key.attributes : key;
        options = val || {};
      } else {
        (attrs = {})[key] = val;
      }
    }
    if(this.returnType !== 'model'){ options = val || {}; }
    attrs = (attrs && attrs.isComputedProperty) ? attrs.value() : attrs;

    // If a new value, set it and trigger events
    this.setter && this.setter.call(this.__root__, attrs);

    if(this.returnType === 'value' && this.cache.value !== attrs) {
      this.cache.value = attrs;
      if(!options.quiet){
        // If set was called not through computedProperty.call(), this is a fresh new event burst.
        if(!this.isDirty && !this.isChanging) this.__parent__.changed = {};
        this.__parent__.changed[this.name] = attrs;
        this.trigger('change', this.__parent__);
        this.trigger('change:'+this.name, this.__parent__, attrs);
        delete this.__parent__.changed[this.name];
      }
    }
    else if(this.returnType !== 'value' && options.reset){ key = value.reset(attrs, options); }
    else if(this.returnType !== 'value'){ key = value.set(attrs, options); }
    this.isDirty = this.isChanging = false;

    // Call all reamining computed properties waiting for this value to resolve.
    _.each(this.waiting, function(prop){ prop && prop.call(); });

    return key;
  }
1112066
function(attributes, options) {
    var attrs = attributes || {};
    options || (options = {});
    this.cid = _.uniqueId('c');
    this.attributes = {};
    if (options.collection) this.collection = options.collection;
    if (options.parse) attrs = this.parse(attrs, options) || {};
    this._schema = this.schema();
    this._defaults = this.defaults(undefined, true);
    attrs = _.defaultsDeep({}, attrs, this.defaults(undefined, false));
    this.set(attrs, options);
    this.changed = {};
    this.initialize.apply(this, arguments);
  }
762281
function( attr, val ) {
				var orgVal = this.getAttribute( attr );
				if ( val !== orgVal ) {
					!this._.attrChanges && ( this._.attrChanges = {} );

					// Saved the original attribute val.
					if ( !( attr in this._.attrChanges ) )
						this._.attrChanges[ attr ] = orgVal;

					this.setAttribute( attr, val );
				}
			}
1206970
private Properties loadOverrides(File baseDir, Properties properties) throws IOException {
        return loadProperties(baseDir, properties, "override", true);
    }
501812
function(context, node, args) {
		var name = args[0],
			value = args[1],
			val = args[1];
		if (value && value.__interpolable__) {
			val = value.output(context);
			var attributeUpdate = function(value, type, path) {
				node.setAttribute(name, value);
			};
			node.binds = node.binds || [];
			value.subscribeTo(context, attributeUpdate, node.binds);
		}
		node.setAttribute(name, val);
	}
568688
private void overrideUseMavenPatterns(T overrider, Class overriderClass) {
        if (useMavenPatternsOverrideList.contains(overriderClass.getSimpleName())) {
            try {
                Field useMavenPatternsField = overriderClass.getDeclaredField("useMavenPatterns");
                useMavenPatternsField.setAccessible(true);
                Object useMavenPatterns = useMavenPatternsField.get(overrider);

                if (useMavenPatterns == null) {
                    Field notM2CompatibleField = overriderClass.getDeclaredField("notM2Compatible");
                    notM2CompatibleField.setAccessible(true);
                    Object notM2Compatible = notM2CompatibleField.get(overrider);
                    if (notM2Compatible instanceof Boolean && notM2Compatible != null) {
                        useMavenPatternsField.set(overrider, !(Boolean)notM2Compatible);
                    }
                }
            } catch (NoSuchFieldException | IllegalAccessException e) {
                converterErrors.add(getConversionErrorMessage(overrider, e));
            }
        }
    }
1240005
public void addRootDTO(JavaClass<?> entity, JavaClassSource rootDTO)
   {
      DTOPair dtoPair = dtos.containsKey(entity) ? dtos.get(entity) : new DTOPair();
      dtoPair.rootDTO = rootDTO;
      dtos.put(entity, dtoPair);
   }
134052
private static boolean updateAttributeIfExist(String key, CoreDictionary.Attribute attribute, TreeMap<String, CoreDictionary.Attribute> map, TreeMap<Integer, CoreDictionary.Attribute> rewriteTable)
    {
        int wordID = CoreDictionary.getWordID(key);
        CoreDictionary.Attribute attributeExisted;
        if (wordID != -1)
        {
            attributeExisted = CoreDictionary.get(wordID);
            attributeExisted.nature = attribute.nature;
            attributeExisted.frequency = attribute.frequency;
            attributeExisted.totalFrequency = attribute.totalFrequency;
            // 收集该覆写
            rewriteTable.put(wordID, attribute);
            return true;
        }

        attributeExisted = map.get(key);
        if (attributeExisted != null)
        {
            attributeExisted.nature = attribute.nature;
            attributeExisted.frequency = attribute.frequency;
            attributeExisted.totalFrequency = attribute.totalFrequency;
            return true;
        }

        return false;
    }
48327
def _set_attribute_as_deprecated(attribute)
      original_attribute_method = instance_method(attribute.to_sym)

      klass = self
      define_method attribute.to_sym do |*args|
        backtrace_cleaner = ActiveSupport::BacktraceCleaner.new

        backtrace = backtrace_cleaner.clean(caller)

        klass._notify_deprecated_attribute_call({klass: self, attribute: attribute, args: args, backtrace: backtrace})

        # Call the original attribute method.
        original_attribute_method.bind(self).call(*args)
      end
    end
920321
function resolveRelations(attrNode, context) {
    if (attrNode.dataSources || attrNode.resource) {
        const parentResource = context.parentResource;
        let childResource = attrNode;

        context.errorContext = getErrorContext(!parentResource ? 'resource' : 'sub-resource', context);

        if (attrNode.resource) {
            if (!context.resourceConfigs[attrNode.resource]) {
                throw new ImplementationError('Unknown resource "' + attrNode.resource + '"' + context.errorContext);
            }
            childResource = context.resourceConfigs[attrNode.resource].config;
        }

        if (parentResource) {
            if (!('parentKey' in attrNode)) throw new ImplementationError('Missing parentKey' + context.errorContext);
            if (!('childKey' in attrNode)) throw new ImplementationError('Missing childKey' + context.errorContext);

            if (attrNode.parentKey === null) {
                attrNode.parentKey = _.cloneDeep(parentResource.primaryKey);
            }
            if (attrNode.childKey === null) {
                attrNode.childKey = _.cloneDeep(childResource.primaryKey);
            }

            if (attrNode.joinVia) {
                const joinViaDataSource = attrNode.dataSources[attrNode.joinVia];
                if (attrNode.parentKey.length !== joinViaDataSource.joinParentKey.length) {
                    throw new ImplementationError(
                        'Composite key length of parentKey (' +
                            attrNode.parentKey.length +
                            ') does not match joinParentKey length (' +
                            joinViaDataSource.joinParentKey.length +
                            ') ' +
                            'of DataSource "' +
                            attrNode.joinVia +
                            '"' +
                            context.errorContext
                    );
                }
                if (attrNode.childKey.length !== joinViaDataSource.joinChildKey.length) {
                    throw new ImplementationError(
                        'Composite key length of childKey (' +
                            attrNode.childKey.length +
                            ') does not match joinChildKey length (' +
                            joinViaDataSource.joinChildKey.length +
                            ') ' +
                            'of DataSource "' +
                            attrNode.joinVia +
                            '"' +
                            context.errorContext
                    );
                }
            } else if (attrNode.parentKey.length !== attrNode.childKey.length) {
                throw new ImplementationError(
                    'Composite key length of parentKey (' +
                        attrNode.parentKey.length +
                        ') does not match childKey length (' +
                        attrNode.childKey.length +
                        ')' +
                        context.errorContext
                );
            }

            const errorContext = context.errorContext;
            context.errorContext = ' in parentKey' + errorContext;
            attrNode.resolvedParentKey = resolveKey(
                attrNode.parentKey,
                parentResource,
                {
                    allowMultiValued: true
                },
                context
            );

            context.errorContext = ' in childKey' + errorContext;
            attrNode.resolvedChildKey = resolveKey(
                attrNode.childKey,
                childResource,
                {
                    neededDataSources: ['primary'],
                    allowMultiValued: false
                },
                context
            );
            context.errorContext = errorContext;
        }

        context.parentResource = attrNode;
    }

    if (attrNode.attributes) {
        Object.keys(attrNode.attributes).forEach(subAttrName => {
            const subAttrNode = attrNode.attributes[subAttrName];
            const subContext = Object.assign({}, context);
            subContext.attrPath = context.attrPath.concat([subAttrName]);

            resolveRelations(subAttrNode, subContext);
        });
    }
}
51490
def _SyncAttributes(self):
    
    # This effectively moves all the values from the new_attributes to the
    # synced_attributes caches.
    for attribute, value_array in iteritems(self.new_attributes):
      if not attribute.versioned or self.age_policy == NEWEST_TIME:
        # Store the latest version if there are multiple unsynced versions.
        value = value_array[-1]
        self.synced_attributes[attribute] = [
            LazyDecoder(decoded=value, age=value.age)
        ]

      else:
        synced_value_array = self.synced_attributes.setdefault(attribute, [])
        for value in value_array:
          synced_value_array.append(LazyDecoder(decoded=value, age=value.age))

        synced_value_array.sort(key=lambda x: x.age, reverse=True)

    self.new_attributes = {}
    self._to_delete.clear()
    self._dirty = False
    self._new_version = False
1017546
function() {
				var changes = this._.attrChanges, orgVal;
				for ( var attr in changes ) {
					if ( changes.hasOwnProperty( attr ) ) {
						orgVal = changes[ attr ];
						// Restore original attribute.
						orgVal !== null ? this.setAttribute( attr, orgVal ) : this.removeAttribute( attr );
					}
				}
			}
163647
function(key, value, options) {
            var attrs, subattrs, scope, changes, newattributes, diffs;

            // Handle both `"key", value` and `{key: value}` -style arguments.
            if (typeof key === 'object') {
                attrs = key;
                options = value;
            } else {
                attrs = {};
                scope = key.split(".");
                subattrs = attrs;
                for (var i in scope) {
                    var key = scope[i];
                    if (i == (scope.length - 1)) {
                        subattrs[key] = value;
                    } else {
                        subattrs[key] = {};
                        subattrs = subattrs[key];
                    }
                }
            }

            // Define options
            options = _.defaults(options || {}, {
                silent: false
            });

            // Calcul new attributes
            newattributes = _.deepExtend({}, this.attributes || {}, attrs);
            if (!options.silent) {
                diffs = jsondiffpatch.diff(this._prevAttributes || {}, newattributes);
            }
            this.attributes = newattributes;
            this._prevAttributes = _.deepClone(this.attributes);

            // New unique id
            var oldId = this.id;
            if (this.idAttribute in this.attributes) {
                this.id = this.attributes[this.idAttribute];
            } else {
                this.id = this.cid;
            }
            if (oldId != this.id) this.trigger("id", this.id, oldId);

            // Calcul diffs
            if (!options.silent) {
                diffs = _.diffkeys(diffs);
                _.each(diffs, function(tag) {
                    this.trigger("change:"+tag, tag);
                }, this);
                if (diffs.length > 0) this.trigger("set", diffs);
            }

            return this;
        }
1096436
@Override
    public boolean handleAttribute(DDParser parser, String nsURI, String localName, int index) throws ParseException {
        boolean result = false;

        if (nsURI != null) {
            return result;
        }

        if (CONTEXT_ROOT_ATTRIBUTE_NAME.equals(localName)) {
            this.contextRoot = parser.parseStringAttributeValue(index);
            result = true;
        }

        return result;

    }
1203891
function handleResourceContext(attrNode, context) {
    let dataSource;
    let lastDataSourceName;

    const errorContext = context.errorContext;

    if (attrNode.resource) {
        if ('subFilters' in attrNode) {
            throw new ImplementationError(
                'Adding subFilters for included sub-resource is not allowed' + context.errorContext
            );
        }
        if ('primaryKey' in attrNode) {
            throw new ImplementationError(
                'Overwriting primaryKey for included sub-resource is not allowed' + context.errorContext
            );
        }
    } else if (!('primaryKey' in attrNode)) {
        throw new ImplementationError('Missing primaryKey' + context.errorContext);
    }

    if (attrNode.dataSources) {
        Object.keys(attrNode.dataSources).forEach(dataSourceName => {
            lastDataSourceName = dataSourceName;
            context.dataSourceAttributes[dataSourceName] = [];

            dataSource = attrNode.dataSources[dataSourceName];

            if (dataSource.inherit) {
                if (!attrNode.resource) {
                    throw new ImplementationError(
                        `DataSource "${dataSourceName}" is defined as "inherit" but has no included resource`
                    );
                }
                context.errorContext = ' in inherit' + errorContext;
                dataSource.inherit = checkWhitelist(dataSource.inherit, ['true', 'inherit', 'replace'], context);
                if (dataSource.inherit === 'true') {
                    dataSource.inherit = 'inherit';
                }
                context.errorContext = errorContext;
            }

            if (!dataSource.type && !dataSource.inherit) {
                throw new ImplementationError(
                    `DataSource "${dataSourceName}" misses "type" option${context.errorContext}`
                );
            }

            if (dataSource.joinParentKey) {
                context.errorContext = ' in joinParentKey' + errorContext;
                dataSource.joinParentKey = parsePrimaryKey(dataSource.joinParentKey, context);
                context.errorContext = errorContext;
            }

            if (dataSource.joinChildKey) {
                context.errorContext = ' in joinChildKey' + errorContext;
                dataSource.joinChildKey = parsePrimaryKey(dataSource.joinChildKey, context);
                context.errorContext = errorContext;
            }
        });
    }

    if (attrNode.joinVia) {
        if (!attrNode.dataSources[attrNode.joinVia]) {
            throw new ImplementationError(`Unknown DataSource "${attrNode.joinVia}" in joinVia` + context.errorContext);
        } else {
            dataSource = attrNode.dataSources[attrNode.joinVia];

            if (!dataSource.joinParentKey) {
                throw new ImplementationError(
                    `DataSource "${lastDataSourceName}" misses "joinParentKey" option` + context.errorContext
                );
            }

            if (!dataSource.joinChildKey) {
                throw new ImplementationError(
                    `DataSource "${lastDataSourceName}" misses "joinChildKey" option` + context.errorContext
                );
            }
        }
    }
}
76996
function () {
                    if (this._$source) {
                        var val, attributes = {}, unsetAttributes = {};
                        for (var key in this.$) {
                            if (this.$.hasOwnProperty(key)) {
                                val = this.$[key];
                                if (val instanceof Bindable && val.sync()) {
                                    attributes[key] = val._$source;
                                } else {
                                    attributes[key] = val;
                                }
                            }
                        }
                        // remove all attributes, which are not in clone
                        for (var sourceKey in this._$source.$) {
                            if (this._$source.$.hasOwnProperty(sourceKey)) {
                                if (!attributes.hasOwnProperty(sourceKey)) {
                                    unsetAttributes[sourceKey] = "";
                                }
                            }
                        }
                        this._$source.set(unsetAttributes, {unset: true});
                        this._$source.set(attributes);
                        return true;
                    } else {
                        return false;
                    }

                }