with a new MCWrapper.  The fromMCWrapper can be null - needed for SmartHandle support.
8259
private void reassociateConnectionHandle(Object connection,
                                             MCWrapper fromMCWrapper,
                                             MCWrapper toMCWrapper,
                                             UOWCoordinator uowCoord) throws ResourceException {

        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(this, tc, "reassociateConnectionHandle");

        try {
            toMCWrapper.associateConnection(connection, fromMCWrapper);
        } catch (ResourceException e) {

            /*
             * If the Resource Adapter throws a ResourceException and we are not in a
             * transaction and there are no other connections open on the ManagedConnection,
             * return the ManagedConnection to the pool before
             * rethrowing the exception. The ManagedConnection is probably OK - the exception
             * may only be a logon failure or similar so the MC shouldn't be 'lost'.
             *
             * If we are in a transaction, just throw the exception. Assume we will cleanup during
             * the aftercompletion call on the tran wrapper.
             */

            com.ibm.ws.ffdc.FFDCFilter.processException(e, "com.ibm.ejs.j2c.ConnectionManager.reassociateConnectionHandle", "479", this);
            if (uowCoord == null && toMCWrapper.getHandleCount() == 0) {
                try {
                    toMCWrapper.releaseToPoolManager();
                } catch (Exception exp) { // don't rethrow, already on exception path
                    com.ibm.ws.ffdc.FFDCFilter.processException(exp, "com.ibm.ejs.j2c.ConnectionManager.reassociateConnectionHandle", "487", this);
                    //if (TraceComponent.isAnyTracingEnabled()  && tc.isDebugEnabled())
                    Tr.error(tc, "FAILED_CONNECTION_RELEASE_J2CA0022", new Object[] { exp, toMCWrapper.gConfigProps.cfName });
                }
            }
            throw e;
        } catch (java.lang.Exception e) {
            com.ibm.ws.ffdc.FFDCFilter.processException(e,
                                                        "com.ibm.ejs.j2c.ConnectionManager.reassociateConnectionHandle",
                                                        "495", this);
            if (isTraceOn && tc.isDebugEnabled()) {
                Tr.debug(this, tc, "reassociateConnectionHandle: Caught a Non resource exception from mc.associateConnection()");
            }
            Tr.error(tc, "FAILED_CONNECTION_J2CA0021", new Object[] { e, toMCWrapper.gConfigProps.cfName });
            /*
             * If the Resource Adapter throws an Exception and we are not in a
             * transaction and there are no other connections open on the ManagedConnection,
             * return the ManagedConnection to the pool before
             * rethrowing the exception. The ManagedConnection is probably OK - the exception
             * may only be a logon failure or similar so the MC shouldn't be 'lost'.
             *
             * If we are in a transaction, just throw the exception. Assume we will cleanup during
             * the aftercompletion call on the tran wrapper.
             */

            if (uowCoord == null && toMCWrapper.getHandleCount() == 0) {
                try {
                    toMCWrapper.releaseToPoolManager();
                } catch (Exception exp) { // don't rethrow, already on exception path
                    com.ibm.ws.ffdc.FFDCFilter.processException(exp,
                                                                "com.ibm.ejs.j2c.ConnectionManager.reassociateConnectionHandle",
                                                                "518", this);
                    //if (TraceComponent.isAnyTracingEnabled()  && tc.isDebugEnabled())
                    Tr.error(tc, "FAILED_CONNECTION_RELEASE_J2CA0022", new Object[] { exp, toMCWrapper.gConfigProps.cfName });
                }
            }
            ResourceException re = new ResourceException("reassociateConnectionHandle: caught Exception");
            re.initCause(e);
            throw re;
        }

        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(this, tc, "reassociateConnectionHandle");

    }
851831
function typeCreateHandler(docObject, newScope) {
		
		docObject && addDocObjectToDocMap(docObject, docMap, filename, comment && comment.line);
		if (newScope) {
			scope = newScope;
		}
	}
1298431
private Constructor<T> getWrapper() {
        Class<T> clazz;
        synchronized (cWrapperCache) {
            clazz = (Class<T>) cWrapperCache.get(mType);
            if (clazz == null) {
                clazz = createWrapper();
                cWrapperCache.put(mType, clazz);
            }
        }

        try {
            return clazz.getConstructor(AtomicReference.class);
        } catch (NoSuchMethodException e) {
            ThrowUnchecked.fire(e);
            return null;
        }
    }
