An InvalidModelError can only happen when a user binds, whether sync
or async to shorted value.  See the unit tests for examples.

@param {*} boundPath
@param {*} shortedPath

@private
427896
function InvalidModelError(boundPath, shortedPath) {
    var instance = new Error("The boundPath of the model is not valid since a value or error was found before the path end.");

    instance.name = "InvalidModelError";
    instance.boundPath = boundPath;
    instance.shortedPath = shortedPath;

    if (Object.setPrototypeOf) {
        Object.setPrototypeOf(instance, Object.getPrototypeOf(this));
    }

    if (Error.captureStackTrace) {
        Error.captureStackTrace(instance, InvalidModelError);
    }

    return instance;
}
1069072
private void init(String xmlPath) throws MalformedURLException, IOException{
		
		XML xml = new XML(true, xmlPath);
		if(!xml.isInheritedMapped(configuredClass))
			Error.classNotMapped(configuredClass);
		
		for (Class<?> classe :getClasses(xml)){
			relationalManyToOneMapper.put(classe.getName(), new JMapper(configuredClass, classe,ChooseConfig.DESTINATION, xmlPath));
			relationalOneToManyMapper.put(classe.getName(), new JMapper(classe, configuredClass,ChooseConfig.SOURCE, xmlPath));
		}
	}
772890
function assertReservedSlotInitialized(slotOffset, numSlots) {
    if (firstTemplatePass) {
        var startIndex = tView.bindingStartIndex - slotOffset;
        for (var i = 0; i < numSlots; i++) {
            assertEqual(viewData[startIndex + i], NO_CHANGE, 'The reserved slots should be set to `NO_CHANGE` on first template pass');
        }
    }
}
42434
function validateConfig(config, parentPath) {
    if (parentPath === void 0) { parentPath = ''; }
    // forEach doesn't iterate undefined values
    for (var /** @type {?} */ i = 0; i < config.length; i++) {
        var /** @type {?} */ route = config[i];
        var /** @type {?} */ fullPath = getFullPath(parentPath, route);
        validateNode(route, fullPath);
    }
}
1267430
function get(path) {
    var conf = this;

    if (typeof path !== 'string') {
        throw new Error('path should be a string!');
    } else if (path.length === 0) {
        throw new Error('path cannot be empty!');
    }

    var result = baseGet(conf, getPathArray(path));
    if (result === undefined) {
        throw new Error('the value is undefined!');
    } else {
        bindGetMethod(result);  // eslint-disable-line
    }

    return result;
}
228818
AbstractConfigValue peekPath(Path path) {
        try {
            return peekPath(this, path, null);
        } catch (NotPossibleToResolve e) {
            throw new BugOrBroken(
                    "NotPossibleToResolve happened though we had no ResolveContext in peekPath");
        }
    }
97439
function(type, model, collection, options){
    var shortcircuit = { change: 1, sort: 1, request: 1, destroy: 1, sync: 1, error: 1, invalid: 1, route: 1, dirty: 1 };
    if( shortcircuit[type] || !model.isData ){ return void 0; }
    model || (model = {});
    collection || (collection = {});
    options || (options = {});
    !collection.isData && (options = collection) && (collection = model);
    var path, vector;

    // Compute the path to this data object that triggered the event
    // TODO: Figure out a better way to prefix service data paths with their local path name
    vector = path = ((options.service) ? `${options.service}.`: '') + collection.__path().replace(/\.?\[.*\]/ig, '.@each');

    // If a reset event on a Model, check for computed properties that depend
    // on each changed attribute's full path.
    if(type === 'reset' && options.previousAttributes){
      _.each(options.previousAttributes, function(value, key){
        vector = path + (path && '.') + key;
        _.each(this.__computedDeps, function(dependants, dependancy){
          startsWith(vector, dependancy) && push.call(TO_CALL, dependants);
        }, this);
      }, this);
    }

    // If a reset event on a Collction, check for computed properties that depend
    // on anything inside that collection.
    else if(type === 'reset' && options.previousModels){
      _.each(this.__computedDeps, function(dependants, dependancy){
        startsWith(dependancy, vector) && push.call(TO_CALL, dependants);
      }, this);
    }

    // If an add or remove event, check for computed properties that depend on
    // anything inside that collection or that contains that collection.
    else if(type === 'add' || type === 'remove'){
      _.each(this.__computedDeps, function(dependants, dependancy){
        if( startsWith(dependancy, vector) || startsWith(vector, dependancy) ) push.call(TO_CALL, dependants);
      }, this);
    }

    // If a change event, trigger anything that depends on that changed path.
    else if(type.indexOf('change:') === 0){
      vector = type.replace('change:', '').replace(/\.?\[.*\]/ig, '.@each');
      _.each(this.__computedDeps, function(dependants, dependancy){
        startsWith(vector, dependancy) && push.call(TO_CALL, dependants);
      }, this);
    }

    // Notifies all computed properties in the dependants array to recompute.
    // Push all recomputes to the end of our stack trace so all Computed Properties
    // already queued for recompute get a chance to.
    if(!CALL_TIMEOUT){ CALL_TIMEOUT = setTimeout(_.bind(recomputeCallback, this), 0); }

  }
