TODO: Should we also do UnicastRemoteObject.unexportObject(this, true)?
332423
@Override
    public void terminate() throws RemoteException
    {
        furnace.stop();
        try
        {
            Thread.sleep(5000);
        }
        catch (InterruptedException e)
        {
        }
        Runtime.getRuntime().halt(1);
    }
322263
private void unmarshalWithExplodedStrategy(EmbeddedMetadata embeddedMetadata, Object target)
      throws Throwable {
    Object embeddedObject = initializeEmbedded(embeddedMetadata, target);
    for (PropertyMetadata propertyMetadata : embeddedMetadata.getPropertyMetadataCollection()) {
      unmarshalProperty(propertyMetadata, embeddedObject);
    }
    for (EmbeddedMetadata embeddedMetadata2 : embeddedMetadata.getEmbeddedMetadataCollection()) {
      unmarshalWithExplodedStrategy(embeddedMetadata2, embeddedObject);
    }
    ConstructorMetadata constructorMetadata = embeddedMetadata.getConstructorMetadata();
    if (constructorMetadata.isBuilderConstructionStrategy()) {
      embeddedObject = constructorMetadata.getBuildMethodHandle().invoke(embeddedObject);
    }
    embeddedMetadata.getWriteMethod().invoke(target, embeddedObject);
  }
246793
function unop(
  { value: value }: StackLocal,
  operation: Operation,
  createValue: any => StackLocal
): StackLocal {
  switch (operation) {
    case "abs":
      return createValue(value.abs());

    case "neg":
      return createValue(value.neg());

    case "clz":
      return createValue(value.clz());

    case "ctz":
      return createValue(value.ctz());

    case "popcnt":
      return createValue(value.popcnt());

    case "eqz":
      return i32.createValue(value.eqz());

    case "reinterpret/f32":
      return i32.createValue(value.reinterpret());

    case "reinterpret/f64":
      return i64.createValue(value.reinterpret());
  }

  throw new Error("Unsupported unop: " + operation);
}
690658
private void unmarshalKeyAndParentKey() throws Throwable {
    KeyMetadata keyMetadata = entityMetadata.getKeyMetadata();
    if (keyMetadata != null) {
      MethodHandle writeMethod = keyMetadata.getWriteMethod();
      Key entityKey = (Key) nativeEntity.getKey();
      writeMethod.invoke(entity, new DefaultDatastoreKey(entityKey));
    }

    ParentKeyMetadata parentKeyMetadata = entityMetadata.getParentKeyMetadata();
    if (parentKeyMetadata != null) {
      MethodHandle writeMethod = parentKeyMetadata.getWriteMethod();
      Key parentKey = nativeEntity.getKey().getParent();
      if (parentKey != null) {
        writeMethod.invoke(entity, new DefaultDatastoreKey(parentKey));
      }
    }
  }
1135193
@Override
  public boolean isExported(String name, boolean local) {
    return super.isExported(name, local) || (!local && name.startsWith("_"));
  }
805667
function hasUnusableRecordIdentifier(recState) {
  const md5s = recState.md5s;
  return isNotBlank(recState.eventID) || // isNotBlank(recState.eventSeqNo) || isNotBlank(recState.eventSubSeqNo) ||
    (md5s && (isNotBlank(md5s.userRec) || isNotBlank(md5s.rec) || isNotBlank(md5s.data)));
}
208407
@Subscribe
    public void undispatched(DeadEvent e) {
        if (!m_done.get() && e.getEvent() instanceof ImporterChannelAssignment) {
            ImporterChannelAssignment assignment = (ImporterChannelAssignment)e.getEvent();

            synchronized (m_undispatched) {
                NavigableSet<String> registered = m_callbacks.getReference().navigableKeySet();
                NavigableSet<String> unregistered = m_unregistered.getReference();
                if (registered.contains(assignment.getImporter())) {
                    m_eb.post(assignment);
                } else if (!assignment.getAdded().isEmpty()
                        && unregistered.contains(assignment.getImporter())) {
                    LOG.warn("(" + m_hostId
                            + ") disgarding assignment to unregistered importer "
                            + assignment);
                } else {
                    m_undispatched.add(assignment);
                }
            }
        }
    }
