Uses the raw {@link StateLocalInputSUL} to infer a (potentially) partial {@link MealyMachine}.
482714
static void runPartialLearner(boolean withCache) {

        // setup SULs and counters
        StateLocalInputSUL<Integer, Character> target = SUL;

        ResetCounterStateLocalInputSUL<Integer, Character> resetCounter =
                new ResetCounterStateLocalInputSUL<>("Resets", target);
        SymbolCounterStateLocalInputSUL<Integer, Character> symbolCounter =
                new SymbolCounterStateLocalInputSUL<>("Symbols", resetCounter);

        // construct a (state local input) simulator membership query oracle
        StateLocalInputMealyOracle<Integer, OutputAndLocalInputs<Integer, Character>> mqOracle =
                new StateLocalInputSULOracle<>(symbolCounter);

        // construct storage for EquivalenceOracle chain, because we want to use the potential cache as well
        List<EquivalenceOracle<StateLocalInputMealyMachine<?, Integer, ?, Character>, Integer, Word<OutputAndLocalInputs<Integer, Character>>>>
                eqOracles = new ArrayList<>(2);

        if (withCache) {
            StateLocalInputMealyCacheOracle<Integer, Character> mqCache =
                    MealyCaches.createStateLocalInputTreeCache(mqOracle.definedInputs(Word.epsilon()), mqOracle);
            eqOracles.add(mqCache.createStateLocalInputCacheConsistencyTest());
            mqOracle = mqCache;
        }

        // construct L* instance
        PartialLStarMealy<Integer, Character> lstar =
                new PartialLStarMealyBuilder<Integer, Character>().withOracle(mqOracle)
                                                                  .withCexHandler(ObservationTableCEXHandlers.RIVEST_SCHAPIRE)
                                                                  .create();

        // here, we simply fallback to an equivalence check for the original automaton model
        eqOracles.add(new StateLocalInputMealySimulatorEQOracle<>(TARGET));

        // construct single EQ oracle
        EquivalenceOracle<StateLocalInputMealyMachine<?, Integer, ?, Character>, Integer, Word<OutputAndLocalInputs<Integer, Character>>>
                eqOracle = new EQOracleChain<>(eqOracles);

        // construct the experiment
        // note, we can't use the regular MealyExperiment (or MooreExperiment) because the output type of our hypothesis
        // is different from our membership query type
        Experiment<StateLocalInputMealyMachine<?, Integer, ?, Character>> experiment =
                new Experiment<>(lstar, eqOracle, INPUTS);

        // run experiment
        experiment.run();

        // report results
        System.out.println("Partial Hypothesis" + (withCache ? ", with cache" : ""));
        System.out.println("-------------------------------------------------------");

        System.out.println(resetCounter.getStatisticalData().getSummary());
        System.out.println(symbolCounter.getStatisticalData().getSummary());

        System.out.println("-------------------------------------------------------");
    }
1178703
public <D, V> void iput(FieldId<D, V> fieldId, Local<? extends D> instance, Local<? extends V> source) {
        addInstruction(new ThrowingCstInsn(Rops.opPutField(source.type.ropType), sourcePosition,
                RegisterSpecList.make(source.spec(), instance.spec()), catches, fieldId.constant));
    }
215538
private boolean itemInItemStateList(List<ItemState> list, String itemId, int state)
   {
      boolean retval = false;
      for (ItemState itemState : list)
      {
         if (itemState.getState() == state && itemState.getData().getIdentifier().equals(itemId))
         {
            retval = true;
            break;
         }
      }

      return retval;
   }
150050
private Either<FEELEvent, Object> actualInputsMatchInputValues(EvaluationContext ctx, Object[] params) {
        // check that all the parameters match the input list values if they are defined
        for( int i = 0; i < params.length; i++ ) {
            final DTInputClause input = inputs.get( i );
            // if a list of values is defined, check the the parameter matches the value
            if ( input.getInputValues() != null && ! input.getInputValues().isEmpty() ) {
                final Object parameter = params[i];
                boolean satisfies = input.getInputValues().stream().map( ut -> ut.apply( ctx, parameter ) ).filter( Boolean::booleanValue ).findAny().orElse( false );

                if ( !satisfies ) {
                    String values = input.getInputValuesText();
                    return Either.ofLeft(new InvalidInputEvent( FEELEvent.Severity.ERROR,
                                                  input.getInputExpression()+"='" + parameter + "' does not match any of the valid values " + values + " for decision table '" + getName() + "'.",
                                                  getName(),
                                                  null,
                                                  values )
                            );
                }
            }
        }
        return Either.ofRight(true);
    }
