Converts a set of input configuration keys using the description's configuration to property mapping, or the same
input if the description has no mapping
@param input input map
@param desc plugin description
@return mapped values
169663
public static Map<String, String> mapProperties(final Map<String, String> input, final Description desc) {
        final Map<String, String> mapping = desc.getPropertiesMapping();
        if (null == mapping) {
            return input;
        }
        return performMapping(input, mapping, false);
    }
890141
private Element parseDesc(final File descFile) {
        try {
            parser.setPluginDir(descFile.getParentFile());
            final Element root = parser.parse(descFile.getAbsoluteFile());
            final Features f = parser.getFeatures();
            final String id = f.getPluginId();
            validatePlugin(f);
            extensionPoints.addAll(f.getExtensionPoints().keySet());
            pluginTable.put(id, f);
            return root;
        } catch (final RuntimeException e) {
            throw e;
        } catch (final SAXParseException e) {
            final RuntimeException ex = new RuntimeException("Failed to parse " + descFile.getAbsolutePath() + ": " + e.getMessage(), e);
            throw ex;
        } catch (final Exception e) {
            throw new RuntimeException(e);
        }
    }
17581
public static void copyUnsetAnnotations(CoreMap src, CoreMap dest) {
    Set<Class<?>> otherKeys = src.keySet();
    for (Class key : otherKeys) {
      if (!dest.has(key)) {
        dest.set(key, src.get(key));
      }
    }
  }
1174027
function(dest, source) {

		var name;

		for (name in source) {

			if (!(name in dest)) {

				dest[name] = source[name];

			} else {

				if (Lava.schema.DEBUG && (dest[name].type != source[name].type || dest[name].tag_name != source[name].tag_name)) Lava.t("[Config storage_schema] property types must match: " + name);

				if ('properties' in source[name]) {

					if (!('properties' in dest[name])) {

						dest[name].properties = source[name].properties;

					} else {

						Firestorm.implement(dest[name].properties, source[name].properties);

					}

				}

			}

		}

	}
139778
function createInstance(desc) {
  var fields = ['exact', 'instance', 'selector'];
  utils.check(fields, desc);
  return { exact: desc.exact, instance: desc.instance, selector: desc.selector};
}
801124
public static ConfigNode load(Map<String, String> input) {
        ConfigNode config = new ConfigNode();

        load(config, input);

        return config;
    }
419684
@SuppressWarnings("unchecked")
	private void mergeMap (Map<String, Object> dest, Object source) throws YamlReaderException {
		if (source instanceof Collection) {
			for (Object item : ((Collection<Object>)source))
				mergeMap(dest, item);
		} else if (source instanceof Map) {
			Map<String, Object> map = (Map<String, Object>)source;
			for (Map.Entry<String, Object> entry : map.entrySet()) {
				if (!dest.containsKey(entry.getKey())) dest.put(entry.getKey(), entry.getValue());

			}
		} else
			throw new YamlReaderException("Expected a mapping or a sequence of mappings for a '<<' merge field but found: "
				+ source.getClass().getSimpleName());

	}
473903
@Override
    public Map<String, String> deserialize(String s) {

        try {

            String input = multiline ? s : s.replace('&', '\n');

            Properties props = new Properties();
            if (s != null) {
                props.load(new StringReader(input));
            }

            LinkedHashMap<String, String> result = new LinkedHashMap<String, String>();
            for (Entry<Object, Object> entry : props.entrySet()) {
                result.put(entry.getKey().toString(), entry.getValue().toString());
            }
            return result;

        } catch (IOException e) {
            throw new IllegalStateException(e);
        }

    }
861205
public static String getTofuExtensionImport(FieldDescriptor desc) {
    // This is run by GenerateParseInfoVisitor, which doesn't necessarily have a classpath
    // dependency on the proto, just a data dependency on the descriptor.

    String extensionFieldName = JavaQualifiedNames.getFieldName(desc, false);

    String extensionFieldHolderClassName;
    if (desc.getExtensionScope() != null) {
      extensionFieldHolderClassName = JavaQualifiedNames.getQualifiedName(desc.getExtensionScope());
    } else {
      // else we have a 'top level extension'
      extensionFieldHolderClassName =
          JavaQualifiedNames.getPackage(desc.getFile())
              + "."
              + JavaQualifiedNames.getOuterClassname(desc.getFile());
    }
    return extensionFieldHolderClassName + "." + extensionFieldName + ".getDescriptor()";
  }
