Push hardened config value onto batchConfigImpl and cache the value in a field.
771247
private void initPlatformSEorEE() {
		String seMode = serviceImplClassNames.get(Name.JAVA_EDITION_IS_SE_DUMMY_SERVICE);
		if (seMode.equalsIgnoreCase("true")) {
			platformMode = PlatformMode.SE;
			batchConfigImpl.setJ2seMode(true);
		} else {
			platformMode = PlatformMode.EE;
			batchConfigImpl.setJ2seMode(false);
		}
	}
469095
def set_item(key,value):
    """"""
    CACHED_KEY_FILE = os.path.join(CURRENT_DIR, key)

    open(CACHED_KEY_FILE, "wb").write(json.dumps({"_": value}).encode('UTF-8'))

    return value
728857
private void buildByteCopyStack(List<StackManipulation> stack, int iterations) throws NoSuchFieldException, NoSuchMethodException {
    final Method getByteMethod = Unsafe.class.getMethod("getByte", long.class);
    final Method putByteMethod = Unsafe.class.getMethod("putByte", Object.class, long.class, byte.class);

    buildCopyStack(stack, iterations, getByteMethod, putByteMethod, 1);
  }
206776
def set_value(self, value):
        """"""
        cache, cache_key = self._get_cache_plus_key()
        cache.set(cache_key, value)
128504
def cached_value(self, source_file, configuration):
        

        key = record_t.create_key(source_file, configuration)
        if key not in self.__cache:
            return None
        record = self.__cache[key]
        if self.__is_valid_signature(record):
            record.was_hit = True  # Record cache hit
            return record.declarations

        # some file has been changed
        del self.__cache[key]
        return None
390197
private char getCachedCharValue(FieldType field, char defaultValue)
   {
      Character c = (Character) getCachedValue(field);
      return c == null ? defaultValue : c.charValue();
   }
696786
public synchronized void put(T value) {
        cacheMap.put(value.getCacheKey(), new SoftReference<T>(value));
    }
1105850
def _memoize(self, name, getter, *args, **kwargs):
        
        field = "custom_m_" + name
        cached = self.fetch(field)
        if cached:
            value = cached
        else:
            value = getter(*args, **kwargs)
            self._make_it_so("caching %s=%r for" % (name, value,), ["custom.set"], field[7:], value)
            self._fields[field] = value
        return value
140229
def set(self, key, value):
        """"""
        if config.CACHE_POTENTIAL_PURVIEWS:
            self.cache[key] = value
1072112
def config_present(name, value):
    '''
    

    '''
    name = name.lower()
    ret = {'name': name,
           'changes': {},
           'result': None,
           'comment': ''}

    # load confiration
    config = _load_config()

    # handle bool and None value
    if isinstance(value, (bool)):
        value = 'true' if value else 'false'
    if not value:
        value = ""

    if name in config:
        if six.text_type(config[name]) == six.text_type(value):
            # we're good
            ret['result'] = True
            ret['comment'] = 'property {0} already has value "{1}"'.format(name, value)
        else:
            # update property
            ret['result'] = True
            ret['comment'] = 'updated property {0} with value "{1}"'.format(name, value)
            ret['changes'][name] = value
            config[name] = value
    else:
        # add property
        ret['result'] = True
        ret['comment'] = 'added property {0} with value "{1}"'.format(name, value)
        ret['changes'][name] = value
        config[name] = value

    # apply change if needed
    if not __opts__['test'] and ret['changes']:
        ret['result'] = _write_config(config)

    return ret
