todo dmgcodevil: move it to MetaHolder class ?
543695
private MetaHolder createCopy(MetaHolder source, ExecutionType executionType) {
        return MetaHolder.builder()
                .obj(source.getObj())
                .method(source.getMethod())
                .ajcMethod(source.getAjcMethod())
                .fallbackExecutionType(source.getFallbackExecutionType())
                .extendedFallback(source.isExtendedFallback())
                .extendedParentFallback(source.isExtendedParentFallback())
                .executionType(executionType)
                .args(source.getArgs())
                .observable(source.isObservable())
                .observableExecutionMode(source.getObservableExecutionMode())
                .defaultCollapserKey(source.getDefaultCollapserKey())
                .defaultCommandKey(source.getDefaultCommandKey())
                .defaultGroupKey(source.getDefaultGroupKey())
                .defaultThreadPoolKey(source.getDefaultThreadPoolKey())
                .defaultProperties(source.getDefaultProperties().orNull())
                .hystrixCollapser(source.getHystrixCollapser())
                .hystrixCommand(source.getHystrixCommand()).build();
    }
1215105
private void insanityCheck(Element element, Meta meta, Opcode.Type type) {
		if (meta != null) {
			throw new TemplateException("Invalid operators list on element |%s|. Only one %s operator is allowed.", element, type);
		}
	}
187315
private void setMetaClass(Class theClass, MetaClass oldMc, MetaClass newMc) {
        final ClassInfo info = ClassInfo.getClassInfo(theClass);
        
        MetaClass mc = null;
        info.lock();
        try {
            mc = info.getStrongMetaClass();
            info.setStrongMetaClass(newMc);
        } finally {
            info.unlock();
        }
        if ((oldMc == null && mc != newMc) || (oldMc != null && mc != newMc && mc != oldMc)) {
            fireConstantMetaClassUpdate(null, theClass, mc, newMc);
        }
    }
906997
function (target, name, meta){
            var _ctor = __define.fixTargetCtor(target),
                _key = __define.fixTargetKey(name),
                _exist = _key in _ctor;

            _ctor[_key] = {
                name: name,
                type: 'method',
                meta: meta
            };

            if (name in target) {
                if(!meta.value){
                    meta.value = function (){

                    };
                }

                meta.value.__super__ = target[name];
            }

            target[name] = meta.value;

            return _exist;
        }
910504
private void initMetaMappings() {

        if (m_metaMappings == null) {
            m_metaMappings = new HashMap<String, MetaMapping>();
            try {
                initPage();
                CmsMacroResolver resolver = new CmsMacroResolver();
                resolver.setKeepEmptyMacros(true);
                resolver.setCmsObject(m_cms);
                resolver.setMessages(OpenCms.getWorkplaceManager().getMessages(getLocale()));
                CmsResourceFilter filter = getIsEditMode()
                ? CmsResourceFilter.IGNORE_EXPIRATION
                : CmsResourceFilter.DEFAULT;
                for (CmsContainerBean container : m_page.getContainers().values()) {
                    for (CmsContainerElementBean element : container.getElements()) {
                        String settingsKey = CmsFormatterConfig.getSettingsKeyForContainer(container.getName());
                        String formatterConfigId = element.getSettings() != null
                        ? element.getSettings().get(settingsKey)
                        : null;
                        I_CmsFormatterBean formatterBean = null;
                        if (CmsUUID.isValidUUID(formatterConfigId)) {
                            formatterBean = OpenCms.getADEManager().getCachedFormatters(
                                m_cms.getRequestContext().getCurrentProject().isOnlineProject()).getFormatters().get(
                                    new CmsUUID(formatterConfigId));
                        }
                        if ((formatterBean != null)
                            && formatterBean.useMetaMappingsForNormalElements()
                            && m_cms.existsResource(element.getId(), filter)) {
                            addMappingsForFormatter(formatterBean, element.getId(), resolver, false);
                        }

                    }
                }
                if (getDetailContentId() != null) {
                    try {
                        CmsResource detailContent = m_cms.readResource(
                            getDetailContentId(),
                            CmsResourceFilter.ignoreExpirationOffline(m_cms));
                        CmsFormatterConfiguration config = OpenCms.getADEManager().lookupConfiguration(
                            m_cms,
                            m_cms.getRequestContext().getRootUri()).getFormatters(m_cms, detailContent);
                        for (I_CmsFormatterBean formatter : config.getDetailFormatters()) {
                            addMappingsForFormatter(formatter, getDetailContentId(), resolver, true);
                        }
                    } catch (CmsException e) {
                        LOG.error(
                            Messages.get().getBundle().key(
                                Messages.ERR_READING_REQUIRED_RESOURCE_1,
                                getDetailContentId()),
                            e);
                    }
                }
            } catch (Exception e) {
                LOG.error(e.getLocalizedMessage(), e);
            }
        }
    }