185736
private AbstractState createState(CopycatServer.State state) {
    switch (state) {
      case INACTIVE:
        return new InactiveState(this);
      case RESERVE:
        return new ReserveState(this);
      case PASSIVE:
        return new PassiveState(this);
      case FOLLOWER:
        return new FollowerState(this);
      case CANDIDATE:
        return new CandidateState(this);
      case LEADER:
        return new LeaderState(this);
      default:
        throw new AssertionError();
    }
  }
338239
public void assertLocalClient() {
    NetworkInterface iface = null;
    try {
      iface = NetworkInterface.getByInetAddress(getInetAddress());
    } catch (java.net.SocketException se) {
      throw (new SecurityException("Unable to determine if client is local.  Assuming he isn't."));
    }

    if ((iface == null) && (!getInetAddress().isLoopbackAddress())) {
      throw (new SecurityException("Client is not local."));
    }
  }
125752
public <T> Local<T> newLocal(TypeId<T> type) {
        if (localsInitialized) {
            throw new IllegalStateException("Cannot allocate locals after adding instructions");
        }
        Local<T> result = Local.get(this, type);
        locals.add(result);
        return result;
    }
146055
function(state) {
	   if(state == inputEx.stateInvalid && this.options.minLength && this.el.value.length < this.options.minLength) {
	      return inputEx.messages.stringTooShort[0]+this.options.minLength+inputEx.messages.stringTooShort[1];
      }
	   return inputEx.StringField.superclass.getStateString.call(this, state);
	}
1124214
public void setLocal(boolean local)
   {
      // start local transaction
      if (local && changesList.get() == null)
      {
         beginTransaction();
      }
      this.local.set(local);
   }
1150864
public final void nextState (final IState newState) throws InternetSCSIException {

        this.state = newState;
        if (this.state != null) {
            do {
                this.state.execute();
                LOGGER.info("State is following: " + this.state.nextStateFollowing());
            } while (this.state.nextStateFollowing());
        }

    }
16208
@Override
    public boolean hasLocal()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "hasLocal");

        boolean hasLocal = false;

        // If this alias scopes the set of possible queue points then to qualify
        // as having a local one it must be in this set.
        if (_hasScopedMessagePoints)
        {
            if (_singleScopedQueuePointME != null)
            {
                if (_singleScopedQueuePointME.equals(getMessageProcessor().getMessagingEngineUuid()))
                    hasLocal = true;
            }
            else if ((_scopedQueuePointMEs != null) && _scopedQueuePointMEs.contains(getMessageProcessor().getMessagingEngineUuid()))
                hasLocal = true;
        }

        // Because we can't trust the scoped set being up-to-date with the
        // target destination (which could have removed an ME and hence queue point
        // since the alias was created) we still check that the target has
        // a local queue point.
        if (hasLocal || !_hasScopedMessagePoints)
            hasLocal = _targetDestinationHandler.hasLocal();

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "hasLocal", Boolean.valueOf(hasLocal));

        return hasLocal;
    }
114529
private synchronized void initCounterState(Long currentValue) {
      if (weakCounter == null) {
         weakCounter = currentValue == null ?
               newCounterValue(configuration) :
               newCounterValue(currentValue, configuration);
      }
   }