387751
private Object doGetFieldValue(String fullField, String field, Object object, boolean useCache,
            Map<String, ReflectInfo> cachedFields) {
        // check cache
        Field f;
        if (useCache) {
            ReflectInfo info = cachedFields.get(fullField);
            if (info != null) {
                return getField(info.target, info.field);
            }
        }

        int index = field.indexOf('.');
        if (index != -1) {
            String parent = field.substring(0, index);
            String sub = field.substring(index + 1);

            try {
                f = FieldUtils.findField(object.getClass(), parent);
                if (f == null) {
                    throw new RuntimeException(
                            "No field '" + parent + "' found at class " + object.getClass().getName());
                }
                f.setAccessible(true);
                Object o = f.get(object);
                if (o == null) {
                    return null;
                }
                return get(fullField, sub, o);
            } catch (Exception e) {
                throw new RuntimeException(e.getMessage(), e);
            }
        }

        f = FieldUtils.findField(object.getClass(), field);
        if (f == null) {
            throw new RuntimeException("No field '" + field + "' found at class " + object.getClass().getName());
        }
        if (useCache && !cachedFields.containsKey(fullField)) {
            cachedFields.put(fullField, new ReflectInfo(f, object));
        }
        return getField(object, f);
    }
759942
def config_amend_key_(self,key,value):
        
        cfg_i = self._cfg
        keys = key.split('.')
        last_key = keys.pop()
        trail = []
        for e in keys:
            cfg_i.setdefault(e,{})
            cfg_i = cfg_i[e]
            trail.append(e)
            if not isinstance(cfg_i,dict):
                raise Exception('.'.join(trail) + ' has conflicting dict/scalar types!')
        cfg_i.setdefault(last_key,value)
1038157
def set_cache(config_fpath, cache_dir):
    
    cache_dir = os.path.abspath(cache_dir)
    return write_config_value_to_file(
        CACHE_DIRECTORY_KEY,
        cache_dir,
        config_fpath
    )
74220
private void buildEmbeddedValue(final Object record, MetamodelImpl metaModel, StringBuilder embeddedValueBuilder,
            SingularAttribute attribute)
    {
        // TODO Auto-generated method stub
        Field field = (Field) attribute.getJavaMember();

        EmbeddableType embeddableKey = metaModel.embeddable(field.getType());
        Object embeddableKeyObj = PropertyAccessorHelper.getObject(record, field);
        if (embeddableKeyObj != null)
        {
            StringBuilder tempBuilder = new StringBuilder();
            tempBuilder.append(Constants.OPEN_CURLY_BRACKET);

            for (Field embeddableColumn : field.getType().getDeclaredFields())
            {
                if (!ReflectUtils.isTransientOrStatic(embeddableColumn))
                {
                    Attribute subAttribute = (SingularAttribute) embeddableKey.getAttribute(embeddableColumn.getName());
                    if (metaModel.isEmbeddable(((AbstractAttribute) subAttribute).getBindableJavaType()))
                    {
                        // construct map; recursive
                        // send attribute
                        buildEmbeddedValue(embeddableKeyObj, metaModel, tempBuilder, (SingularAttribute) subAttribute);
                    }
                    else
                    {
                        // append key value
                        appendColumnName(tempBuilder, ((AbstractAttribute) (embeddableKey.getAttribute(embeddableColumn
                                .getName()))).getJPAColumnName());
                        tempBuilder.append(Constants.COLON);
                        appendColumnValue(tempBuilder, embeddableKeyObj, embeddableColumn);
                    }
                    tempBuilder.append(Constants.COMMA);
                }

            }
            // strip last char and append '}'
            tempBuilder.deleteCharAt(tempBuilder.length() - 1);
            tempBuilder.append(Constants.CLOSE_CURLY_BRACKET);
            appendColumnName(embeddedValueBuilder, ((AbstractAttribute) attribute).getJPAColumnName());
            embeddedValueBuilder.append(Constants.COLON);
            embeddedValueBuilder.append(tempBuilder);
        }
        else
        {
            embeddedValueBuilder.deleteCharAt(embeddedValueBuilder.length() - 1);
        }
    }
912284
def add(self, value):
        ''''''
        return self.cache.update((self.value_pickler.dumps(value),))
1116613
def cmd_config_set(key, value):
    

    habucfg = loadcfg(environment=False)
    habucfg[key.upper()] = value
    with Path('~/.habu.json').expanduser().open('w') as f:
        f.write(json.dumps(habucfg, indent=4, sort_keys=True))
885370
def put(self, path, value):
        
        return lib.zconfig_put(self._as_parameter_, path, value)