332562
function ViewBuilder (meta, denormFn) {
  Definition.call(this, meta);

  // used for replay...
  this.workerId = uuid().toString();

  meta = meta || {};

  if (!denormFn || (!_.isFunction(denormFn) && !_.isString(denormFn))) {
    var err = new Error('denormalizer function not injected!');
    debug(err);
    throw err;
  }

  if (_.isString(denormFn) && denormFn !== 'update' && denormFn !== 'create' && denormFn !== 'delete') {
    var err = new Error('denormalizer function "' + denormFn + '" not available! Use "create", "update" or "delete"!');
    debug(err);
    throw err;
  }

  this.version = meta.version || 0;
  this.payload = meta.payload === '' ? meta.payload : (meta.payload || null);
  this.aggregate = meta.aggregate || null;
  this.context = meta.context || null;
  this.id = meta.id || null;
  this.query = meta.query || null;
  this.autoCreate = meta.autoCreate === undefined || meta.autoCreate === null ? true : meta.autoCreate;
  this.priority = meta.priority || Infinity;

  if (_.isString(denormFn)) {
    if (denormFn === 'delete') {
      denormFn = function (evtData, vm) {
        vm.destroy();
      };
    } else {
      denormFn = function (evtData, vm) {
        vm.set(evtData);
      };
    }
  }

  this.denormFn = denormFn;

  if (denormFn.length === 2) {
    this.denormFn = function (evtData, vm, clb) {
      denormFn.call(this, evtData, vm);
      if (this.retryCalled) {
        return;
      }
      clb(null);
    };
  }

  var unwrappedDenormFn = this.denormFn;

  this.denormFn = function (evtData, vm, clb) {
    var wrappedCallback = function () {
      try {
        clb.apply(this, _.toArray(arguments));
      } catch (e) {
        debug(e);
        process.emit('uncaughtException', e);
      }
    };

    try {
      unwrappedDenormFn.call(this, evtData, vm, wrappedCallback.bind(this));
    } catch (e) {
      debug(e);
      process.emit('uncaughtException', e);
    }
  };

  this.idGenerator(function () {
    return uuid().toString();
  });

  this.defineShouldHandle(truthyShouldHandle);

  this.defineShouldHandleEvent(truthyShouldHandleEvent);  

  this.onAfterCommit(function (evt, vm) {});
}
318459
function (domObject, toAdd, toRemove) {
            var
                classNames,
                lengthBefore,
                len,
                idx;
            if (domObject.className) {
                classNames = domObject.className.split(" ");
            } else {
                classNames = [];
            }
            lengthBefore = classNames.length;
            // Remove first (faster)
            if (undefined !== toRemove) {
                if ("string" === typeof toRemove) {
                    toRemove = [toRemove];
                }
                _gpfAssert(toRemove instanceof Array, "Expected array");
                len = toRemove.length;
                for (idx = 0; idx < len; ++idx) {
                    gpf.clear(classNames, toRemove[idx]);
                }
            }
            // Then add
            if (undefined !== toAdd) {
                if ("string" === typeof toAdd) {
                    toAdd = [toAdd];
                }
                _gpfAssert(toAdd instanceof Array, "Expected array");
                len = toAdd.length;
                for (idx = 0; idx < len; ++idx) {
                    gpf.set(classNames, toAdd[idx]);
                }
            }
            // Avoid resource consuming refresh if nothing changed
            if (lengthBefore !== classNames.length) {
                domObject.className = classNames.join(" ");
            }
            return domObject;
        }
24393
@Override
    public DataSourceHolder getHolder(StatementMetaData metaData, Map<String, Object> runtime) {
        String daoName = metaData.getDAOMetaData().getDAOClass().getName();
        String name = daoName;
        DataSourceHolder dataSource = dataSources.get(name);
        if (dataSource != null) {
            return dataSource;
        }
        while (true) {
            int index = name.lastIndexOf('.');
            if (index == -1) {
                dataSources.putIfAbsent(daoName, defaultDataSource);
                return defaultDataSource;
            }
            name = name.substring(0, index);
            dataSource = dataSources.get(name);
            if (dataSource != null) {
                dataSources.putIfAbsent(daoName, dataSource);
                return dataSource;
            }
        }
    }
755133
function (control, inheritedMetadata) {
				var inheritedMetadataProperties = inheritedMetadata.getProperties();
				var result = Object.create(null);

				result.meta = Object.create(null);
				result.meta.controlName = inheritedMetadata.getName();

				result.properties = Object.create(null);
				Object.keys(inheritedMetadataProperties).forEach(function (key) {
					result.properties[key] = Object.create(null);
					result.properties[key].value = inheritedMetadataProperties[key].get(control);
					result.properties[key].type = inheritedMetadataProperties[key].getType().getName ? inheritedMetadataProperties[key].getType().getName() : '';
				});

				return result;
			}