266658
function()
	{
		var model, attr, result, result2, modelPathArray, i, ret, modelArgs;
		var dataBindAttr = this.element.getAttribute(settings.DATA_BIND_ATTR);
		var modelName;

		this._modelBindersMap = new BinderMap();

		if(dataBindAttr == null) return;

		var parsedBindings = matchBindings(dataBindAttr);

		if(process.env.NODE_ENV !== 'production')
		{
			if(parsedBindings.error)
			{
				if(this.element && this.element.parentNode)
				{
					this.element.parentNode.scrollIntoView();
					this.element.parentNode.style.outline = '2px dashed red';
				}
				console.error('Error parsing binding expression: ');
				console.error(parsedBindings.error);
				console.log(this.element);
			}
		}

		if(parsedBindings.match && parsedBindings.match.bindings)
		{
			parsedBindings = parsedBindings.match.bindings;

			for(var i = 0, l = parsedBindings.length; i < l; i++)
			{
				var parsedBinding = parsedBindings[i];

				if(parsedBinding.binder === 'each')
				{
					if(process.env.NODE_ENV !== 'production')
					{
						if(this._collectionBinder)
						{
							if(this.element && this.element.parentNode)
							{
								this.element.parentNode.scrollIntoView();
								this.element.parentNode.style.outline = '2px dashed red';
							}
							console.error('You cannot have two :each binders on the same element');
							console.log(this.element);
						}
					}
					if(!this.options.isBoundView)
					{
						var animate = null;
						var keyProp = null;
						var alias = null;

						if(parsedBinding.operators)
						{
							for(var j = 0, k = parsedBinding.operators.length; j < k; j++)
							{
								var operator = parsedBinding.operators[j];
								if(operator.args.length >= 1 && operator.args[0].type === 'ident')
								{
									if(operator.name === 'animate') animate = operator.args[0].value;
									if(operator.name === 'key') keyProp = operator.args[0].value;
									if(operator.name === 'as') alias = operator.args[0].value;
								}
							}
						}

						this._collectionBinder = new CollectionBinder({
							view: this,
							keyPath: parsedBinding.keyPath,
							collectionArgs: parsedBinding.modelArgs,
							animate: animate,
							keyProp: keyProp
						});

						if(alias)
						{
							this._itemAlias = alias;
						}
						else this._itemAlias = settings.defaultItemAlias;
					}
				}
				else
				{
					if(!(parsedBinding.binder in View.binders)) break;

					var scope = this.scope;
					var isIdent = function(v){ return v != null && v.type === 'ident'; }
					var identToParser = function(v)
					{
						if(scope[v.value]) return { fn: scope[v.value], args: [] };
						else if(View.helpers[v.value]) return { fn: View.helpers[v.value], args: [] };
					}
					var argToValue = function(v)
					{
						return v.value;
					}
					var isNotNull = function(v)
					{
						return v != null;
					}

					var binderConfig = {
						view: this,
						element: this.element,
						params: parsedBinding.binderArgs.filter(isNotNull),
						keyPath: parsedBinding.keyPath,
						modelArgs: parsedBinding.modelArgs.filter(isNotNull),
						formatters: [],
						parsers: [],
						dispatch: null,
						// dispatchNamedParams: ret.dispatchNamedParams,
						eventNames: [],
						eventFilters: null,
						fill: false,
						nopreventdef: false,
						animate: null,
						indexed: false
					};


					for(var j = 0, k = parsedBinding.operators.length; j < k; j++)
					{
						var operator = parsedBinding.operators[j];
						switch(operator.name)
						{
							case 'format':
							case 'f':
								binderConfig.formatters = operator.args.filter(isIdent).map(identToParser);
								break;
							case 'parse':
							case 'p':
								binderConfig.parsers = operator.args.filter(isIdent).map(identToParser);
								break;
							case 'dispatch':
								if(operator.args.length > 0)
								{
									binderConfig.dispatch = operator.args;
								}
								break;
							case 'on':
								if(operator.args.length > 0)
								{
									binderConfig.eventNames = operator.args.filter(isIdent).map(argToValue);
								}
								break;
							case 'evf':
								binderConfig.eventFilters = operator.args.filter(isIdent).map(identToParser);
								break;
							case 'fill':
								binderConfig.fill = true;
								break;
							case 'nopreventdef':
								binderConfig.nopreventdef = true;
								break;
							case 'animate':
								binderConfig.animate = operator.args[0].value;
								break;
						}
					}

					for(var j = binderConfig.formatters.length - 1; j >= 0; j--)
					{
						if(binderConfig.formatters[j].fn.indexed === true) binderConfig.indexed = true;
					}

					var modelBinder = new View.binders[parsedBinding.binder](binderConfig);

					this._modelBindersMap.add(modelBinder);
				}
			}
		}

		// Check for invalid combination of :each and :if binders:
		if(process.env.NODE_ENV !== 'production')
		{
			var ifBinders = this._modelBindersMap.binders.filter(function(binder){ return binder instanceof View.binders.if || binder instanceof View.binders.ifnot; });

			if(this._collectionBinder && ifBinders.length > 0)
			{
				if(this.element && this.element.parentNode)
				{
					this.element.parentNode.scrollIntoView();
					this.element.parentNode.style.outline = '2px dashed red';
				}
				console.error('You cannot combine :each binder with :if binder on the same element');
				console.log(this.element);
			}

			if(ifBinders.length > 2)
			{
				if(this.element && this.element.parentNode)
				{
					this.element.parentNode.scrollIntoView();
					this.element.parentNode.style.outline = '2px dashed red';
				}
				console.error('You cannot combine multiple :if binders on the same element');
				console.log(this.element);
			}
		}

	}