867673
public void createLocalDurableSubscription(
                                               ConsumerDispatcherState subState,
                                               TransactionCommon transaction)
                    throws
                    SIDurableSubscriptionAlreadyExistsException,
                    SIDiscriminatorSyntaxException,
                    SISelectorSyntaxException,
                    SIResourceException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(
                        tc,
                        "createLocalDurableSubscription",
                        new Object[] { subState, transaction });

        // Create new getCursor and consumer dispatchers to return to the calling method
        ConsumerDispatcher consumerDispatcher = null;

        /*
         * Lock the list of durable subscriptions to prevent others creating/using an
         * identical subscription
         */
        synchronized (_consumerDispatchersDurable)
        {
            // If there's already a consumer dispatcher with this client name, then the
            // create must fail according to the current core API semantics.
            consumerDispatcher = getDurableSubscriptionConsumerDispatcher(subState);

            if (consumerDispatcher != null)
            {
                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                    SibTr.exit(
                               tc,
                               "createLocalDurableSubscription",
                               "Sub Already Exists - " + subState);

                throw new SIDurableSubscriptionAlreadyExistsException(
                                nls.getFormattedMessage(
                                                        "SUBSCRIPTION_ALREADY_EXISTS_ERROR_CWSIP0143",
                                                        new Object[] {
                                                                      subState.getSubscriberID(),
                                                                      _messageProcessor.getMessagingEngineName() },
                                                        null));
            }
            /* We did not find the consumerDispatcher so we create it */

            /*
             * If a transaction was not provided...
             * Create a new LocalTransaction to perform the creation of a durable subscription.
             * Operations will include the creation of the itemstream,the persisting of
             * the durable state and the attaching of the consumerpoint.
             */
            boolean tranProvided = true;
            LocalTransaction siTran = null;

            if (transaction == null)
            {
                tranProvided = false;
                siTran =
                                _baseDestinationHandler
                                                .getTransactionManager()
                                                .createLocalTransaction(false);
                transaction = siTran;
            }

            /*
             * Create the consumerDispatcher, note we do not require this to be done under
             * the localTransaction. If something goes wrong after this operation, the
             * consumerDispatcher will be lost but thats ok.
             */

            Transaction msTran = _messageProcessor.resolveAndEnlistMsgStoreTransaction(transaction);

            try
            {
                /*
                 * Create a reference stream to be used by the durable subscription's
                 * consumer dispatcher
                 */
                final DurableSubscriptionItemStream durableSubscriptionReferenceStream =
                                new DurableSubscriptionItemStream(
                                                subState,
                                                _baseDestinationHandler.getDestinationManager(),
                                                _pubsubMessageItemStream,
                                                msTran);

                /* Create the consumer dispatcher to represent the subscription */
                consumerDispatcher =
                                configureDurableSubscription(durableSubscriptionReferenceStream);
                consumerDispatcher.registerControlAdapterAsMBean();

                //Venu mock mock
                // No ProxyHandler .. so commenting our this 
                /*
                 * // 166833.2
                 * // Generate the subscribeEvent for this new subscription
                 * // to see if this needs to be forwarded to a Neighbouring ME.
                 * _messageProcessor.getProxyHandler().subscribeEvent(
                 * subState,
                 * msTran);
                 */
            } catch (OutOfCacheSpace e)
            {
                // No FFDC code needed
                SibTr.exception(tc, e);
                // Rollback the transaction
                if (!tranProvided)
                    _baseDestinationHandler.handleRollback(siTran);
                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                    SibTr.exit(
                               tc,
                               "createLocalDurableSubscription",
                               "SIResourceException");
                throw new SIResourceException(
                                nls.getFormattedMessage(
                                                        "SUBSCRIPTION_CREATION_FAILED_CWSIP0033",
                                                        new Object[] {
                                                                      _baseDestinationHandler.getName(),
                                                                      subState.getSubscriberID(),
                                                                      e },
                                                        null),
                                e);

            } catch (MessageStoreException e)
            {
                // MessageStoreException shouldn't occur so FFDC.
                FFDCFilter.processException(
                                            e,
                                            "com.ibm.ws.sib.processor.impl.destination.PubSubRealization.createLocalDurableSubscription",
                                            "1:1093:1.35.2.4",
                                            this);
                SibTr.exception(tc, e);
                // Rollback the transaction
                if (!tranProvided)
                    _baseDestinationHandler.handleRollback(siTran);

                /*
                 * The message store has thrown an exception, which leaves us stuck. Record an ffst,
                 * write a trace record and throw a SIResourceException to the caller.
                 */
                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                    SibTr.exit(tc, "createLocalDurableSubscription", e);

                SibTr.error(
                            tc,
                            "INTERNAL_MESSAGING_ERROR_CWSIP0003",
                            new Object[] {
                                          "com.ibm.ws.sib.processor.impl.destination.PubSubRealization.createLocalDurableSubscription",
                                          "1:1112:1.35.2.4",
                                          e,
                                          _baseDestinationHandler.getName() });

                throw new SIResourceException(
                                nls.getFormattedMessage(
                                                        "INTERNAL_MESSAGING_ERROR_CWSIP0003",
                                                        new Object[] {
                                                                      "com.ibm.ws.sib.processor.impl.destination.PubSubRealization",
                                                                      "1:1121:1.35.2.4",
                                                                      e,
                                                                      _baseDestinationHandler.getName() },
                                                        null),
                                e);
            } catch (SIDiscriminatorSyntaxException e)
            {
                // No FFDC code needed
                _baseDestinationHandler.handleRollback(siTran);
                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                    SibTr.exit(tc, "createLocalDurableSubscription", e);
                throw e;
            } catch (SISelectorSyntaxException e)
            {
                // No FFDC code needed
                _baseDestinationHandler.handleRollback(siTran);
                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                    SibTr.exit(tc, "createLocalDurableSubscription", e);
                throw e;
            }
            //Venu mock mock
            //commenting out as this exception became unreachable
            /*
             * catch (SIResourceException e)
             * {
             * // No FFDC code needed
             * _baseDestinationHandler.handleRollback(siTran);
             * if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
             * SibTr.exit(tc, "createLocalDurableSubscription", e);
             * throw e;
             * }
             */
            catch (RuntimeException e)
            {
                // FFDC
                FFDCFilter.processException(
                                            e,
                                            "com.ibm.ws.sib.processor.impl.destination.PubSubRealization.createLocalDurableSubscription",
                                            "1:1153:1.35.2.4",
                                            this);

                if (siTran != null)
                    _baseDestinationHandler.handleRollback(siTran);
                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                    SibTr.exit(tc, "createLocalDurableSubscription", e);
                throw e;
            }

            if (!tranProvided)
            {
                /*
                 * If no transaction was provided, this call must have been made from
                 * the core api (i.e. JMS). We can not provide transaction at runtime.
                 * Since we are creating via JMS, we need to attach the consumer
                 * as part of the create operation.
                 */
                try
                {

                    /* We have our own transaction so commit it here */
                    siTran.commit();

                } catch (SIException e)
                {
                    // MessageStoreException shouldn't occur so FFDC.
                    FFDCFilter.processException(
                                                e,
                                                "com.ibm.ws.sib.processor.impl.destination.PubSubRealization.createLocalDurableSubscription",
                                                "1:1182:1.35.2.4",
                                                this);

                    SibTr.exception(tc, e);
                    SibTr.error(
                                tc,
                                "INTERNAL_MESSAGING_ERROR_CWSIP0003",
                                new Object[] {
                                              "com.ibm.ws.sib.processor.impl.destination.PubSubRealization",
                                              "1:1191:1.35.2.4",
                                              e,
                                              _baseDestinationHandler.getName() });

                    // Failed to attach consumer, rollback the creation of the durable sub
                    // and throw exception.
                    _baseDestinationHandler.handleRollback(siTran);

                    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                        SibTr.exit(tc, "createLocalDurableSubscription", e);

                    throw new SIResourceException(
                                    nls.getFormattedMessage(
                                                            "INTERNAL_MESSAGING_ERROR_CWSIP0003",
                                                            new Object[] {
                                                                          "com.ibm.ws.sib.processor.impl.destination.PubSubRealization",
                                                                          "1:1207:1.35.2.4",
                                                                          e,
                                                                          _baseDestinationHandler.getName() },
                                                            null),
                                    e);
                }
            }
            // Transaction was provided

        } // Release the durable subs lock

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "createLocalDurableSubscription");
    }