495095
private TypeSpec getBinderWrapper() {
        TypeSpec.Builder staticBinderWrapperClassBuilder = TypeSpec
                .classBuilder("BinderWrapper")
                .addModifiers(Modifier.PRIVATE)
                .addModifiers(Modifier.STATIC)
                .addField(ClassName.get("android.os", "IBinder"), "binder", Modifier.PRIVATE)
                .addMethod(MethodSpec.constructorBuilder()
                        .addParameter(ClassName.get("android.os", "IBinder"), "binder")
                        .addStatement("this.binder = binder")
                        .build())
                .addMethod(MethodSpec.methodBuilder("asBinder")
                        .addModifiers(Modifier.PUBLIC)
                        .addAnnotation(Override.class)
                        .returns(ClassName.get("android.os", "IBinder"))
                        .addStatement("return binder")
                        .build())
                .addSuperinterface(ClassName.get("android.os", "IInterface"));

        return staticBinderWrapperClassBuilder.build();
    }
1057132
function(handle) {
        if (!isValidID(handle)) return null;

        var i, j, instance;
        for (i = 0, j = instances.length; i < j; i++) {
          instance = instances[i];
          if (instance.$$mdHandle === handle) {
            return instance;
          }
        }
        return null;
      }
672363
public static Object fromStorage(Object stored, Encoder encoder, Wrapper wrapper) {
      if (encoder == null || wrapper == null) {
         throw new IllegalArgumentException("Both Encoder and Wrapper must be provided!");
      }
      if (stored == null) return null;
      return encoder.fromStorage(wrapper.unwrap(stored));
   }
701281
public EntityInstanceWrapper buildInstanceWrapper(final Object instance) throws PMException {
        final EntityInstanceWrapper wrapper = new EntityInstanceWrapper(instance);
        if (hasEntity() && !getEntityContainer().isSelectedNew()) {
            wrapper.setInstanceId(getDataAccess().getInstanceId(this, wrapper));
        }
        return wrapper;
    }
1294777
protected MultiStringWrapper asMultiStringWrapper(StringWrapper w) 
	{
		if (w instanceof MultiStringWrapper) return (MultiStringWrapper)w;
		else 	{
			MultiStringWrapper mw = new MultiStringWrapper( w.unwrap(), innerLearners.length, delim);
			for (int i=0; i<mw.size(); i++) {
				mw.set(i, prepareForLearner( mw.get(i), innerLearners[mw.getDistanceLearnerIndex(i)] ) );
			}
			return mw;
		}
	}
866909
protected JCATranWrapper createWrapper(int timeout, Xid xid, JCARecoveryData jcard) throws WorkCompletedException /* @512190C*/
    {
        return new JCATranWrapperImpl(timeout, xid, jcard); // @D240298C
    }
1016594
protected MultiStringWrapper asMultiStringWrapper(StringWrapper w) {
		if (w instanceof MultiStringWrapper) return (MultiStringWrapper)w;
		else return (MultiStringWrapper)prepare(w.unwrap());
	}
773798
private Object createEmptyWrapper(Class<?> type) {
    if (Number.class.isAssignableFrom(type)) {
      Method method = ReflectionUtil.getDeclaredMethodBySignature(type, "valueOf", String.class);
      if (method != null && method.getReturnType() == type) {
        return ReflectionUtil.invokeMethod(type, method, "0");
      }
      if (type == BigInteger.class) return BigInteger.ZERO;
      if (type == BigDecimal.class) return BigDecimal.ZERO;
      return null;
    }
    if (type == Boolean.class) return false;
    if (type == Character.class) return (char) 0; // better return something else?
    return null;
  }
1008368
@SuppressWarnings("unchecked")
    @Override
    public <T> T onSingletonProviderInit(T provider, Object context, Message m) {
        if (context == null) {
            return null;
        }
        Map<Class<?>, ManagedObject<?>> newContext = (Map<Class<?>, ManagedObject<?>>) (context);
        if (newContext.isEmpty()) {
            return null;
        }
        ManagedObject<?> managedObject = newContext.get(provider.getClass());
        Object newProviderObject = null;
        if (managedObject == null) {
            newProviderObject = getInstanceFromManagedObject(provider, context);
        } else {
            newProviderObject = managedObject.getObject();
        }

        return (T) newProviderObject;
    }
