Usage: java org.uma.jmetal.runner.singleobjective.LocalSearchRunner
434006
public static void main(String[] args) throws Exception {
    BinaryProblem problem = new OneMax(1024) ;

    MutationOperator<BinarySolution> mutationOperator =
        new BitFlipMutation(1.0 / problem.getNumberOfBits(0)) ;

    int improvementRounds = 10000 ;

    Comparator<BinarySolution> comparator = new DominanceComparator<>(0) ;

    LocalSearchOperator<BinarySolution> localSearch = new BasicLocalSearch<>(
            improvementRounds,
            mutationOperator,
            comparator,
            problem) ;

    BinarySolution solution = problem.createSolution() ;

    BinarySolution newSolution = localSearch.execute(solution) ;

    JMetalLogger.logger.info("Fitness: " + newSolution.getObjective(0)) ;
    JMetalLogger.logger.info("Solution: " + newSolution.getVariableValueString(0)) ;
  }
534350
@Override
    public void setProducerPreferLocal(String preferLocal) throws JMSException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setProducerPreferLocal", preferLocal);

        // Make sure null and empty are treated equally.
        if ((preferLocal == null) || ("".equals(preferLocal.trim())))
            preferLocal = null;

        if ((preferLocal == null) ||
            (ApiJmsConstants.PRODUCER_PREFER_LOCAL_OFF.equals(preferLocal) ||
            (ApiJmsConstants.PRODUCER_PREFER_LOCAL_ON.equals(preferLocal)))) {

            updateProperty(PRODUCER_PREFER_LOCAL, preferLocal);
        }
        else {
            // bad value, throw exception
            String key = "INVALID_VALUE_CWSIA0281";
            Object[] inserts = new Object[] { PRODUCER_PREFER_LOCAL, preferLocal };
            throw (JMSException) JmsErrorUtils.newThrowable(JMSException.class, key, inserts, tc);
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "setProducerPreferLocal");
    }
607968
public static List<String> getLocalPaths( String localRepoPath, List<String> notations ) throws NaetherException {
        DefaultServiceLocator locator = new DefaultServiceLocator();
        SimpleLocalRepositoryManagerFactory factory = new SimpleLocalRepositoryManagerFactory();
        factory.initService( locator );

        LocalRepository localRepo = new LocalRepository(localRepoPath);
        LocalRepositoryManager manager = null;
        try {
            manager = factory.newInstance( localRepo );
        } catch (NoLocalRepositoryManagerException e) {
            throw new NaetherException( "Failed to initial local repository manage", e  );
        }

        List<String> localPaths = new ArrayList<String>();

        for ( String notation : notations ) {
            Dependency dependency = new Dependency(new DefaultArtifact(notation), "compile");
            File path = new File( localRepo.getBasedir(), manager.getPathForLocalArtifact( dependency.getArtifact() ) );
            localPaths.add( path.toString() );
        }

        return localPaths;
    }
784541
def search_local(name)
      if variable = variables[name]
        return variable.nested_reference
      end

      if variable = search_scopes(name)
        variables[name] = variable
        return variable.nested_reference
      end
    end
1030187
def runner
      j = self
      runner_path = j.path.split("/")[0..1].join("/")
      return Runner.where(:path=>runner_path).first
    end
1185771
public void storeLocal(LocalVariable local) {
        if (local == null) {
            throw new NullPointerException("No local variable specified");
        }
        int stackAdjust = local.getType().isDoubleWord() ? -2 : -1;
        mInstructions.new StoreLocalInstruction(stackAdjust, local);
    }
1240806
@Override
    public String getValue(String uri, String local) {
        int index = getIndex(uri, local);

        if (index < 0) {
            return null;
        }
        return getValue(index);
    }
273142
def runner(opts, utils=None, context=None, whitelist=None):
    '''
    
    '''
    if utils is None:
        utils = {}
    if context is None:
        context = {}
    ret = LazyLoader(
        _module_dirs(opts, 'runners', 'runner', ext_type_dirs='runner_dirs'),
        opts,
        tag='runners',
        pack={'__utils__': utils, '__context__': context},
        whitelist=whitelist,
    )
    # TODO: change from __salt__ to something else, we overload __salt__ too much
    ret.pack['__salt__'] = ret
    return ret
