Method findAndReplaceProperties.

@param counter
@param props
@param name
@param parent
424644
@SuppressWarnings("unchecked")
   protected Element findAndReplaceProperties(Counter counter, Element parent, String name, Map props)
   {
      boolean shouldExist = (props != null) && !props.isEmpty();
      Element element = updateElement(counter, parent, name, shouldExist);
      if (shouldExist)
      {
         Iterator it = props.keySet().iterator();
         Counter innerCounter = new Counter(counter.getDepth() + 1);
         while (it.hasNext())
         {
            String key = (String) it.next();
            findAndReplaceSimpleElement(innerCounter, element, key, (String) props.get(key), null);
         }

         List<String> lst = new ArrayList<String>(props.keySet());
         it = element.getChildren().iterator();
         while (it.hasNext())
         {
            Element elem = (Element) it.next();
            String key = elem.getName();
            if (!lst.contains(key))
            {
               it.remove();
            }
         }
      }
      return element;
   }
384098
public synchronized void reconfigure(Properties props) {
        // First isolate any property that is different from the immutable
        // set of original initialization properties
        Properties newOverrideProps = new Properties();
        for (Entry<Object, Object> prop : props.entrySet()) {
            if (isLog4JProperty(prop.getKey().toString())) {
                Object initialValue = initialProps.get(prop.getKey());
                if (initialValue == null || !initialValue.equals(prop.getValue())) {
                    newOverrideProps.put(prop.getKey(), prop.getValue());
                }
            }
        }
        
        // Compare against our cached set of override
        if (!overrideProps.equals(newOverrideProps)) {
            this.overrideProps.clear();
            this.overrideProps.putAll(newOverrideProps);
            reConfigureAsynchronously();
        }
    }
391596
void update(Dictionary<String, Object> props) {
        if (deleted) {
            return;
        }

        final String instancePid = (String) props.get("service.pid");
        final String instanceId = (String) props.get("id");
        if (instanceId == null) {
            Tr.error(tc, "cls.library.id.missing");
        }
        if (libraryListenersTracker == null) {
            //set up a tracker for notification listeners for this library
            Filter listenerFilter = null;
            // To better support parent first nested config, also filter on libraryRef,
            // which will be a list of pid (or, if cardinality=0, then just a pid).
            try {
                listenerFilter = FrameworkUtil.createFilter("(&(objectClass=" + LibraryChangeListener.class.getName() +
                                                            ")(|(library=" + instanceId + ")(libraryRef=*" + instancePid + "*)))");
            } catch (InvalidSyntaxException e) {
                //auto FFDC because the syntax shouldn't be wrong!
                Tr.error(tc, "cls.library.id.invalid", instanceId, e.toString());
            }

            ServiceTracker<LibraryChangeListener, LibraryChangeListener> tracker;
            tracker = new ServiceTracker<LibraryChangeListener, LibraryChangeListener>(this.ctx, listenerFilter, null);
            tracker.open();
            libraryListenersTracker = tracker;
        }

        LibraryGeneration nextGen;
        synchronized (generationLock) {
            nextGen = nextGeneration;
            if (nextGen != null) {
                // there is already a new generation in the process of being updated.
                // since it is using stale properties we want to cancel that generation
                // and start a new one.
                nextGeneration = null;
                nextGen.cancel();
            }
            nextGeneration = nextGen = new LibraryGeneration(this, instanceId, props);
        }
        nextGen.fetchFilesets();
    }
