/*
Checks whether the binding for the given oBindingInfo became invalid because
of the current model change (as identified by bUpdateAll and sModelName).

Precondition: oBindingInfo contains a 'binding' object

@param oBindingInfo
@returns {boolean}
422077
function becameInvalid(oBindingInfo) {
			var aParts = oBindingInfo.parts,
				i;

			if (aParts) {
				if (aParts.length == 1) {
					// simple property binding: invalid when the model has the same name (or updateall) and when the model instance differs
					return (bUpdateAll || aParts[0].model == sModelName) && !oBindingInfo.binding.updateRequired(that.getModel(aParts[0].model));
				} else {
					// simple or composite binding: invalid when for any part the model has the same name (or updateall) and when the model instance for that part differs
					for (i = 0; i < aParts.length; i++) {
						if ( (bUpdateAll || aParts[i].model == sModelName) && !oBindingInfo.binding.aBindings[i].updateRequired(that.getModel(aParts[i].model)) ) {
							return true;
						}
					}
				}
			} else {
				// list or object binding: invalid when  the model has the same name (or updateall) and when the model instance differs
				return (bUpdateAll || oBindingInfo.model == sModelName) && !oBindingInfo.binding.updateRequired(that.getModel(oBindingInfo.model));
			}
		}
1063510
public static boolean isBindedObject(TypeName typeName) {
		BindTransform t = lookup(typeName);

		if (t != null && t instanceof ObjectBindTransform) {
			return true;
		}
		return false;
	}
1217077
def on_property_change(self, name, old_value, new_value):
        # pylint: disable=W0613
        
        if name in self._keys:
            try:
                if self.update_filter():
                    # This is a key for the filter and the filter has changed
                    # => Force the handler to update its dependency
                    self._reset()
            except ValueError:
                # Invalid filter: clear all references, this will invalidate
                # the component
                for svc_ref in self.get_bindings():
                    self.on_service_departure(svc_ref)
964253
private EJBInterceptorBinding
                    validateAndMergeStyle3Or4Bindings(String methodName, String signature, EJBInterceptorBinding binding1, EJBInterceptorBinding binding2)
                                    throws EJBConfigurationException
    {
        // Add binding 2 interceptor-class list, unless it is empty.
        ArrayList<String> interceptorNames = binding1.ivInterceptorClassNames;
        if (!binding2.ivInterceptorClassNames.isEmpty())
        {
            interceptorNames.addAll(binding2.ivInterceptorClassNames);
        }

        // Add binding 2 interceptor-order list, unless it is empty.
        ArrayList<String> interceptorOrder = binding1.ivInterceptorOrder;
        if (!binding2.ivInterceptorOrder.isEmpty())
        {
            interceptorOrder.addAll(binding2.ivInterceptorOrder);
        }

        // CTS expects the exclude-default-interceptors setting in prior style 2
        // interceptor-binding to be overridden by current interceptor-binding setting.
        Boolean excludeDefault = binding1.ivExcludeDefaultLevelInterceptors;
        if (binding2.ivExcludeDefaultLevelInterceptors != null)
        {
            excludeDefault = binding2.ivExcludeDefaultLevelInterceptors;
        }

        // CTS expects the exclude-class-interceptors setting in prior style 3 or 4
        // interceptor-binding to be overridden by current interceptor-binding setting.
        // Verify at most only 1 of the bindings provides exclude-class-interceptors.
        Boolean excludeClass = binding1.ivExcludeClassLevelInterceptors;
        if (binding2.ivExcludeClassLevelInterceptors != null)
        {
            excludeClass = binding2.ivExcludeClassLevelInterceptors;
        }

        // Bindings are valid, so merge into a single binding.
        EJBInterceptorBinding mergedBinding;
        if (signature == null)
        {
            mergedBinding = new EJBInterceptorBinding
                            (binding1.ivEjbName, interceptorNames, interceptorOrder, methodName, null);
        }
        else
        {
            mergedBinding = new EJBInterceptorBinding
                            (binding1.ivEjbName, interceptorNames, interceptorOrder, methodName, binding1.ivMethodParms);
        }

        // Set whether or not default or class level interceptors are excluded.
        if (excludeClass != null)
        {
            mergedBinding.setExcludeClassLevelInterceptors(excludeClass);
        }

        if (excludeDefault != null)
        {
            mergedBinding.setExcludeDefaultInterceptors(excludeDefault);
        }

        // Return merged binding.
        return mergedBinding;
    }
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]);
			}
		}
1351342
function mergeParts(oBindingInfo, sBinding) {
		try {
			BindingParser.mergeParts(oBindingInfo);
		} catch (e) {
			Log.error("Cannot merge parts: " + e.message, sBinding,
				"sap.ui.base.BindingParser");
			// rely on error in ManagedObject
		}
	}
189642
function(oldObserved, newObserveSet, onchanged) {
            for (var name in newObserveSet) {
                bindOrPreventUnbinding(oldObserved, newObserveSet, name, onchanged);
            }
        }
401790
private void checkPrimitiveBinding(List<ValidationMessage> errors, String path, String type, ElementDefinition elementContext, Element element, StructureDefinition profile) {
		if (!element.hasPrimitiveValue())
			return;

		String value = element.primitiveValue();
		// System.out.println("check "+value+" in "+path);

		// firstly, resolve the value set
		ElementDefinitionBindingComponent binding = elementContext.getBinding();
		if (binding.hasValueSet() && binding.getValueSet() instanceof Reference) {
			ValueSet vs = resolveBindingReference(profile, binding.getValueSet());
			if (warning(errors, IssueType.CODEINVALID, element.line(), element.col(), path, vs != null, "ValueSet {0} not found", describeReference(binding.getValueSet()))) {
				long t = System.nanoTime();
				ValidationResult vr = context.validateCode(null, value, null, vs);
				txTime = txTime + (System.nanoTime() - t);
				if (vr != null && !vr.isOk()) {
					if (binding.getStrength() == BindingStrength.REQUIRED)
						rule(errors, IssueType.CODEINVALID, element.line(), element.col(), path, false, "The value provided ('"+value+"') is not in the value set " + describeReference(binding.getValueSet()) + " (" + vs.getUrl() + ", and a code is required from this value set");
					else if (binding.getStrength() == BindingStrength.EXTENSIBLE)
						warning(errors, IssueType.CODEINVALID, element.line(), element.col(), path, false, "The value provided ('"+value+"') is not in the value set " + describeReference(binding.getValueSet()) + " (" + vs.getUrl() + ", and a code should come from this value set unless it has no suitable code");
					else if (binding.getStrength() == BindingStrength.PREFERRED)
						hint(errors, IssueType.CODEINVALID, element.line(), element.col(), path, false,  "The value provided ('"+value+"') is not in the value set " + describeReference(binding.getValueSet()) + " (" + vs.getUrl() + ", and a code is recommended to come from this value set");
				}
			}
		} else
			hint(errors, IssueType.CODEINVALID, element.line(), element.col(), path, !type.equals("code"), "Binding has no source, so can't be checked");
	}
82764
private void removeFromServerContextBindingMap(String bindingName,
                                                   boolean explicit)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            Tr.debug(tc, "removeFromServerContextBindingMap : " + bindingName +
                         ", explicit : " + explicit);

        // Re-wrote method to account for explict and implicit bindings. d457053.1

        BindingData bdata = ivServerContextBindingMap.get(bindingName);

        if (bdata != null)
        {
            if (explicit)
            {
                if (ivHomeRecord.j2eeName.equals(bdata.ivExplicitBean))
                {
                    bdata.ivExplicitBean = null;
                    bdata.ivExplicitInterface = null;
                }
                else
                {
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                        Tr.debug(tc, "removeFromServerContextBindingMap : " +
                                     "ERROR : explicit binding for different bean : " +
                                     bdata.ivExplicitBean);
                }
            }
            else
            {
                if (bdata.ivImplicitBeans != null)
                {
                    bdata.ivImplicitBeans.remove(ivHomeRecord.j2eeName);

                    if (bdata.ivImplicitBeans.size() == 0)
                    {
                        bdata.ivImplicitBeans = null;
                    }
                }
                else
                {
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                        Tr.debug(tc, "removeFromServerContextBindingMap : " +
                                     "ERROR : no implicit binding");
                }
            }

            if (bdata.ivExplicitBean == null &&
                bdata.ivImplicitBeans == null)
            {
                ivServerContextBindingMap.remove(bindingName);
            }
        }
        else
        {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                Tr.debug(tc, "removeFromServerContextBindingMap : " +
                             "ERROR : no binding data");
        }
    }
1368294
private void validateTypeAnnotations(Node n, JSDocInfo info) {
    if (info != null && info.hasType()) {
      boolean valid = false;
      switch (n.getToken()) {
        // Function declarations are valid
        case FUNCTION:
          valid = NodeUtil.isFunctionDeclaration(n);
          break;
        // Object literal properties, catch declarations and variable
        // initializers are valid.
        case NAME:
          valid = isTypeAnnotationAllowedForName(n);
          break;
        case ARRAY_PATTERN:
        case OBJECT_PATTERN:
          // allow JSDoc like
          //   function f(/** !Object */ {x}) {}
          //   function f(/** !Array */ [x]) {}
          valid = n.getParent().isParamList();
          break;
        // Casts, exports, and Object literal properties are valid.
        case CAST:
        case EXPORT:
        case STRING_KEY:
        case GETTER_DEF:
        case SETTER_DEF:
          valid = true;
          break;
        // Declarations are valid iff they only contain simple names
        //   /** @type {number} */ var x = 3; // ok
        //   /** @type {number} */ var {x} = obj; // forbidden
        case VAR:
        case LET:
        case CONST:
          valid = !NodeUtil.isDestructuringDeclaration(n);
          break;
        // Property assignments are valid, if at the root of an expression.
        case ASSIGN: {
          Node lvalue = n.getFirstChild();
          valid = n.getParent().isExprResult()
              && (lvalue.isGetProp()
                  || lvalue.isGetElem()
                  || lvalue.matchesQualifiedName("exports"));
          break;
        }
        case GETPROP:
          valid = n.getParent().isExprResult() && n.isQualifiedName();
          break;
        case CALL:
          valid = info.isDefine();
          break;
        default:
          break;
      }

      if (!valid) {
        reportMisplaced(n, "type", "Type annotations are not allowed here. "
            + "Are you missing parentheses?");
      }
    }
  }
