Calls by derived instances when an oid adder method was called.
177440
protected void requestOidAdd (String name, OidList list, int oid)
    {
        // if we're on the authoritative server, we update the set immediately
        boolean applyImmediately = isAuthoritative();
        if (applyImmediately) {
            list.add(oid);
        }
        postEvent(new ObjectAddedEvent(_oid, name, oid).setAlreadyApplied(applyImmediately));
    }
303201
private static void addInternal(String name, ObjectIdentifier oid,
            Class clazz) {
        OIDInfo info = new OIDInfo(name, oid, clazz);
        oidMap.put(oid, info);
        nameMap.put(name, info);
    }
1265616
private static <T, G extends T> void generateDrawMethods(DexMaker dexMaker,
                                                             TypeId<G> generatedType,
                                                             TypeId<T> baseType) {
        generateDrawMethod(dexMaker, generatedType, baseType, ViewMethod.DRAW);
        generateDrawMethod(dexMaker, generatedType, baseType, ViewMethod.ON_DRAW);
    }
706291
private void lockAndRegisterReferences(ClassDescriptor cld, Object sourceObject, int lockMode, List registeredObjects) throws LockNotGrantedException
    {
        if (implicitLocking)
        {
            Iterator i = cld.getObjectReferenceDescriptors(true).iterator();
            while (i.hasNext())
            {
                ObjectReferenceDescriptor rds = (ObjectReferenceDescriptor) i.next();
                Object refObj = rds.getPersistentField().get(sourceObject);
                if (refObj != null)
                {
                    boolean isProxy = ProxyHelper.isProxy(refObj);
                    RuntimeObject rt = isProxy ? new RuntimeObject(refObj, this, false) : new RuntimeObject(refObj, this);
                    if (!registrationList.contains(rt.getIdentity()))
                    {
                        lockAndRegister(rt, lockMode, registeredObjects);
                    }
                }
            }
        }
    }
977102
private void baseInstanceModified() {
        ContextServiceImpl[] listeners;

        lock.writeLock().lock();
        try {
            listeners = modificationListeners.toArray(new ContextServiceImpl[modificationListeners.size()]);
            modificationListeners.clear();
            threadContextConfigurations = null;
        } finally {
            lock.writeLock().unlock();
        }

        for (ContextServiceImpl listener : listeners)
            listener.baseInstanceModified();
    }
834978
protected void store(Object obj, Identity oid, ClassDescriptor cld,  boolean insert)
    {
        store(obj, oid, cld, insert, false);
    }
857344
public static void addDeclaredMethodsFromInterfaces(ClassNode cNode, Map<String, MethodNode> methodsMap) {
        // add in unimplemented abstract methods from the interfaces
        for (ClassNode iface : cNode.getInterfaces()) {
            Map<String, MethodNode> ifaceMethodsMap = iface.getDeclaredMethodsMap();
            for (Map.Entry<String, MethodNode> entry : ifaceMethodsMap.entrySet()) {
                String methSig = entry.getKey();
                if (!methodsMap.containsKey(methSig)) {
                    methodsMap.put(methSig, entry.getValue());
                }
            }
        }
    }
386405
@Override
    public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope,
                             Scriptable thisObj, Object[] args)
    {
        if (!f.hasTag(getClassName())) {
            return super.execIdCall(f, cx, scope, thisObj, args);
        }
        int id = f.methodId();
        switch (id) {
        case Id_constructor:
            return js_constructor(args);
        case Id_getInt8:
            return realThis(thisObj, f).js_getInt(1, true, args);
        case Id_getUint8:
            return realThis(thisObj, f).js_getInt(1, false, args);
        case Id_getInt16:
            return realThis(thisObj, f).js_getInt(2, true, args);
        case Id_getUint16:
            return realThis(thisObj, f).js_getInt(2, false, args);
        case Id_getInt32:
            return realThis(thisObj, f).js_getInt(4, true, args);
        case Id_getUint32:
            return realThis(thisObj, f).js_getInt(4, false, args);
        case Id_getFloat32:
            return realThis(thisObj, f).js_getFloat(4, args);
        case Id_getFloat64:
            return realThis(thisObj, f).js_getFloat(8, args);
        case Id_setInt8:
            realThis(thisObj, f).js_setInt(1, true, args);
            return Undefined.instance;
        case Id_setUint8:
            realThis(thisObj, f).js_setInt(1, false, args);
            return Undefined.instance;
        case Id_setInt16:
            realThis(thisObj, f).js_setInt(2, true, args);
            return Undefined.instance;
        case Id_setUint16:
            realThis(thisObj, f).js_setInt(2, false, args);
            return Undefined.instance;
        case Id_setInt32:
            realThis(thisObj, f).js_setInt(4, true, args);
            return Undefined.instance;
        case Id_setUint32:
            realThis(thisObj, f).js_setInt(4, false, args);
            return Undefined.instance;
        case Id_setFloat32:
            realThis(thisObj, f).js_setFloat(4, args);
            return Undefined.instance;
        case Id_setFloat64:
            realThis(thisObj, f).js_setFloat(8, args);
            return Undefined.instance;
        }
        throw new IllegalArgumentException(String.valueOf(id));
    }