1129954
@SuppressWarnings("rawtypes")
    public static @Nonnull
    TypeQualifierValue<?> getValue(ClassDescriptor desc, @CheckForNull  Object value) {
        DualKeyHashMap<ClassDescriptor, Object, TypeQualifierValue<?>> map = instance.get().typeQualifierMap;
        TypeQualifierValue<?> result = map.get(desc, value);
        if (result != null) {
            return result;
        }
        result = new TypeQualifierValue(desc, value);
        map.put(desc, value, result);
        instance.get().allKnownTypeQualifiers.add(result);
        return result;
    }
116501
public static Report validate(final Properties props, final Description desc) {
        final List<Property> properties = desc.getProperties();
        return validate(props, properties);
    }
863052
public static Set<Component> componentsFor(final Descriptor desc)
    {
        try
        {
            try
            {
                return readTOC(desc);
            }
            catch (FileNotFoundException e)
            {
                Set<Component> components = discoverComponentsFor(desc);
                if (components.isEmpty())
                    return components; // sstable doesn't exist yet

                if (!components.contains(Component.TOC))
                    components.add(Component.TOC);
                appendTOC(desc, components);
                return components;
            }
        }
        catch (IOException e)
        {
            throw new IOError(e);
        }
    }
676706
private Map<String, String> flatten(Map<String, ?> input) {
        Map<String, String> result = new HashMap<String, String>();

        for (Map.Entry<String, ?> entry : input.entrySet()) {
            for (Map.Entry<String, String> flattened : flatten(entry)) {
                if (flattened.getValue() != null) {
                    result.put(flattened.getKey(), flattened.getValue());
                }
            }
        }

        return result;
    }
621740
public final void annotationElementValuePair(AnnotationDescr descr) throws RecognitionException {
		Token key=null;
		ParserRuleReturnScope val =null;

		try {
			// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:201:3: (key= ID EQUALS_ASSIGN val= annotationValue )
			// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:201:5: key= ID EQUALS_ASSIGN val= annotationValue
			{
			key=(Token)match(input,ID,FOLLOW_ID_in_annotationElementValuePair1032); if (state.failed) return;
			match(input,EQUALS_ASSIGN,FOLLOW_EQUALS_ASSIGN_in_annotationElementValuePair1034); if (state.failed) return;
			pushFollow(FOLLOW_annotationValue_in_annotationElementValuePair1038);
			val=annotationValue();
			state._fsp--;
			if (state.failed) return;
			if ( state.backtracking==0 ) { if ( buildDescr ) { descr.setKeyValue( (key!=null?key.getText():null), (val!=null?input.toString(val.start,val.stop):null) ); } }
			}

		}

		catch (RecognitionException re) {
		    throw re;
		}

		finally {
			// do for sure before leaving
		}
	}
42171
public void putAllValues(Map<String, V> input) {
        for (Map.Entry<String, V> entry : input.entrySet()) {
            put(entry.getKey(), entry.getValue());
        }
    }
1208340
@Override
    public Object map(Object input) {
        String s = input.toString();
        if (s == null || s.isEmpty())
            return value;
        else if (s instanceof String)
            return s;
        else
            return s;
    }