70626
IPortletDefinition unmarshall(ExternalPortletDefinition epd) {

        final PortletDescriptor portletDescriptor = epd.getPortletDescriptor();
        final Boolean isFramework = portletDescriptor.isIsFramework();

        if (isFramework != null
                && isFramework
                && "UPGRADED_CHANNEL_IS_NOT_A_PORTLET".equals(portletDescriptor.getPortletName())) {
            if (errorOnChannel) {
                throw new IllegalArgumentException(
                        epd.getFname()
                                + " is not a portlet. It was likely an IChannel from a previous version of uPortal and cannot be imported.");
            }

            logger.warn(
                    epd.getFname()
                            + " is not a portlet. It was likely an IChannel from a previous version of uPortal and will not be imported.");
            return null;
        }

        // get the portlet type
        final IPortletType portletType = portletTypeRegistry.getPortletType(epd.getType());
        if (portletType == null) {
            throw new IllegalArgumentException("No portlet type registered for: " + epd.getType());
        }

        final String fname = epd.getFname();
        IPortletDefinition rslt = portletDefinitionDao.getPortletDefinitionByFname(fname);
        if (rslt == null) {
            rslt =
                    new PortletDefinitionImpl(
                            portletType,
                            fname,
                            epd.getName(),
                            epd.getTitle(),
                            portletDescriptor.getWebAppName(),
                            portletDescriptor.getPortletName(),
                            isFramework != null ? isFramework : false);
        } else {
            final IPortletDescriptorKey portletDescriptorKey = rslt.getPortletDescriptorKey();
            portletDescriptorKey.setPortletName(portletDescriptor.getPortletName());
            if (isFramework != null && isFramework) {
                portletDescriptorKey.setFrameworkPortlet(true);
                portletDescriptorKey.setWebAppName(null);
            } else {
                portletDescriptorKey.setFrameworkPortlet(false);
                portletDescriptorKey.setWebAppName(portletDescriptor.getWebAppName());
            }
            rslt.setName(epd.getName());
            rslt.setTitle(epd.getTitle());
            rslt.setType(portletType);
        }

        rslt.setDescription(epd.getDesc());
        final BigInteger timeout = epd.getTimeout();
        if (timeout != null) {
            rslt.setTimeout(timeout.intValue());
        }
        final BigInteger actionTimeout = epd.getActionTimeout();
        if (actionTimeout != null) {
            rslt.setActionTimeout(actionTimeout.intValue());
        }
        final BigInteger eventTimeout = epd.getEventTimeout();
        if (eventTimeout != null) {
            rslt.setEventTimeout(eventTimeout.intValue());
        }
        final BigInteger renderTimeout = epd.getRenderTimeout();
        if (renderTimeout != null) {
            rslt.setRenderTimeout(renderTimeout.intValue());
        }
        final BigInteger resourceTimeout = epd.getResourceTimeout();
        if (resourceTimeout != null) {
            rslt.setResourceTimeout(resourceTimeout.intValue());
        }

        unmarshallLifecycle(epd.getLifecycle(), rslt);

        final Set<IPortletDefinitionParameter> parameters = new LinkedHashSet<>();
        for (ExternalPortletParameter param : epd.getParameters()) {
            parameters.add(new PortletDefinitionParameterImpl(param.getName(), param.getValue()));
        }
        rslt.setParameters(parameters);

        final ArrayList<IPortletPreference> preferenceList = new ArrayList<>();
        for (ExternalPortletPreference pref : epd.getPortletPreferences()) {
            final List<String> valueList = pref.getValues();
            final String[] values = valueList.toArray(new String[valueList.size()]);

            final Boolean readOnly = pref.isReadOnly();
            preferenceList.add(
                    new PortletPreferenceImpl(
                            pref.getName(), readOnly != null ? readOnly : false, values));
        }
        rslt.setPortletPreferences(preferenceList);

        return rslt;
    }