1106125
private void rewriteAliasReferences(Name aliasingName, Ref aliasingRef, Set<AstChange> newNodes) {
    List<Ref> refs = new ArrayList<>(aliasingName.getRefs());
    for (Ref ref : refs) {
      switch (ref.type) {
        case SET_FROM_GLOBAL:
          continue;
        case DIRECT_GET:
        case ALIASING_GET:
        case PROTOTYPE_GET:
        case CALL_GET:
        case SUBCLASSING_GET:
          if (ref.getTwin() != null) {
            // The reference is the left-hand side of a nested assignment. This means we store two
            // separate 'twin' Refs with the same node of types ALIASING_GET and SET_FROM_GLOBAL.
            // For example, the read of `c.d` has a twin reference in
            //   a.b = c.d = e.f;
            // We handle this case later.
            checkState(ref.type == Type.ALIASING_GET, ref);
            break;
          }
          if (ref.getNode().isStringKey()) {
            // e.g. `y` in `const {y} = x;`
            DestructuringGlobalNameExtractor.reassignDestructringLvalue(
                ref.getNode(), aliasingRef.getNode().cloneTree(), newNodes, ref, compiler);
          } else {
            // e.g. `x.y`
            checkState(ref.getNode().isGetProp() || ref.getNode().isName());
            Node newNode = aliasingRef.getNode().cloneTree();
            Node node = ref.getNode();
            node.replaceWith(newNode);
            compiler.reportChangeToEnclosingScope(newNode);
            newNodes.add(new AstChange(ref.module, ref.scope, newNode));
          }
          aliasingName.removeRef(ref);
          break;
        default:
          throw new IllegalStateException();
      }
    }
  }
807063
private void performDeletion(final ClassDescriptor cld, final Object obj, final Identity oid, final boolean ignoreReferences) throws PersistenceBrokerException
    {
            // 1. delete dependend collections
            if (!ignoreReferences  && cld.getCollectionDescriptors().size() > 0)
            {
                deleteCollections(obj, cld.getCollectionDescriptors());
            }
            // 2. delete object from directly mapped table
            try
            {
                dbAccess.executeDelete(cld, obj); // use obj not oid to delete, BRJ
            }
            catch(OptimisticLockException e)
            {
                // ensure that the outdated object be removed from cache
                objectCache.remove(oid);
                throw e;
            }

            // 3. Add OID to the set of deleted objects
            deletedDuringTransaction.add(oid);

            // 4. delete dependend upon objects last to avoid FK violations
            if (cld.getObjectReferenceDescriptors().size() > 0)
            {
                deleteReferences(cld, obj, oid, ignoreReferences);
            }
            // remove obj from the object cache:
            objectCache.remove(oid);
    }
163686
function() {
		// "this" is the prototype now when called with apply()

		// make sure the version is set correctly, depending on the used ODataModel
		var iModelVersion = AnalyticalVersionInfo.getVersion(this);

		// ensure only ODataModel are enhanced which have not been enhanced yet
		if (iModelVersion === AnalyticalVersionInfo.NONE || this.getAnalyticalExtensions) {
			return;
		}

		// Keep a reference on the bindList and bindTree function before applying the Adapter-Functions,
		// this way the old functions do not get lost and the correct one is used for "prototype" calls.
		// Previously only the ODataModel V1 prototype functions would get called
		this._mPreadapterFunctions = {
			bindList: this.bindList,
			bindTree: this.bindTree
		};

		// apply the methods of the adapters prototype to the ODataModelAdapter instance
		for (var fn in ODataModelAdapter.prototype) {
			if (ODataModelAdapter.prototype.hasOwnProperty(fn)) {
				this[fn] = ODataModelAdapter.prototype[fn];
			}
		}

		//initialise the Analytical Extension during the metadata loaded Event of the v2.ODataModel
		/*if (iModelVersion === AnalyticalVersionInfo.V2 && !(this.oMetadata && this.oMetadata.isLoaded())) {
			var that = this;
			this.attachMetadataLoaded(function () {
				Log.info("ODataModelAdapter: Running on ODataModel V2, Metadata was loaded; initialising analytics model.");
				that.getAnalyticalExtensions();
			});
		}*/

		// disable the count support (inline count is required for AnalyticalBinding)
		if (iModelVersion === AnalyticalVersionInfo.V1 && this.isCountSupported()) {
			Log.info("ODataModelAdapter: switched ODataModel to use inlinecount (mandatory for the AnalyticalBinding)");
			this.setCountSupported(false);
		}

	}