639455
function parseStringPropertyPath(propertyPath) {
            //jshint maxcomplexity:13
            //jshint maxdepth:3
            //REASON: taken from https://github.com/marklagendijk/lodash-deep/blob/master/lodash-deep.js
            //        Need to look at refactoring it.
            var character = '';
            var parsedPropertyPath = [];
            var parsedPropertyPathPart = '';
            var escapeNextCharacter = false;
            var isSpecialCharacter = false;
            var insideBrackets = false;

            // Walk through the path and find backslashes that escape periods or other backslashes, and split on unescaped
            // periods and brackets.
            for (var i = 0; i < propertyPath.length; i++) {
                character = propertyPath[i];
                isSpecialCharacter = (character === '\\' || character === '[' || character === ']' || character === '.');

                if (isSpecialCharacter && !escapeNextCharacter) {
                    if (insideBrackets && character !== ']') {
                        throw new SyntaxError('unexpected "' + character + '" within brackets at character ' + i + ' in property path ' + propertyPath);
                    }

                    switch (character) {
                        case '\\':
                            escapeNextCharacter = true;
                            break;
                        case ']':
                            insideBrackets = false;
                            break;
                        case '[':
                            insideBrackets = true;
                            /* falls through */
                        case '.':
                            parsedPropertyPath.push(parsedPropertyPathPart);
                            parsedPropertyPathPart = '';
                            break;
                    }
                } else {
                    parsedPropertyPathPart += character;
                    escapeNextCharacter = false;
                }
            }

            if (parsedPropertyPath[0] === '') {
                //allow '[0]', or '.0'
                parsedPropertyPath.splice(0, 1);
            }

            // capture the final part
            parsedPropertyPath.push(parsedPropertyPathPart);
            return parsedPropertyPath;
        }