1102202
function getBindingsFromTemplateProperties(oElement) {
		var aPropertiesKeys = Object.keys(oElement.getMetadata().getAllProperties());

		return aPropertiesKeys
			.filter(function (sPropertyName) {
				return sPropertyName in oElement.mBindingInfos;
			})
			.reduce(function (aBindings, sPropertyName) {
				return aBindings.concat(
					flattenBindingsFromTemplate(
						oElement.mBindingInfos[sPropertyName]
					)
				);
			}, []);
	}
1028533
function preProcessBindings(bindingString) {
  var results = [];
  var bindingHandlers = this.bindingHandlers;
  var preprocessed;

  // Check for a Provider.preprocessNode property
  if (typeof this.preprocessNode === 'function') {
    preprocessed = this.preprocessNode(bindingString, this);
    if (preprocessed) { bindingString = preprocessed; }
  }

  for (var i = 0, j = this.bindingPreProcessors.length; i < j; ++i) {
    preprocessed = this.bindingPreProcessors[i](bindingString, this);
    if (preprocessed) { bindingString = preprocessed; }
  }

  function addBinding(name, value) {
    results.push("'" + name + "':" + value);
  }

  function processBinding(key, value) {
    // Get the "on" binding from "on.click"
    var handler = bindingHandlers.get(key.split('.')[0]);

    if (handler && typeof handler.preprocess === 'function') {
      value = handler.preprocess(value, key, processBinding);
    }

    addBinding(key, value);
  }

  arrayForEach(parseObjectLiteral(bindingString), function(keyValueItem) {
    processBinding(
      keyValueItem.key || keyValueItem.unknown,
      keyValueItem.value
    );
  });

  return results.join(',');
}
538050
public boolean bind(ValidationObject validationObject)
    {
        if (m_boundObjects.containsKey(validationObject))
        {
            return false;
        }
        m_boundObjects.put(validationObject,validationObject);
        return true;
    }