953748
private void handleMainMethodIfPresent(List methods) {
        boolean found = false;
        for (Iterator iter = methods.iterator(); iter.hasNext();) {
            MethodNode node = (MethodNode) iter.next();
            if(node.getName().equals("main")) {
                if (node.isStatic() && node.getParameters().length == 1) {
                    boolean retTypeMatches, argTypeMatches;
                    ClassNode argType = node.getParameters()[0].getType();
                    ClassNode retType = node.getReturnType();

                    argTypeMatches = (argType.equals(ClassHelper.OBJECT_TYPE) || argType.getName().contains("String[]"));
                    retTypeMatches = (retType == ClassHelper.VOID_TYPE || retType == ClassHelper.OBJECT_TYPE);
                    
                    if(retTypeMatches && argTypeMatches) {
                        if(found) {
                            throw new RuntimeException("Repetitive main method found.");
                        } else {
                            found = true;
                        }
                        // if script has both loose statements as well as main(), then main() is ignored
                        if(statementBlock.isEmpty()) {
                            addStatement(node.getCode());
                        }
                        iter.remove();
                    }
                }
            }
        }
    }
1292644
private void checkIDEGeneratedParmNames(JavaClass cls) {
		for (Method m : cls.getMethods()) {
			if (isIDEGeneratedMethodWithCode(m)) {
				bugReporter.reportBug(
						new BugInstance(this, BugType.IMC_IMMATURE_CLASS_IDE_GENERATED_PARAMETER_NAMES.name(),
								NORMAL_PRIORITY).addClass(cls).addMethod(cls, m));
				return;
			}
		}
	}
621602
@Override
	public void visitMethodInsn(final int opcode, final String owner, final String name, final String desc,
			boolean itf) {
		// If this is an invokespecial, first determine if it is the one of interest (the one calling our super constructor)
		if (opcode == INVOKESPECIAL && name.charAt(0) == '<') {
			if (unitializedObjectsCount != 0) {
				unitializedObjectsCount--;
			}
			else {
				// This looks like our INVOKESPECIAL
				if (state == preInvokeSpecial) {
					// special case for calling jlObject, do nothing!
					if (owner.equals("java/lang/Object")) {
						mv.visitInsn(POP);
					}
					else {
						// Need to replace this INVOKESPECIAL call.
						String supertypename = typeDescriptor.getSupertypeName();
						ReloadableType superRtype = typeDescriptor.getReloadableType().getTypeRegistry().getReloadableSuperType(
								supertypename);
						if (superRtype == null) {
							// supertype was not reloadable.  This either means it really isn't (doesn't match what we consider reloadable)
							// or it just hasn't been loaded yet.
							// In a real scenario supertypes will get loaded first always and this can't happen (the latter case) - it happens in tests
							// because they don't actively load all their bits and pieces in a hierarchical way.  Given that on a reloadable boundary
							// the magic ctors are setup to call a default ctor, we can assume that above the boundary the object has been initialized.
							// this means we don't need to call a super __init__ or __execute...
							/*
																	if (typeDescriptor.getReloadableType().getTypeRegistry().isReloadableTypeName(supertypename)) {
																					superRtype = typeDescriptor.getReloadableType().getTypeRegistry()
																								.getReloadableSuperType(supertypename);
																						throw new IllegalStateException("The supertype " + supertypename.replace('/', '.')
																								+ " has not been loaded as a reloadabletype");
																					}
																					*/
							Utils.insertPopsForAllParameters(mv, desc);
							mv.visitInsn(POP); // pop 'this'
						}
						else {
							// Check the original form of the supertype for a constructor to call
							MethodMember existingCtor = (superRtype == null ? null
									: superRtype.getTypeDescriptor().getConstructor(
											desc));
							if (existingCtor == null) {
								// It did not exist in the original supertype version, need to use dynamic dispatch method
								// collapse the arguments on the stack
								Utils.collapseStackToArray(mv, desc);
								// now the stack is the instance then the params
								mv.visitInsn(SWAP);
								mv.visitInsn(DUP_X1);
								// no stack is instance then params then instance
								mv.visitLdcInsn("<init>" + desc);
								mv.visitMethodInsn(INVOKESPECIAL, typeDescriptor.getSupertypeName(),
										mDynamicDispatchName,
										mDynamicDispatchDescriptor, false);
								mv.visitInsn(POP);
							}
							else {
								// it did exist in the original, so there will be parallel constructor
								mv.visitMethodInsn(INVOKESPECIAL, typeDescriptor.getSupertypeName(), mInitializerName,
										desc, false);
							}
						}
					}

					state = postInvokeSpecial;

					return;
				}
			}
		}
		// Is it a private method call?
		// TODO r$ check here because we use invokespecial to avoid virtual dispatch on field changes...
		if (opcode == INVOKESPECIAL && name.charAt(0) != '<' && owner.equals(classname) && !name.startsWith("r$")) {
			// leaving the invokespecial alone will cause a verify error
			String descriptor = Utils.insertExtraParameter(owner, desc);
			super.visitMethodInsn(INVOKESTATIC, Utils.getExecutorName(classname, suffix), name, descriptor, false);
		}
		else {
			boolean done = false;
			// TODO dup of code in method copier - can we refactor?
			if (opcode == INVOKESTATIC) {
				MethodMember mm = typeDescriptor.getByDescriptor(name, desc);
				if (mm != null && mm.isPrivate()) {
					super.visitMethodInsn(INVOKESTATIC, Utils.getExecutorName(classname, suffix), name, desc, false);
					done = true;
				}
			}
			if (!done) {
				super.visitMethodInsn(opcode, owner, name, desc, itf);
			}
		}
	}