1111416
@GET
    @Path("localnode/health")
    @Produces(MediaType.TEXT_PLAIN)
    public String getLocalNodeHealth() throws MalformedObjectNameException
    {
        // Local service only - not enabled when running on top of Tomcat & co.
        if (n == null)
        {
            throw new ErrorDto("can only retrieve local node health when the web app runs on top of JQM", "", 7, Status.BAD_REQUEST);
        }
        if (n.getJmxServerPort() == null || n.getJmxServerPort() == 0)
        {
            throw new ErrorDto("JMX is not enabled on this server", "", 8, Status.BAD_REQUEST);
        }

        // Connect to JMX server
        MBeanServer server = ManagementFactory.getPlatformMBeanServer();
        ObjectName nodeBean = new ObjectName("com.enioka.jqm:type=Node,name=" + n.getName());
        Set<ObjectName> names = server.queryNames(nodeBean, null);
        if (names.isEmpty())
        {
            throw new ErrorDto("could not find the JMX Mbean of the local JQM node", "", 8, Status.INTERNAL_SERVER_ERROR);
        }
        ObjectName localNodeBean = names.iterator().next();

        // Query bean
        Object result;
        try
        {
            result = server.getAttribute(localNodeBean, "AllPollersPolling");
        }
        catch (Exception e)
        {
            throw new ErrorDto("Issue when querying JMX server", 12, e, Status.INTERNAL_SERVER_ERROR);
        }
        if (!(result instanceof Boolean))
        {
            throw new ErrorDto("JMX bean answered with wrong datatype - answer was " + result.toString(), "", 9,
                    Status.INTERNAL_SERVER_ERROR);
        }

        // Analyze output
        boolean res = (Boolean) result;
        if (!res)
        {
            throw new ErrorDto("JQM node has is not working as expected", "", 11, Status.SERVICE_UNAVAILABLE);
        }

        return "Pollers are polling";
    }
22872
@Override
    public Iterator<LocalDateTime> iterator() {

        return new Iterator<LocalDateTime>() {

            final LongIterator longIterator = longIterator();

            @Override
            public boolean hasNext() {
                return longIterator.hasNext();
            }

            @Override
            public LocalDateTime next() {
                return PackedLocalDateTime.asLocalDateTime(longIterator.nextLong());
            }
        };
    }
39689
@Override
    protected VoltMessage instantiate_local(byte messageType)
    {
        // instantiate a new message instance according to the id
        VoltMessage message = null;

        switch (messageType) {
        case INITIATE_TASK_ID:
            message = new InitiateTaskMessage();
            break;
        case INITIATE_RESPONSE_ID:
            message = new InitiateResponseMessage();
            break;
        case FRAGMENT_TASK_ID:
            message = new FragmentTaskMessage();
            break;
        case FRAGMENT_RESPONSE_ID:
            message = new FragmentResponseMessage();
            break;
        case PARTICIPANT_NOTICE_ID:
            message = new MultiPartitionParticipantMessage();
            break;
        case COALESCED_HEARTBEAT_ID:
            message = new CoalescedHeartbeatMessage();
            break;
        case COMPLETE_TRANSACTION_ID:
            message = new CompleteTransactionMessage();
            break;
        case COMPLETE_TRANSACTION_RESPONSE_ID:
            message = new CompleteTransactionResponseMessage();
            break;
        case IV2_INITIATE_TASK_ID:
            message = new Iv2InitiateTaskMessage();
            break;
        case IV2_REPAIR_LOG_REQUEST:
            message = new Iv2RepairLogRequestMessage();
            break;
        case IV2_REPAIR_LOG_RESPONSE:
            message = new Iv2RepairLogResponseMessage();
            break;
        case REJOIN_RESPONSE_ID:
            message = new RejoinMessage();
            break;
        case REJOIN_DATA_ID:
            message = new RejoinDataMessage();
            break;
        case REJOIN_DATA_ACK_ID:
            message = new RejoinDataAckMessage();
            break;
        case FRAGMENT_TASK_LOG_ID:
            message = new FragmentTaskLogMessage();
            break;
        case IV2_LOG_FAULT_ID:
            message = new Iv2LogFaultMessage();
            break;
        case IV2_EOL_ID:
            message = new Iv2EndOfLogMessage();
            break;
        case DUMP:
            message = new DumpMessage();
            break;
        case MP_REPLAY_ID:
            message = new MpReplayMessage();
            break;
        case MP_REPLAY_ACK_ID:
            message = new MpReplayAckMessage();
            break;
        case SNAPSHOT_CHECK_REQUEST_ID:
            message = new SnapshotCheckRequestMessage();
            break;
        case SNAPSHOT_CHECK_RESPONSE_ID:
            message = new SnapshotCheckResponseMessage();
            break;
        case IV2_REPAIR_LOG_TRUNCATION:
            message = new RepairLogTruncationMessage();
            break;
        case DR2_MULTIPART_TASK_ID:
            message = new Dr2MultipartTaskMessage();
            break;
        case DR2_MULTIPART_RESPONSE_ID:
            message = new Dr2MultipartResponseMessage();
            break;
        case DUMMY_TRANSACTION_TASK_ID:
            message = new DummyTransactionTaskMessage();
            break;
        case DUMMY_TRANSACTION_RESPONSE_ID:
            message = new DummyTransactionResponseMessage();
            break;
        case Migrate_Partition_Leader_MESSAGE_ID:
            message = new MigratePartitionLeaderMessage();
            break;
        case DUMP_PLAN_ID:
            message = new DumpPlanThenExitMessage();
            break;
        case FLUSH_RO_TXN_MESSAGE_ID:
            message = new MPBacklogFlushMessage();
            break;
        default:
            message = null;
        }
        return message;
    }