200998
private boolean isSparkOrigin(String objectName) {
    LOG.trace("Check if created by Stocator: {}", objectName);
    if (cachedSparkOriginated.containsKey(objectName)) {
      return cachedSparkOriginated.get(objectName).booleanValue();
    }
    String obj = objectName;
    Boolean sparkOriginated = Boolean.FALSE;
    final StoredObject so = mJossAccount.getAccount().getContainer(container).getObject(obj);
    if (so != null && so.exists()) {
      final Object sparkOrigin = so.getMetadata("Data-Origin");
      if (sparkOrigin != null) {
        String tmp = (String) sparkOrigin;
        if (tmp.equals("stocator")) {
          sparkOriginated = Boolean.TRUE;
          LOG.trace("Object {} was created by Stocator", objectName);
        }
      }
    }
    cachedSparkOriginated.put(objectName, sparkOriginated);
    return sparkOriginated.booleanValue();
  }
934482
function execObjectBindingHandlerOnNode(bindingKeyAndHandler, node, getValueAccessor, allBindings, bindingContext, reportBindingError) {
      var handlerInitFn = bindingKeyAndHandler.handler["init"],
          handlerUpdateFn = bindingKeyAndHandler.handler["update"],
          bindingKey = bindingKeyAndHandler.key,
          controlsDescendantBindings = false;

      // Run init, ignoring any dependencies
      if (typeof handlerInitFn === "function") {
          try {
              ignore(function() {
                  var initResult = handlerInitFn(node, getValueAccessor(bindingKey), allBindings, bindingContext.$data, bindingContext);

                  // If this binding handler claims to control descendant bindings, make a note of this
                  if (initResult && initResult.controlsDescendantBindings) {
                      controlsDescendantBindings = true;
                  }
              });
          } catch(ex) {
              reportBindingError('init', ex);
          }
      }

      // Run update in its own computed wrapper
      if (typeof handlerUpdateFn === "function") {
          computed(
              function() {
                  try {
                      handlerUpdateFn(node, getValueAccessor(bindingKey), allBindings, bindingContext.$data, bindingContext);
                  } catch (ex) {
                      reportBindingError('update', ex);
                  }
              },
              null,
              { disposeWhenNodeIsRemoved: node }
          );
      }
      return controlsDescendantBindings;
  }