1185834
function findExportedObject(ast, recast) {
  let objPath
  recast.visit(ast, {
    visitAssignmentExpression: function(path) {
      if (!objPath && docgen.utils.isExportsOrModuleAssignment(path)) {
        objPath = docgen.utils.resolveToValue(path.get('right'))
      }
      return false
    },
  })

  if (objPath) {
    // Hack: This is easier than replicating the default propType
    // handler.
    // This converts any expression, e.g. `foo` to an object expression of
    // the form `{propTypes: foo}`
    const b = recast.types.builders
    const nt = recast.types.namedTypes
    let obj = objPath.node

    // Hack: This is converting calls like
    //
    //    Object.apply(Object.create(foo), { bar: 42 })
    //
    // to an AST representing an object literal:
    //
    //    { ...foo, bar: 42 }
    if (
      nt.CallExpression.check(obj) &&
      recast.print(obj.callee).code === 'Object.assign'
    ) {
      obj = objPath.node.arguments[1]
      let firstArg = objPath.node.arguments[0]
      if (recast.print(firstArg.callee).code === 'Object.create') {
        firstArg = firstArg.arguments[0]
      }
      obj.properties.unshift(b.spreadProperty(firstArg))
    }

    objPath.replace(
      b.objectExpression([b.property('init', b.literal('propTypes'), obj)])
    )
  }
  return objPath
}
970517
public static Object unwrap( Object obj )
    {
        // map voids to nulls for the outside world
        if (obj == Primitive.VOID)
            return null;

        // unwrap primitives
        if (obj instanceof Primitive)
            return((Primitive)obj).getValue();

        return obj;
    }
65340
function findObject(c, obj, path, alreadyParsed) {
    if (!path) {
        path = [];
    }

    // Recursive reference : boooh, very wrong
    if (!alreadyParsed) {
        alreadyParsed = [];
    }
    var keys = Object.keys(obj);
    alreadyParsed.push(obj);
    for (var key = 0; key < keys.length; key++) {
        var i = keys[key];
        if (i == "NativeModule" && isElectron) {
            break;
        }
        if (obj[i] === c) {
            path.push(i);
            return path;
        } else if (["object", "function"].indexOf(typeof(obj[i])) >= 0 && alreadyParsed.indexOf(obj[i]) == -1 && obj[i] !== null && obj[i] !== undefined) {
            path.push(i);
            var founded = findObject(c, obj[i], path, alreadyParsed);
            if (founded) {
                return founded;
            } else {
                path.pop();
            }
        }
    };
    return null;
}
601350
@Override
    public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException {
	try {
	    out.writeObject(new HashMap(this));
	}
	catch (NotSerializableException nse) {
	    NotSerializableException tmp = new NotSerializableException(nse.getMessage() + ":" + entries());
	    tmp.initCause(nse);
	    throw tmp;
	}
    }
702704
@SuppressWarnings("unchecked")
    protected void initExportObject() {

        try {
            if (CmsStringUtil.isEmpty(getParamAction()) || CmsDialog.DIALOG_INITIAL.equals(getParamAction())) {
                // create a new list
                setGroups(new ArrayList<CmsGroup>());
                setRoles(new ArrayList<CmsRole>());
            } else {
                // this is not the initial call, get the message info object from session
                setGroups((List<CmsGroup>)((Map<?, ?>)getDialogObject()).get("groups"));
                setRoles((List<CmsRole>)((Map<?, ?>)getDialogObject()).get("roles"));
            }
        } catch (Exception e) {
            // create a new list
            setGroups(new ArrayList<CmsGroup>());
            setRoles(new ArrayList<CmsRole>());
        }
    }
1254746
public boolean isUserExport(String userName) {

        if (CmsStringUtil.isEmptyOrWhitespaceOnly(userName)) {
            return false;
        }
        return m_userExport.equals(userName);
    }
58992
function isEmptyObject(item) {
  if (item === undefined || item === null) {
    return false;
  }

  return (Object.keys(item).length === 0 && JSON.stringify(item) === JSON.stringify({}));
}
1036065
protected IPortletEntity unwrapEntity(IPortletEntity portletEntity) {
        if (portletEntity instanceof TransientPortletEntity) {
            return ((TransientPortletEntity) portletEntity).getDelegatePortletEntity();
        }

        return portletEntity;
    }
206057
@Override public void onRestoreInstanceState(Parcelable state) {
    if (isInEditMode) return;

    if (!(state instanceof MosbyViewStateSavedState)) {
      delegateCallback.superOnRestoreInstanceState(state);
      return;
    }

    MosbyViewStateSavedState savedState = (MosbyViewStateSavedState) state;
    mosbyViewId = savedState.getMosbyViewId();
    restoreableParcelableViewState = (VS) savedState.getRestoreableViewState();
    delegateCallback.superOnRestoreInstanceState(savedState.getSuperState());
  }