91237
function ValidatorError (path, type) {
  var msg = type
    ? '"' + type + '" '
    : '';
  NeopreneError.call(this, 'Validator ' + msg + 'failed for path ' + path);
  Error.captureStackTrace(this, arguments.callee);
  this.name = 'ValidatorError';
  this.path = path;
  this.type = type;
}
674786
private static void checkValidObject(Path path, AbstractConfigObject reference,
            AbstractConfigObject value,
            List<ConfigException.ValidationProblem> accumulator) {
        for (Map.Entry<String, ConfigValue> entry : reference.entrySet()) {
            String key = entry.getKey();

            Path childPath;
            if (path != null)
                childPath = Path.newKey(key).prepend(path);
            else
                childPath = Path.newKey(key);

            AbstractConfigValue v = value.get(key);
            if (v == null) {
                addMissing(accumulator, entry.getValue(), childPath, value.origin());
            } else {
                checkValid(childPath, entry.getValue(), v, accumulator);
            }
        }
    }
1301736
function instantDeferred(resolve, returnValue, context) {
	var deferred = $.Deferred();
	if (resolve) {
		deferred.resolveWith(context, [returnValue]);
	} else {
		deferred.rejectWith(context, [returnValue]);
	}

	return deferred;
}
102413
@Override
    public synchronized void dispatch(ServletContext context, String path) throws IllegalStateException {
        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINEST)) {
            logger.entering(CLASS_NAME, "dispatch(ctx,path)",new Object [] {this,context,path});
        }

        if (!lockHeldByDifferentThread()){
            if (completePending) {
                throw new IllegalStateException(nls.getString("called.dispatch.after.complete"));
            } else if (!dispatchAllowed){
                throw new IllegalStateException(nls.getString("trying.to.call.dispatch.twice.for.the.same.async.operation"));
            }

            // PI28910, the effect of calling dispatch should not take effect until the calling
            // thread completes so it is too early to set asyncStarted to false
            // iExtendedRequest.setAsyncStarted(false);

            createNewAsyncServletReeentrantLock();

            //cancel timer inside lock so we don't kick off timeout events after we've decided to dispatch
            cancelAsyncTimer();

            WebAppRequestDispatcher requestDispatcher = (WebAppRequestDispatcher) context.getRequestDispatcher(path);
            dispatchRunnable = new DispatchRunnable(requestDispatcher, this);
            dispatchPending = true;
            dispatchAllowed = false;
            if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINEST)) {
                logger.logp(Level.FINEST, CLASS_NAME, "dispatch(ctx,path)", "dispatching -->" + dispatching);
            }
            if (!dispatching) {
                executeNextRunnable();
            }
        } else {
            if (WCCustomProperties.THROW_EXCEPTION_WHEN_UNABLE_TO_COMPLETE_OR_DISPATCH) {
                throw new IllegalStateException(nls.getString("AsyncContext.lock.already.held", "Unable to obtain the lock.  Error processing has already been invoked by another thread."));
            }
        }

        dispatchURI = null;

        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINEST)) {
            logger.exiting(CLASS_NAME, "dispatch(ctx,path)",this);
        }
    }