1174502
@Override
    public boolean hasObjectWithPrefix(JavaColonNamespace namespace, String name) throws NamingException {

        JavaColonNamespaceBindings<EJBBinding> bindings;
        boolean result = false;

        Lock readLock = null;
        ComponentMetaData cmd = null;

        try {
            // This helper only provides support for java:global, java:app, and java:module
            if (namespace == JavaColonNamespace.GLOBAL) {
                // Called to ensure that the java:global code path
                // is coming from a Java EE thread. If not this will reject this
                // method call with the correct Java EE error message.
                cmd = getComponentMetaData(namespace, name);
                bindings = javaColonGlobalBindings;
                readLock = javaColonLock.readLock();
                readLock.lock();

            } else if (namespace == JavaColonNamespace.APP) {
                // Get the ComponentMetaData for the currently active component.
                // There is no component name space if there is no active component.
                cmd = getComponentMetaData(namespace, name);
                bindings = getAppBindingMap(cmd.getModuleMetaData().getApplicationMetaData());

                readLock = javaColonLock.readLock();
                readLock.lock();

            } else if (namespace == JavaColonNamespace.MODULE) {
                cmd = getComponentMetaData(namespace, name);
                bindings = getModuleBindingMap(cmd.getModuleMetaData());
            } else {
                bindings = null;
            }

            result = bindings != null && bindings.hasObjectWithPrefix(name);
        } finally {
            if (readLock != null) {
                readLock.unlock();
            }
        }
        return result;
    }
1123967
function() {
    this.checkObjectChanges()
    var tmp = {}
    for (var name in this.changes) {
      if (this.changes.hasOwnProperty(name)) {
        if (
          !this.allowed_attributes ||
          (this.allowed_attributes &&
            this.allowed_attributes.indexOf(name) !== -1)
        ) {
          tmp[name] = this.changes[name]
        }
      }
    }
    return tmp
  }