767276
protected void updatePropertiesInternal(Iterable<Property> properties, Iterable<PropertyRemoveMutation> propertyRemoves) {
        if (propertyRemoves != null) {
            this.propertyRemoveMutations = new ConcurrentSkipListSet<>();
            for (PropertyRemoveMutation propertyRemoveMutation : propertyRemoves) {
                removePropertyInternal(
                        propertyRemoveMutation.getKey(),
                        propertyRemoveMutation.getName(),
                        propertyRemoveMutation.getVisibility()
                );
                this.propertyRemoveMutations.add(propertyRemoveMutation);
            }
        }

        for (Property property : properties) {
            if (property.getKey() == null) {
                throw new IllegalArgumentException("key is required for property");
            }
            Object propertyValue = property.getValue();
            if (propertyValue instanceof PropertyValue && !((PropertyValue) propertyValue).isStore()) {
                continue;
            }
            Property existingProperty = getProperty(property.getKey(), property.getName(), property.getVisibility());
            if (existingProperty == null) {
                this.properties.add(property);
            } else {
                if (existingProperty instanceof MutableProperty) {
                    ((MutableProperty) existingProperty).update(property);
                } else {
                    throw new SecureGraphException("Could not update property of type: " + existingProperty.getClass().getName());
                }
            }
        }
    }
715707
function traverseReplace(node, parent, scope, remaps) {
  if (t.isIdentifier(node)) {
    replace(node, parent, scope, remaps);
  }

  if (t.isAssignmentExpression(node)) {
    var ids = t.getBindingIdentifiers(node);
    for (var name in ids) {
      replace(ids[name], parent, scope, remaps);
    }
  }

  scope.traverse(node, replaceVisitor, remaps);
}
157206
protected void processProperties(ConfigurableListableBeanFactory beanFactoryToProcess, Properties props)
            throws BeansException {

        BeanDefinitionVisitor visitor =
                new ReloadingPropertyPlaceholderConfigurer.PlaceholderResolvingBeanDefinitionVisitor(props);
        String[] beanNames = beanFactoryToProcess.getBeanDefinitionNames();
        for (int i = 0; i < beanNames.length; i++) {
            // Check that we're not parsing our own bean definition,
            // to avoid failing on unresolvable placeholders in net.unicon.iamlabs.spring.properties.example.net
            // .unicon.iamlabs.spring.properties file locations.
            if (!(beanNames[i].equals(this.beanName) && beanFactoryToProcess.equals(this.beanFactory))) {
                this.currentBeanName = beanNames[i];
                try {
                    BeanDefinition bd = beanFactoryToProcess.getBeanDefinition(beanNames[i]);
                    try {
                        visitor.visitBeanDefinition(bd);
                    } catch (BeanDefinitionStoreException ex) {
                        throw new BeanDefinitionStoreException(bd.getResourceDescription(), beanNames[i],
                                ex.getMessage());
                    }
                } finally {
                    currentBeanName = null;
                }
            }
        }

        StringValueResolver stringValueResolver = new PlaceholderResolvingStringValueResolver(props);

        // New in Spring 2.5: resolve placeholders in alias target names and aliases as well.
        beanFactoryToProcess.resolveAliases(stringValueResolver);

        // New in Spring 3.0: resolve placeholders in embedded values such as annotation attributes.
        beanFactoryToProcess.addEmbeddedValueResolver(stringValueResolver);
    }
856397
protected void updatePatternSet(PatternSet value, String xmlTag, Counter counter, Element element)
   {
      boolean shouldExist = value != null;
      Element root = updateElement(counter, element, xmlTag, shouldExist);
      if (shouldExist)
      {
         Counter innerCount = new Counter(counter.getDepth() + 1);
         findAndReplaceSimpleLists(innerCount, root, value.getIncludes(), "includes", "include");
         findAndReplaceSimpleLists(innerCount, root, value.getExcludes(), "excludes", "exclude");
      }
   }
345640
public BugProperty lookupProperty(String name) {
        BugProperty prop = propertyListHead;

        while (prop != null) {
            if (prop.getName().equals(name)) {
                break;
            }
            prop = prop.getNext();
        }

        return prop;
    }
946709
protected Element findAndReplaceXpp3DOM(Counter counter, Element parent, String name, Xpp3Dom dom)
   {
      boolean shouldExist = (dom != null) && ((dom.getChildCount() > 0) || (dom.getValue() != null));
      Element element = updateElement(counter, parent, name, shouldExist);
      if (shouldExist)
      {
         replaceXpp3DOM(element, dom, new Counter(counter.getDepth() + 1));
      }
      return element;
   }