540094
@SuppressWarnings("unchecked")
    public T fromDMR(String keyValue, ModelNode modelNode) throws Exception {

        if (isBaseTypeAdapter()) return convertToBaseType(modelNode);

        ModelNode actualPayload = null;

        if (ModelType.OBJECT.equals(modelNode.getType())) {
            actualPayload = modelNode;
        }
       /* else if(ModelType.PROPERTY.equals(modelNode.getType()))
        {
            final Property property = modelNode.asProperty();
            actualPayload = property.getValue();
        }*/
        else {
            throw new IllegalArgumentException("Unsupported ModelType " + modelNode.getType() + ": " + modelNode);
        }

        ClassInfo clazz = index.getClassByName(DotName.createSimple(getType().getCanonicalName()));

        T entity = null;
        boolean implicitKey = clazz.annotations().containsKey(IndexFactory.IMPLICIT_META);

        if (implicitKey) {
            // implicit (aka singleton) resource
            Constructor<?> ctor = getType().getConstructor();
            entity = (T) ctor.newInstance();
        } else {
            // explicit (regular) resource
            entity = (T) getType().getConstructor(String.class)
                    .newInstance(keyValue);
        }


        for (MethodInfo method : clazz.methods()) {
            if (method.hasAnnotation(IndexFactory.BINDING_META)) {

                Method getter = entity.getClass().getMethod(method.name());
                Class<?> propertyType = getter.getReturnType();

                ModelNodeBinding binding = getter.getDeclaredAnnotation(ModelNodeBinding.class);
                String detypedName = binding.detypedName();

                ModelNode dmrPayload = actualPayload.get(detypedName);


                // EXPRESSIONS
                if(ModelType.EXPRESSION == dmrPayload.getType()) {

                    ValueExpression expression = dmrPayload.asExpression();

                    ((Map)entity).put(method.name(), expression.getExpressionString());

                    continue; // expression have precedence over real values

                }


                // VALUES
                ModelType dmrType = Types.resolveModelType(propertyType);
                if (dmrType == ModelType.LIST) {
                    new ListTypeAdapter().fromDmr(entity, method.name(), dmrType, propertyType, dmrPayload);
                } else if (dmrType == ModelType.OBJECT) {
                    new MapTypeAdapter().fromDmr(entity, method.name(), dmrType, propertyType, dmrPayload);
                } else {
                    new SimpleTypeAdapter().fromDmr(entity, method.name(), dmrType, propertyType, dmrPayload);
                }


            }
        }
        return entity;
    }
699986
function (value) {

/*Line 174 - 'AtomBinding.js' */                if (!this.pathList && this.vf) {
/*Line 175 - 'AtomBinding.js' */                    value = [value];
/*Line 176 - 'AtomBinding.js' */                }

/*Line 178 - 'AtomBinding.js' */                if (this.vf) {
/*Line 179 - 'AtomBinding.js' */                    value.push(Atom);
/*Line 180 - 'AtomBinding.js' */                    value.push(AtomPromise);
/*Line 181 - 'AtomBinding.js' */                    value.push($x);
/*Line 182 - 'AtomBinding.js' */                    value = this.vf.apply(this, value);
/*Line 183 - 'AtomBinding.js' */                }

/*Line 185 - 'AtomBinding.js' */                if (value instanceof AtomPromise) {
/*Line 186 - 'AtomBinding.js' */                    value._persist = true;
/*Line 187 - 'AtomBinding.js' */                }

/*Line 189 - 'AtomBinding.js' */                this._lastValue = value;
/*Line 190 - 'AtomBinding.js' */                this._isUpdating = true;
/*Line 191 - 'AtomBinding.js' */                this.control.setLocalValue(this.key, value, this.element, true);
/*Line 192 - 'AtomBinding.js' */                this._isUpdating = false;
/*Line 193 - 'AtomBinding.js' */            }
473470
private String getReplicaMethodDelegationCode(Class<?> clazz, CtMethod ctMethod, String classOrInstanceToDelegateTo)
            throws NotFoundException {
        StringBuilder builder = new StringBuilder();
        builder.append("{java.lang.reflect.Method originalMethod = ");
        builder.append(clazz.getName());
        builder.append(".class.getDeclaredMethod(\"");
        builder.append(ctMethod.getName());
        builder.append("\", ");
        final String parametersAsString = getParametersAsString(getParameterTypes(ctMethod));
        if ("".equals(parametersAsString)) {
            builder.append("null");
        } else {
            builder.append(parametersAsString);
        }
        builder.append(");\n");
        builder.append("originalMethod.setAccessible(true);\n");
        final CtClass returnType = ctMethod.getReturnType();
        final boolean isVoid = returnType.equals(CtClass.voidType);
        if (!isVoid) {
            builder.append("return (");
            builder.append(returnType.getName());
            builder.append(") ");
        }
        builder.append("originalMethod.invoke(");
        if (Modifier.isStatic(ctMethod.getModifiers()) || classOrInstanceToDelegateTo == null) {
            builder.append(clazz.getName());
            builder.append(".class");
        } else {
            builder.append(classOrInstanceToDelegateTo);
        }
        builder.append(", $args);}");
        return builder.toString();
    }