963712
private String encodeMap(Map<String, Object> destProps) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "encodeMap", destProps);

        // string result to return
        StringBuffer result = new StringBuffer("");

        // new HashMap which will contain only non-default NVPs
        Map<String, Object> nonDefaultProps = new HashMap<String, Object>();

        // Deal with each remaining property in turn.
        Iterator<Map.Entry<String, Object>> props = destProps.entrySet().iterator();
        while (props.hasNext()) {

            // Get the name and value of the property.
            Map.Entry<String, Object> nextProp = props.next();
            String propName = nextProp.getKey();
            Object propValue = nextProp.getValue();

            // make sure the value part goes out the same as it came in....
            // ie. if it contains an un-escaped '&', place '\\' behind it.
            // we only do this if the property value is a String.
            if (propValue instanceof String) {
                propValue = URIDestinationCreator.escapeValueString((String) propValue);
            }

            // for the name, get the default value
            Object propDefaultValue = MsgDestEncodingUtilsImpl.getDefaultPropertyValue(propName);

            // check to see if the value we have is the same as the default
            if (((propDefaultValue == null) && (propValue == null))
                || ((propDefaultValue != null) && (propDefaultValue.equals(propValue)))) {
                // Do nothing - we don't want to waste space encoding default values.
            }
            else {
                // if Queue, we don't want to add DEST_NAME as it will be added later manually
                if (this instanceof JmsQueue && !propName.equals(DEST_NAME)) {
                    // place the non-default name and value in the new HashMap
                    nonDefaultProps.put(propName, propValue);
                }
                // we don't want to add DEST_DISCRIM if its a topic, or the topic space if its default,
                // or the DEST_NAME, because they get added manually later.
                else if (this instanceof JmsTopic
                         && !DEST_DISCRIM.equals(propName)
                         && !DEST_NAME.equals(propName)
                         && !JmsTopicImpl.DEFAULT_TOPIC_SPACE.equals(propValue)) {
                    if (propValue != null) {
                        // place the non-default name and value in the new HashMap
                        nonDefaultProps.put(propName, propValue);
                    }
                }
            }
        }

        // Now prepare to loop through the new HashMap which only contains non-default properties,
        // and print each name and value separated by an "&" (unless its the last NVP).
        Iterator<Map.Entry<String, Object>> iter = nonDefaultProps.entrySet().iterator();

        // Queue specific stuff
        if (this instanceof JmsQueue) {
            // add the prefix
            result.append("queue://");

            // get the dest name out of the map
            String destName = (String) destProps.get(DEST_NAME);

            // guard against null values being printed as "null"
            if (destName == null)
                destName = "";

            // Validate the dest name value to escape unescaped illegal chars.
            // These escape chars would have been removed when the dest was created.
            destName = URIDestinationCreator.escapeDestName(destName);

            // put the name of the queue name as the first part of the result
            result.append(destName);
            // if there are no more NVPs, we don't want a '?' on the end of the name
            if (iter.hasNext()) {
                result.append("?");
            }
        }

        // Topic specific stuff
        else if (this instanceof JmsTopic) {
            // add prefix
            result.append("topic://");

            // get out the props we know names of
            String destName = (String) destProps.get(DEST_DISCRIM);
            String topicSpace = (String) destProps.get(DEST_NAME);

            // guard against null values being printed as "null"
            if (destName == null)
                destName = "";
            if (topicSpace == null)
                topicSpace = "";

            // Validate the dest name and topic space values to escape unescaped illegal chars.
            // These escape chars would have been removed when the dest was created.
            destName = URIDestinationCreator.escapeDestName(destName);
            topicSpace = URIDestinationCreator.escapeValueString(topicSpace);

            // Add the name of the topic first.
            result.append(destName);

            // Make sure topic space is the first NVP after topic name.
            // We don't want to print the topic space if it is the default value.
            if (!JmsTopicImpl.DEFAULT_TOPIC_SPACE.equals(topicSpace)) {

                //NB. By putting the constant first we avoid doing null/empty checking.
                result.append("?topicSpace=");
                result.append(topicSpace);

                // Now prepare the string for further properties if they exist.
                if (iter.hasNext())
                    result.append("&");
            }
            else {
                // We have not added the topic space in, but need to prepare the string
                // for further properties if they exist.
                if (iter.hasNext())
                    result.append("?");
            }
        }

        // If this isn't a Queue or a Topic, not much we can do other than alert the user
        else {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                SibTr.debug(this, tc, "Destination in question is neither a JmsQueue of JmsTopic");
        }

        // loop through the non-default NVPs and append to dest name
        while (iter.hasNext()) {

            Map.Entry<String, Object> nextProp = iter.next();

            // Liberty change : 	
            // Setting the name of the bus to null so that it does not get printed in 
            // the Message
            if (nextProp.getKey().equals(BUS_NAME)) {
                continue;
            }

            result.append(nextProp.getKey());
            result.append("=");
            result.append(nextProp.getValue());

            // only append an ampersand if there are more props to come
            if (iter.hasNext())
                result.append("&");
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "encodeMap", result);
        return result.toString();
    }