128237
protected TranWrapper getCurrentTranWrapper() throws ResourceException {

        final boolean isTracingEnabled = TraceComponent.isAnyTracingEnabled();

        if (isTracingEnabled && tc.isEntryEnabled()) {
            Tr.entry(this, tc, "getCurrentTranWrapper");
        }

        // If the MCWrapper has not been completely initialized and we are working with an RA
        // that supports deferred enlistment of transactions, then let's re-initialize for the
        // UOW which we are already involved with.
        // This was a special fix that was put in for JMS Managed Sessions, but it
        // could apply to other internal connection types that might require this support.
        if ((state == STATE_ACTIVE_INUSE) && (gConfigProps.isDynamicEnlistmentSupported())) {
            if (isTracingEnabled && tc.isDebugEnabled()) {
                Tr.debug(this, tc, "State is STATE_ACTIVE_INUSE, calling initializeForUOW()...");
            }
            cm.initializeForUOW(this, true); // second parm indicates source of call is deferred enlistment.
        }

        if ((state != STATE_TRAN_WRAPPER_INUSE) && (state != STATE_ACTIVE_INUSE)) {
            IllegalStateException e = new IllegalStateException("getCurrentTranWrapper: illegal state exception. State = " + getStateString() + " MCW = "
                                                                + mcWrapperObject_hexString);
            Object[] parms = new Object[] { "getCurrentTranWrapper", e };
            Tr.error(tc, "ILLEGAL_STATE_EXCEPTION_J2CA0079", parms);
            throw e;
        }

        TranWrapper tranWrapper = null;
        switch (tranWrapperInUse) {
            case XATXWRAPPER:
                tranWrapper = xaTranWrapper;
                break;
            case LOCALTXWRAPPER:
                tranWrapper = localTranWrapper;
                break;
            case NOTXWRAPPER:
                tranWrapper = noTranWrapper;
                break;
            case RRSGLOBALTXWRAPPER:
                tranWrapper = rrsGlobalTranWrapper;
                break;
            case RRSLOCALTXWRAPPER:
                tranWrapper = rrsLocalTranWrapper;
                break;
            default:
                // Need RAS and Trace here.
                IllegalStateException e = new IllegalStateException("getCurrentTranWrapper: illegal transaction state exception. State = "
                                                                    + getTranWrapperString());
                Object[] parms = new Object[] { "getCurrentTranWrapper", e };
                Tr.error(tc, "ILLEGAL_STATE_EXCEPTION_J2CA0079", parms);
                throw e;
        }

        if (isTracingEnabled && tc.isEntryEnabled()) {
            Tr.exit(this, tc, "getCurrentTranWrapper", getTranWrapperString());
        }

        return tranWrapper;
    }
1152928
@Override
    public final EJSWrapperCommon getWrapper(BeanId id) // f111627
    throws CSIException, RemoteException
    {
        return container.getWrapper(id);
    }
672585
private static Wrapper resolveAmbiguousWrapper(Set<Wrapper> candidates,
            Class<?>[] paramTypes) {
        // Identify which parameter isn't an exact match
        Wrapper w = candidates.iterator().next();

        int nonMatchIndex = 0;
        Class<?> nonMatchClass = null;

        for (int i = 0; i < paramTypes.length; i++) {
            if (w.getParameterTypes()[i] != paramTypes[i]) {
                nonMatchIndex = i;
                nonMatchClass = paramTypes[i];
                break;
            }
        }

        for (Wrapper c : candidates) {
           if (c.getParameterTypes()[nonMatchIndex] ==
                   paramTypes[nonMatchIndex]) {
               // Methods have different non-matching parameters
               // Result is ambiguous
               return null;
           }
        }

        if (nonMatchClass == null) {
            // Since null is ambiguous, return the most general method, if possible.
            Class<?> mostGeneralType = null;
            Wrapper mostGeneralMethod = null;
            boolean generalMatchFound = false;
            for (Wrapper c : candidates) {
                Class<?> candidateType = c.getParameterTypes()[nonMatchIndex];
                if (mostGeneralType == null) {
                    mostGeneralType = candidateType;
                    mostGeneralMethod = c;
                } else if (candidateType.isAssignableFrom(mostGeneralType)) {
                    mostGeneralType = candidateType;
                    mostGeneralMethod = c;
                    generalMatchFound = true;
                } else if (mostGeneralType.isAssignableFrom(candidateType)) {
                    generalMatchFound = true;
                }
            }
            if (generalMatchFound) {
                return mostGeneralMethod;
            } else {
                // Could not determine the most general method
                return null;
            }
        }

        // Can't be null
        Class<?> superClass = nonMatchClass.getSuperclass();
        while (superClass != null) {
            for (Wrapper c : candidates) {
                if (c.getParameterTypes()[nonMatchIndex].equals(superClass)) {
                    // Found a match
                    return c;
                }
            }
            superClass = superClass.getSuperclass();
        }

        // Treat instances of Number as a special case
        Wrapper match = null;
        if (Number.class.isAssignableFrom(nonMatchClass)) {
            for (Wrapper c : candidates) {
                Class<?> candidateType = c.getParameterTypes()[nonMatchIndex];
                if (Number.class.isAssignableFrom(candidateType) ||
                        candidateType.isPrimitive()) {
                    if (match == null) {
                        match = c;
                    } else {
                        // Match still ambiguous
                        match = null;
                        break;
                    }
                }
            }
        }

        return match;
    }
758640
static TagFiller parseTagParameter(String wrappedParameter, String trimmedParameter) {
    if (trimmedParameter.equals(PARAMETER_TAG)) {
      return new TagFiller(wrappedParameter, trimmedParameter);
    }
    return null;
  }
943001
public static TerribleFailureHandler setWtfHandler(TerribleFailureHandler handler) {
        if (handler == null) {
            throw new NullPointerException("handler == null");
        }
        TerribleFailureHandler oldHandler = sWtfHandler;
        sWtfHandler = handler;
        return oldHandler;
    }