238679
function validatePath (path, target) {
  var i = 0
  var len = path.length
  var ref = target
  for (; i < len; i++) {
    if (Iterable.isIterable(ref)) {
      ref = ref.getIn(path.slice(0, i))
      if (Iterable.isIndexed(ref) && !validateIndexToken(path[i])) {
        throw new error.PointerError('Invalid array index: ' + path[i])
      }
    }
  }
}
345128
function readYaml(filePath) {
    return new Promise((resolve, reject) => {
        if (!filePath || typeof filePath !== 'string') {
            throw new Error('Path must be a string');
        }
        fs.readFile(filePath, (err, data) => {
            if (err) {
                return reject(err);
            }
            // Remove UTF-8 BOM if present
            if (data.length >= 3 && data[0] === 0xef &&
                data[1] === 0xbb && data[2] === 0xbf) {
                data = data.slice(3);
            }
            try {
                return resolve(yaml.safeLoad(data));
            } catch (yamlerr) {
                return reject(yamlerr);
            }
        });
    });
}
43945
protected boolean isValidRequestedPath(String requestedPath) {

		boolean result = true;
		if (!this.jawrConfig.isDebugModeOn() && requestedPath.startsWith(JawrConstant.WEB_INF_DIR_PREFIX)
				|| requestedPath.startsWith(JawrConstant.META_INF_DIR_PREFIX)) {
			result = false;
		} else {
			// If it's not a generated path check the extension file
			if (this.jawrConfig.isDebugModeOn() && !generatorRegistry.isPathGenerated(requestedPath)) {
				String extension = FileNameUtils.getExtension(requestedPath);
				if (!extension.toLowerCase().equals(resourceType)) {
					result = false;
				}
			}
		}

		return result;
	}
93
private void synchronizeElement(
        CmsObject cms,
        String elementPath,
        Collection<String> skipPaths,
        Locale sourceLocale) {

        if (elementPath.contains("/")) {
            String parentPath = CmsXmlUtils.removeLastXpathElement(elementPath);
            List<I_CmsXmlContentValue> parentValues = getValuesByPath(parentPath, sourceLocale);
            String elementName = CmsXmlUtils.getLastXpathElement(elementPath);
            for (I_CmsXmlContentValue parentValue : parentValues) {
                String valuePath = CmsXmlUtils.concatXpath(parentValue.getPath(), elementName);
                boolean skip = false;
                for (String skipPath : skipPaths) {
                    if (valuePath.startsWith(skipPath)) {
                        skip = true;
                        break;
                    }
                }
                if (!skip) {
                    if (hasValue(valuePath, sourceLocale)) {
                        List<I_CmsXmlContentValue> subValues = getValues(valuePath, sourceLocale);
                        removeSurplusValuesInOtherLocales(elementPath, subValues.size(), sourceLocale);
                        for (I_CmsXmlContentValue value : subValues) {
                            if (value.isSimpleType()) {
                                setValueForOtherLocales(cms, value, CmsXmlUtils.removeLastXpathElement(valuePath));
                            } else {
                                List<I_CmsXmlContentValue> simpleValues = getAllSimpleSubValues(value);
                                for (I_CmsXmlContentValue simpleValue : simpleValues) {
                                    setValueForOtherLocales(cms, simpleValue, parentValue.getPath());
                                }
                            }
                        }
                    } else {
                        removeValuesInOtherLocales(valuePath, sourceLocale);
                    }
                }
            }
        } else {
            if (hasValue(elementPath, sourceLocale)) {
                List<I_CmsXmlContentValue> subValues = getValues(elementPath, sourceLocale);
                removeSurplusValuesInOtherLocales(elementPath, subValues.size(), sourceLocale);
                for (I_CmsXmlContentValue value : subValues) {
                    if (value.isSimpleType()) {
                        setValueForOtherLocales(cms, value, null);
                    } else {
                        List<I_CmsXmlContentValue> simpleValues = getAllSimpleSubValues(value);
                        for (I_CmsXmlContentValue simpleValue : simpleValues) {
                            setValueForOtherLocales(cms, simpleValue, null);
                        }
                    }
                }
            } else {
                removeValuesInOtherLocales(elementPath, sourceLocale);
            }
        }
    }