641352
function(name, value, metaName) {
            if (_.isObject(name)) {
                _.each(name, function(value, name) {
                    this.meta(name, value);
                }, this);
                return;
            }

            if (metaName == null) metaName = "name";
            var mt = this.$('meta['+metaName+'="'+name+'"]');
            if (mt.length === 0) {
                mt =  $("<meta>", {}).attr(metaName, name).appendTo('head');
            }
            if (value != null) {
                mt.attr('content', value);
                return this;
            } else {
                return mt.attr('content');
            }
        }
1360372
public final void mJAVASCRIPT() throws RecognitionException {
		try {
			int _type = JAVASCRIPT;
			int _channel = DEFAULT_TOKEN_CHANNEL;
			// druidG.g:647:2: ( ( 'JAVASCRIPT:' | 'javascript:' ) )
			// druidG.g:647:5: ( 'JAVASCRIPT:' | 'javascript:' )
			{
			// druidG.g:647:5: ( 'JAVASCRIPT:' | 'javascript:' )
			int alt33=2;
			int LA33_0 = input.LA(1);
			if ( (LA33_0=='J') ) {
				alt33=1;
			}
			else if ( (LA33_0=='j') ) {
				alt33=2;
			}

			else {
				NoViableAltException nvae =
					new NoViableAltException("", 33, 0, input);
				throw nvae;
			}

			switch (alt33) {
				case 1 :
					// druidG.g:647:6: 'JAVASCRIPT:'
					{
					match("JAVASCRIPT:"); 

					}
					break;
				case 2 :
					// druidG.g:647:21: 'javascript:'
					{
					match("javascript:"); 

					}
					break;

			}

			}

			state.type = _type;
			state.channel = _channel;
		}
		finally {
			// do for sure before leaving
		}
	}
1068203
function (oControl, sPropertyName, mBindingInfos) {
			var mOldBindingInfos = oControl.getBindingInfo(sPropertyName);
			var vOldValue;

			var oMetadata = oControl.getMetadata().getPropertyLikeSetting(sPropertyName);
			if (oMetadata) {
				var sPropertyGetter = oMetadata._sGetter;
				vOldValue = oControl[sPropertyGetter]();
			}

			JsControlTreeModifier.bindProperty.apply(this, arguments);

			if (mOldBindingInfos){
				this._saveUndoOperation("bindProperty", [oControl, sPropertyName, mOldBindingInfos]);
			} else {
				this._saveUndoOperation("unbindProperty", [oControl, sPropertyName]);
			}
			if (vOldValue) {
				this._saveUndoOperation("setProperty", [oControl, sPropertyName, vOldValue]);
			}
		}
1116550
function() {
            $(this.renderTo).addClass(this.typeName);
            $(this.renderTo).attr('data-gauge-value', this.value);
            if(this.elements.valueDisplay) {
                this.addClassToElement(this.elements.valueDisplay.element, 'gauge-value');
            }
            for(key in this.elements) {
                if(/^tickLabel_/.test(key)) {
                    this.addClassToElement(this.elements[key].element, 'gauge-tick-label');
                }
            }
            for(key in this.elements){
                if(/^colorBand/.test(key)){
                    this.addClassToElement(this.elements[key].element, 'gauge-color-band');
                }
            }
            $('.gauge-color-band').each(function(){
                $(this).attr('data-band-color', $(this).attr('fill'));
            });

            if(this.elements.fill){
                $(this.elements.fill.element).attr('data-indicator-color', $(this.elements.fill.element).attr('fill'));
            }
            // this is bad OOP but I think it's better to keep all of this code in one method
            if(this.elements.needle) {
                this.addClassToElement(this.elements.needle.element, 'gauge-indicator');
            }
            if(this.elements.markerLine) {
                this.addClassToElement(this.elements.markerLine.element, 'gauge-indicator');
            }
        }
15835
function (obj, meta) {
    // if `null` already, just set it to the new value
    // otherwise define property first
    if (obj[META_FIELD] !== null) {
      if (obj.__defineNonEnumerable) {
        obj.__defineNonEnumerable(EMBER_META_PROPERTY);
      } else {
        Object.defineProperty(obj, META_FIELD, META_DESC);
      }
    }

    obj[META_FIELD] = meta;
  }