115348
private static Method[] getDeclaredMethods(Class<?> clazz) {
		Method[] result = declaredMethodsCache.get(clazz);
		if (result == null) {
			result = clazz.getDeclaredMethods();
			declaredMethodsCache.put(clazz, result);
		}
		return result;
	}
483876
private void processObjectCreateCall(Node callNode) {
    Node curParam = callNode.getSecondChild();
    if (canOptimizeObjectCreate(curParam)) {
      Node objNode = IR.objectlit().srcref(callNode);
      while (curParam != null) {
        Node keyNode = curParam;
        Node valueNode = curParam.getNext();
        curParam = valueNode.getNext();

        callNode.removeChild(keyNode);
        callNode.removeChild(valueNode);

        addKeyValueToObjLit(objNode, keyNode, valueNode);
      }
      callNode.replaceWith(objNode);
      compiler.reportChangeToEnclosingScope(objNode);
    }
  }
762133
private ArrayList handleDependentCollections(Identity oid, Object obj,
            Object[] origCollections, Object[] newCollections,
            Object[] newCollectionsOfObjects)
            throws LockingException
    {
        ClassDescriptor mif = _pb.getClassDescriptor(obj.getClass());
        Collection colDescs = mif.getCollectionDescriptors();
        ArrayList newObjects = new ArrayList();
        int count = 0;

        for (Iterator it = colDescs.iterator(); it.hasNext(); count++)
        {
            CollectionDescriptor cds = (CollectionDescriptor) it.next();

            if (cds.getOtmDependent())
            {
                ArrayList origList = (origCollections == null ? null
                                        : (ArrayList) origCollections[count]);
                ArrayList newList = (ArrayList) newCollections[count];

                if (origList != null)
                {
                    for (Iterator it2 = origList.iterator(); it2.hasNext(); )
                    {
                        Identity origOid = (Identity) it2.next();

                        if ((newList == null) || !newList.contains(origOid))
                        {
                            markDelete(origOid, oid, true);
                        }
                    }
                }

                if (newList != null)
                {
                    int countElem = 0;
                    for (Iterator it2 = newList.iterator(); it2.hasNext(); countElem++)
                    {
                        Identity newOid = (Identity) it2.next();

                        if ((origList == null) || !origList.contains(newOid))
                        {
                            ContextEntry entry = (ContextEntry) _objects.get(newOid);

                            if (entry == null)
                            {
                                ArrayList relCol = (ArrayList)
                                        newCollectionsOfObjects[count];
                                Object relObj = relCol.get(countElem);
                                insertInternal(newOid, relObj, LockType.WRITE_LOCK,
                                               true, null, new Stack());
                                newObjects.add(newOid);
                            }
                        }
                    }
                }
            }
        }

        return newObjects;
    }