957011
public boolean containsSubflowState(final Flow flow, final String stateId) {
        if (containsFlowState(flow, stateId)) {
            return getState(flow, stateId, SubflowState.class) != null;
        }
        return false;
    }
796788
public void load(final FormulaFactoryState state) {
    int index = -1;
    for (int i = validStates.size() - 1; i >= 0 && index == -1; i--)
      if (validStates.get(i) == state.id())
        index = i;
    if (index == -1)
      throw new IllegalArgumentException("The given formula factory state is not valid anymore.");
    this.validStates.shrinkTo(index + 1);

    shrinkMap(this.posLiterals, state.state()[0]);
    shrinkMap(this.negLiterals, state.state()[1]);
    shrinkSet(this.generatedVariables, state.state()[2]);
    shrinkMap(this.nots, state.state()[3]);
    shrinkMap(this.implications, state.state()[4]);
    shrinkMap(this.equivalences, state.state()[5]);
    shrinkMap(this.ands2, state.state()[6]);
    shrinkMap(this.ands3, state.state()[7]);
    shrinkMap(this.ands4, state.state()[8]);
    shrinkMap(this.andsN, state.state()[9]);
    shrinkMap(this.ors2, state.state()[10]);
    shrinkMap(this.ors3, state.state()[11]);
    shrinkMap(this.ors4, state.state()[12]);
    shrinkMap(this.orsN, state.state()[13]);
    shrinkMap(this.pbConstraints, state.state()[14]);
    this.ccCounter = state.state()[15];
    this.pbCounter = state.state()[16];
    this.cnfCounter = state.state()[17];

    clearCaches();
  }
1190000
@Override
	public CompletableFuture<Acknowledge> updateTaskExecutionState(
			final TaskExecutionState taskExecutionState) {
		checkNotNull(taskExecutionState, "taskExecutionState");

		if (executionGraph.updateState(taskExecutionState)) {
			return CompletableFuture.completedFuture(Acknowledge.get());
		} else {
			return FutureUtils.completedExceptionally(
				new ExecutionGraphException("The execution attempt " +
					taskExecutionState.getID() + " was not found."));
		}
	}
1348391
@Override
    public Class<?> getInvokedBusinessInterface() throws IllegalStateException {
        // Determine if in valid state for this method.
        boolean validState = false;
        int stateCopy;
        synchronized (this) {
            stateCopy = state;
            validState = (state == POOLED) || (state == IN_METHOD);
        }

        if (validState) {
            // Valid state, so perform function.
            return super.getInvokedBusinessInterface();
        } else {
            // Invalid state, so throw IllegalStateException.
            String stateString = getStateName(stateCopy);
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                Tr.debug(tc, "Incorrect state: " + stateString);
            throw new IllegalStateException(stateString);
        }
    }