694255
def _increment_prop(self, prop, path=None, **kwargs):
        
        new_path = self.make_path(prop, path)
        if self.method == 'simple':
            counter = kwargs['current']
        else:
            counter = self.counts
        try:
            counter[new_path] += 1
        except KeyError:
            counter[new_path] = 1
        return counter
567567
function diffDataProps(props, oldProps) {
  if (oldProps === null) {
    return 'oldProps is null, initial diff';
  }

  // Support optional app defined comparison of data
  const {dataComparator} = props;
  if (dataComparator) {
    if (!dataComparator(props.data, oldProps.data)) {
      return 'Data comparator detected a change';
    }
    // Otherwise, do a shallow equal on props
  } else if (props.data !== oldProps.data) {
    return 'A new data container was supplied';
  }

  return null;
}
493560
public void changedProps(final String filePath, final Map props) {
        history.push(new Action() {
            public ReturnCode execute() {
                final File file = new File(filePath);
                final Properties propsObj = new Properties();
                InputStream is = null;
                OutputStream os = null;
                try {
                    is = new FileInputStream(file);
                    propsObj.load(is);

                    // Restore old property values.
                    Iterator entries = props.entrySet().iterator();
                    while (entries.hasNext()) {
                        Map.Entry entry = (Map.Entry) entries.next();
                        String key = (String) entry.getKey();
                        String value = ((String[]) entry.getValue())[0];
                        propsObj.setProperty(key, value);
                    }

                    os = new FileOutputStream(file);
                    propsObj.store(os, null);
                    return ReturnCode.OK;
                } catch (IOException ioe) {
                    return new ReturnCode(ReturnCode.BAD_INPUT);
                } finally {
                    SelfExtractUtils.tryToClose(is);
                    SelfExtractUtils.tryToClose(os);
                }
            }
        });
    }
855258
function componentDidMount() {
        var _this2 = this;

        Object.keys(renamedProps).forEach(function (prop) {
          if (prop in _this2.props) {
            console.warn(warningMessage({
              componentName: getComponentName(WrappedComponent),
              prop: prop,
              renamedProps: renamedProps
            }));
          }
        });
      }
1149381
public void setCachedConsumerProps(CachedSessionProperties props)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setCachedConsumerProps", props);
        this.cachedProps = props;
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "setCachedConsumerProps");
    }
924549
private void countCooccurringProperties(
			StatementDocument statementDocument, UsageRecord usageRecord,
			PropertyIdValue thisPropertyIdValue) {
		for (StatementGroup sg : statementDocument.getStatementGroups()) {
			if (!sg.getProperty().equals(thisPropertyIdValue)) {
				Integer propertyId = getNumId(sg.getProperty().getId(), false);
				if (!usageRecord.propertyCoCounts.containsKey(propertyId)) {
					usageRecord.propertyCoCounts.put(propertyId, 1);
				} else {
					usageRecord.propertyCoCounts.put(propertyId,
							usageRecord.propertyCoCounts.get(propertyId) + 1);
				}
			}
		}
	}
143996
private static void startProperty( String name, Properties props, Stack<String> stack )
    {
        String propValue = System.getProperty( name );
        if( propValue == null )
        {
            propValue = props.getProperty( name );
        }
        if( propValue == null )
        {
            push( stack, "${" + name + "}" );
        }
        else
        {
            push( stack, propValue );
        }
    }
118094
public void process(CustomFieldContainer indicators, ProjectProperties properties, Props props)
   {
      m_container = indicators;
      m_properties = properties;
      m_data = props.getByteArray(Props.TASK_FIELD_ATTRIBUTES);

      if (m_data != null)
      {
         int columnsCount = MPPUtility.getInt(m_data, 4);
         m_headerOffset = 8;
         for (int loop = 0; loop < columnsCount; loop++)
         {
            processColumns();
         }
      }
   }