Wraps an InodeView, providing read-only access. Modifications to the underlying inode will
affect the created read-only inode.

@param delegate the delegate to wrap
@return the created read-only inode
962777
public static Inode wrap(InodeView delegate) {
    if (delegate instanceof Inode) {
      return (Inode) delegate;
    }
    if (delegate.isFile()) {
      Preconditions.checkState(delegate instanceof InodeFileView);
      return new InodeFile((InodeFileView) delegate);
    } else {
      Preconditions.checkState(delegate instanceof InodeDirectoryView);
      return new InodeDirectory((InodeDirectoryView) delegate);
    }
  }
153855
function delegate (root, filter, fn) {
  if (delegates[fn._dd]) {
    return delegates[fn._dd];
  }
  fn._dd = Date.now();
  delegates[fn._dd] = delegator;
  function delegator (e) {
    var el = e.target;
    while (el && el !== root) {
      if (api.matches(el, filter)) {
        fn.apply(this, arguments); return;
      }
      el = el.parentElement;
    }
  }
  return delegator;
}
789063
private void createDelegateInitializerCode(ClassMethod classMethod, MethodInformation initializerMethodInfo, int delegateParameterPosition) {
        final CodeAttribute b = classMethod.getCodeAttribute();
        // we need to push all the parameters on the stack to call the corresponding
        // superclass arguments
        b.aload(0); // load this
        int localVariables = 1;
        int actualDelegateParameterPosition = 0;
        for (int i = 0; i < initializerMethodInfo.getMethod().getParameterTypes().length; ++i) {
            if (i == delegateParameterPosition) {
                // figure out the actual position of the delegate in the local
                // variables
                actualDelegateParameterPosition = localVariables;
            }
            Class<?> type = initializerMethodInfo.getMethod().getParameterTypes()[i];
            BytecodeUtils.addLoadInstruction(b, DescriptorUtils.makeDescriptor(type), localVariables);
            if (type == long.class || type == double.class) {
                localVariables = localVariables + 2;
            } else {
                localVariables++;
            }
        }
        b.invokespecial(classMethod.getClassFile().getSuperclass(), initializerMethodInfo.getName(), initializerMethodInfo.getDescriptor());
        // if this method returns a value it is now sitting on top of the stack
        // we will leave it there are return it later

        // now we need to call _initMH
        b.aload(0); // load this
        b.aload(actualDelegateParameterPosition); // load the delegate
        b.invokevirtual(classMethod.getClassFile().getName(), INIT_MH_METHOD_NAME, "(" + LJAVA_LANG_OBJECT + ")" + BytecodeUtils.VOID_CLASS_DESCRIPTOR);
        // return the object from the top of the stack that we got from calling
        // the superclass method earlier
        b.returnInstruction();

    }
480512
private static String adjustData(String data, ClassNode type, DelegationMetadata dmd) {
        StringBuilder path = new StringBuilder();
        int i = 0;
        String[] propertyPath = data.split("\\.");
        while (dmd != null) {
            int strategy = dmd.getStrategy();
            ClassNode delegate = dmd.getType();
            dmd = dmd.getParent();
            switch (strategy) {
                case Closure.DELEGATE_FIRST:
                    if (!delegate.isDerivedFrom(CLOSURE_TYPE) && !delegate.isDerivedFrom(type)) {
                        path.append("owner"); // must be non-delegate case
                    } else {
                        path.append("delegate");
                    }
                    break;
                default:
                    if (i >= propertyPath.length) return data;
                    path.append(propertyPath[i]);
            }
            if (type.equals(delegate)) break;
            i++;
            if (dmd != null) path.append('.');
        }
        String result = path.toString();
        if (!result.isEmpty()) {
            return result;
        }
        return data;
    }