240079
function(testPath) {
    var testStartTime = +new Date();

    var waitForTest = function(resolve, reject) {
      // executeScript runs the passed method in the "window" context of
      // the current test. JSUnit exposes hooks into the test's status through
      // the "G_testRunner" global object.
      browser
          .executeScript(function() {
            if (window['G_testRunner'] &&
                window['G_testRunner']['isFinished']()) {
              var status = {};
              status['isFinished'] = true;
              status['isSuccess'] = window['G_testRunner']['isSuccess']();
              status['report'] = window['G_testRunner']['getReport']();
              return status;
            } else {
              return {'isFinished': false};
            }
          })
          .then(
              function(status) {
                if (status && status.isFinished) {
                  resolve(status);
                } else {
                  var currTime = +new Date();
                  if (currTime - testStartTime > TEST_TIMEOUT) {
                    status.isSuccess = false;
                    status.report = testPath + ' timed out after ' +
                        (TEST_TIMEOUT / 1000) + 's!';
                    // resolve so tests continue running.
                    resolve(status);
                  } else {
                    // Check every 300ms for completion.
                    setTimeout(
                        waitForTest.bind(undefined, resolve, reject), 300);
                  }
                }
              },
              function(err) {
                reject(err);
              });
    };

    return new Promise(function(resolve, reject) {
      waitForTest(resolve, reject);
    });
  }
184325
public Map<String, Object> getLocals() {
    if (locals == null || locals.length == 0) {
      return null;
    }

    Map<String, Object> localsMap = new HashMap<>();
    for (LocalVariable localVariable : locals) {
      if (localVariable != null) {
        localsMap.put(localVariable.getName(), localVariable.getValue());
      }
    }

    return localsMap;
  }
302681
@Override
  public Description matchMethodInvocation(MethodInvocationTree t, VisitorState state) {
    String arg1;
    String arg2;
    if (instanceEqualsMatcher.matches(t, state)) {
      arg1 = state.getSourceForNode(((JCFieldAccess) t.getMethodSelect()).getExpression());
      arg2 = state.getSourceForNode(t.getArguments().get(0));
    } else if (staticEqualsMatcher.matches(t, state)) {
      arg1 = state.getSourceForNode(t.getArguments().get(0));
      arg2 = state.getSourceForNode(t.getArguments().get(1));
    } else {
      return NO_MATCH;
    }

    Fix fix =
        SuggestedFix.builder()
            .replace(t, "Arrays.equals(" + arg1 + ", " + arg2 + ")")
            .addImport("java.util.Arrays")
            .build();
    return describeMatch(t, fix);
  }
781255
function(selector) {

	var allMatches = localnwt.all(selector),
		testNode = this._node,
		ancestor = null,
		maxDepth = 0;

	if( allMatches.size() == 0 ) {
		return null;
	}

	while( true ) {

		// Iterate through all matches for each parent, and exit as soon as we have a match
		// Pretty bad performance, but super small. TODO: Omtimize
		allMatches.each(function (el) {
			if (el._node == testNode) {
				ancestor = el;
			}
		});

		var parentNode = testNode.parentNode;

		if( ancestor || !parentNode) { break; }
		testNode = parentNode;
	}

	if( ancestor ) {
		return ancestor;
	} else {
		return null;
	}
}
43501
private void checkLocalRevisionSchema() throws Exception {
        InputStream localRevisionDDLStream = null;
        InputStream in = org.apache.jackrabbit.core.journal.DatabaseJournal.class.getResourceAsStream(databaseType + ".ddl");
        try {
            BufferedReader reader = new BufferedReader(new InputStreamReader(in));
            String sql = reader.readLine();
            while (sql != null) {
                // Skip comments and empty lines, and select only the statement to create the LOCAL_REVISIONS
                // table.
                if (!sql.startsWith("#") && sql.length() > 0 && sql.indexOf(LOCAL_REVISIONS_TABLE) != -1) {
                    localRevisionDDLStream = new ByteArrayInputStream(sql.getBytes());
                    break;
                }
                // read next sql stmt
                sql = reader.readLine();
            }
        } finally {
            IOUtils.closeQuietly(in);
        }
        // Run the schema check for the single table
        new CheckSchemaOperation(conHelper, localRevisionDDLStream, schemaObjectPrefix
                + LOCAL_REVISIONS_TABLE).addVariableReplacement(
            CheckSchemaOperation.SCHEMA_OBJECT_PREFIX_VARIABLE, schemaObjectPrefix).run();
    }
703336
private void visitObject(MethodVisitor mv, LocalVarInfo param) {
        Type paramType = param.getType();
        if (Type.getType(Character.class).equals(paramType)) {
            mv.visitLdcInsn((char) FORTY_TWO);
            mv.visitMethodInsn(INVOKESTATIC, paramType.getInternalName(), "valueOf",
                    "(C)L" + paramType.getInternalName() + ";");
            mv.visitVarInsn(ASTORE, param.getIndex());
        } else if (supportedValueOfTypes.contains(paramType)) {
            mv.visitLdcInsn(String.valueOf(FORTY_TWO));
            mv.visitMethodInsn(INVOKESTATIC, paramType.getInternalName(), "valueOf",
                    "(Ljava/lang/String;)L" + paramType.getInternalName() + ";");
            mv.visitVarInsn(ASTORE, param.getIndex());
        } else {
            throwUnsupportedException(param);
        }
    }