1093883
public static <T> Supplier<T> memoizeLock(Supplier<T> delegate) {
        AtomicReference<T> value = new AtomicReference<>();
        return () -> {
            // A 2-field variant of Double Checked Locking.
            T val = value.get();
            if (val == null) {
                synchronized(value) {
                    val = value.get();
                    if (val == null) {
                        val = Objects.requireNonNull(delegate.get());
                        value.set(val);
                    }
                }
            }
            return val;
        };
    }
18510
public static Object stripShallow(Object decorated) {
        try {
            InjectableProperty delegateProperty = new ConfigClassAnalyzer(decorated.getClass()).getDelegateProperty();
            if (delegateProperty == null) {
                return decorated;
            } else {
                return delegateProperty.getValue(decorated);
            }
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
905238
@SuppressWarnings("unchecked")
	public static <T> T stripProxy(@Nullable final WrappingProxy<T> wrappingProxy) {
		if (wrappingProxy == null) {
			return null;
		}

		T delegate = wrappingProxy.getWrappedDelegate();

		int numProxiesStripped = 0;
		while (delegate instanceof WrappingProxy) {
			throwIfSafetyNetExceeded(++numProxiesStripped);
			delegate = ((WrappingProxy<T>) delegate).getWrappedDelegate();
		}

		return delegate;
	}
834476
private final MultimapSubject delegate() {
    MultimapSubject delegate = check().that(actual());
    if (internalCustomName() != null) {
      delegate = delegate.named(internalCustomName());
    }
    return delegate;
  }
1040193
function getDelegateFunction_(listener) {
  if (!delegateFunctionMap.has(listener)) {
    var delegateFunction =
      function(e) {
        e = e || window.event;
        var target = e.target || e.srcElement;
        target = target.nodeType === 3 ? target.parentNode : target;
        do {
          listener(target, e);
          if (target.parentNode) {
            target = target.parentNode;
          }
        } while (target.parentNode);
      };
    delegateFunctionMap.set(listener, delegateFunction);
  }
  return delegateFunctionMap.get(listener);
}
33106
function View() {
			Object.defineProperty(this, '__private', { writable: true, value: {}, });

			this.__private.isRenderRequested = false;

			var delegates = this.__private.eventDelegates = {};
			this.__private.onDelegatedEvent = function onDelegatedEvent(ev) {
				var delegatesForEvent = delegates[ev.type];
				var el = ev.target;
				for (var selectorStr in delegatesForEvent) {
					if (!elMatchesSelector(el, selectorStr)) { continue; }
					var delegatesForEventAndSelector = delegatesForEvent[selectorStr];
					for (var i = 0, n = delegatesForEventAndSelector.length; i < n; ++i) {
						delegatesForEventAndSelector[i](ev);
					}
				}
			};

			/**
			 * The root DOM element of the view. The default implementation of {@link module:bff/view#render} assigns to and updates this element. Delegated event listeners, created by calling {@link module:bff/view#listenTo} are attached to this element.
			 * Replacing the current element with another will clear all currently delegated event listeners - it is usually a better approach update the element (using e.g. {@link module:bff/patch-dom}) instead of replacing it.
			 * @instance
			 * @member {HTMLElement|undefined} el
			 */
			Object.defineProperty(this, 'el', {
				enumerable: true,
				get: function () { return this.__private.el; },
				set: function (el) {
					this.stopListening('*');
					this.__private.el = el;
				}
			});

			this.__private.childViews = new List();
			this.listenTo(this.__private.childViews, 'item:destroyed', function (childView) {
				this.__private.childViews.remove(childView);
			});

			/**
			 * A list of this view's child views. Initially empty.
			 * @instance
			 * @member {module:bff/list} children
			 */
			Object.defineProperty(this, 'children', {
				enumerable: true,
				get: function () { return this.__private.childViews; },
			});
		}
567305
protected void addDelegate (PlaceControllerDelegate delegate)
    {
        if (_delegates == null) {
            _delegates = Lists.newArrayList();
        }
        _delegates.add(delegate);
    }
88311
public Optional<Scoped> tryAcquirePersistingLock(long inodeId) {
    AtomicBoolean lock = mPersistingLocks.getUnchecked(inodeId);
    if (lock.compareAndSet(false, true)) {
      return Optional.of(() -> lock.set(false));
    }
    return Optional.empty();
  }
565989
private V putInternal(final K key, final V value) {
        final Map<K, V> delegate = new HashMap<>(this.delegate);
        V existing = delegate.put(key, value);
        this.delegate = delegate;
        return existing;
    }
1259486
private static Field[] getAllFields(Object delegate) {
		
		ArrayList<Field> fields = new ArrayList<Field>(Arrays.asList(delegate.getClass()
				.getDeclaredFields()));
		Class superClass = delegate.getClass().getSuperclass();
		while(superClass != null){
		
		if (superClass != null) {
			Field[] parentFields = superClass.getDeclaredFields();
			if (parentFields.length != 0) {
				fields.addAll(Arrays.asList(superClass
						.getDeclaredFields()));
			}
			
		}
		superClass = superClass.getSuperclass();
		}
		return fields.toArray(new Field[fields.size()]);

	}
234378
protected MethodVisitor makeDelegateCall(final String name, final String desc, final String signature, final String[] exceptions, final int accessFlags) {
        MethodVisitor mv = super.visitMethod(accessFlags, name, desc, signature, exceptions);
        mv.visitVarInsn(ALOAD, 0); // load this
        mv.visitFieldInsn(GETFIELD, proxyName, DELEGATE_OBJECT_FIELD, BytecodeHelper.getTypeDescription(delegateClass)); // load delegate
        // using InvokerHelper to allow potential intercepted calls
        int size;
        mv.visitLdcInsn(name); // method name
        Type[] args = Type.getArgumentTypes(desc);
        BytecodeHelper.pushConstant(mv, args.length);
        mv.visitTypeInsn(ANEWARRAY, "java/lang/Object");
        size = 6;
        int idx = 1;
        for (int i = 0; i < args.length; i++) {
            Type arg = args[i];
            mv.visitInsn(DUP);
            BytecodeHelper.pushConstant(mv, i);
            // primitive types must be boxed
            if (isPrimitive(arg)) {
                mv.visitIntInsn(getLoadInsn(arg), idx);
                String wrappedType = getWrappedClassDescriptor(arg);
                mv.visitMethodInsn(INVOKESTATIC, wrappedType, "valueOf", "(" + arg.getDescriptor() + ")L" + wrappedType + ";", false);
            } else {
                mv.visitVarInsn(ALOAD, idx); // load argument i
            }
            size = Math.max(size, 5+registerLen(arg));
            idx += registerLen(arg);
            mv.visitInsn(AASTORE); // store value into array
        }
        mv.visitMethodInsn(INVOKESTATIC, "org/codehaus/groovy/runtime/InvokerHelper", "invokeMethod", "(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object;", false);
        unwrapResult(mv, desc);
        mv.visitMaxs(size, registerLen(args) + 1);

        return mv;
    }
347865
function findDelegate(start) {
  let frag = start;
  let delegate, el;

  out: while (frag) {
    // find next element
    el = 0;
    while (!el && frag) {
      if (frag.owner.type === ELEMENT) el = frag.owner;
      if (frag.owner.ractive && frag.owner.ractive.delegate === false) break out;
      frag = frag.parent || frag.componentParent;
    }

    if (el.delegate === false) break out;
    delegate = el.delegate || el;

    // find next repeated fragment
    while (frag) {
      if (frag.iterations) break;
      if (frag.owner.ractive && frag.owner.ractive.delegate === false) break out;
      frag = frag.parent || frag.componentParent;
    }
  }

  return delegate;
}
764535
protected static void setUploadStatusDelegate(String uploadId, UploadStatusDelegate delegate) {
        if (delegate == null)
            return;

        uploadDelegates.put(uploadId, new WeakReference<>(delegate));
    }