auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testInitializeTwiceFails() throws AlreadyInitializedException, TableExistsException { FluoAdmin fluoAdmin = new FluoAdminImpl(config); InitOpts opts = new InitOpts(); opts.setClearZookeeper(true); opts.setClearTable(true); fluoAdmin.initialize(opts); fluoAdmin.initialize(opts); opts.setClearZookeeper(false); opts.setClearTable(false); try { fluoAdmin.initialize(opts); fail("This should have failed"); } catch (AlreadyInitializedException e) { } opts.setClearZookeeper(true); opts.setClearTable(false); try { fluoAdmin.initialize(opts); fail("This should have failed"); } catch (TableExistsException e) { } assertTrue(conn.tableOperations().exists(config.getAccumuloTable())); }

Target:
public void testInitializeTwiceFails() throws AlreadyInitializedException, TableExistsException { FluoAdmin fluoAdmin = new FluoAdminImpl(config); InitOpts opts = new InitOpts().setClearZookeeper(true).setClearTable(true); fluoAdmin.initialize(opts); fluoAdmin.initialize(opts); opts.setClearZookeeper(false).setClearTable(false); try { fluoAdmin.initialize(opts); fail("This should have failed"); } catch (AlreadyInitializedException e) { } opts.setClearZookeeper(false).setClearTable(true); try { fluoAdmin.initialize(opts); fail("This should have failed"); } catch (AlreadyInitializedException e) { } opts.setClearZookeeper(true).setClearTable(false); try { fluoAdmin.initialize(opts); fail("This should have failed"); } catch (TableExistsException e) { } assertTrue(conn.tableOperations().exists(config.getAccumuloTable())); }
Source:
private void buildStatisticsTree(final ITmfTrace trace, final TmfTimeRange timeRange, final boolean isGlobal) { final TmfStatisticsTree statsData = TmfStatisticsTreeManager.getStatTree(getTreeID()); if (statsData == null) { return; } Map<ITmfTrace, Job> updateJobs; if (isGlobal) { updateJobs = fUpdateJobsGlobal; } else { updateJobs = fUpdateJobsPartial; } setPieChartsVisible(true); for (ITmfTrace aTrace : TmfTraceManager.getTraceSet(trace)) { aTrace = checkNotNull(aTrace); if (!isListeningTo(aTrace)) { continue; } final TmfStatisticsModule statsMod = TmfTraceUtils.getAnalysisModuleOfClass(aTrace, TmfStatisticsModule.class, TmfStatisticsModule.ID); if (statsMod == null) { continue; } Job job = updateJobs.get(aTrace); if (job == null) { job = new StatisticsUpdateJob("Statistics update", aTrace, isGlobal, timeRange, statsMod, this); updateJobs.put(aTrace, job); job.setSystem(true); job.schedule(); } } }

Target:
private void buildStatisticsTree(final ITmfTrace trace, final TmfTimeRange timeRange, final boolean isGlobal) { final TmfStatisticsTree statsData = TmfStatisticsTreeManager.getStatTree(getTreeID()); if (statsData == null) { return; } Map<ITmfTrace, Job> updateJobs; if (isGlobal) { updateJobs = fUpdateJobsGlobal; } else { updateJobs = fUpdateJobsPartial; } for (ITmfTrace aTrace : TmfTraceManager.getTraceSet(trace)) { aTrace = checkNotNull(aTrace); if (!isListeningTo(aTrace)) { continue; } final TmfStatisticsModule statsMod = TmfTraceUtils.getAnalysisModuleOfClass(aTrace, TmfStatisticsModule.class, TmfStatisticsModule.ID); if (statsMod == null) { continue; } Job job = updateJobs.get(aTrace); if (job == null) { job = new StatisticsUpdateJob("Statistics update", aTrace, isGlobal, timeRange, statsMod, this); updateJobs.put(aTrace, job); job.setSystem(true); job.schedule(); } } }
Source:
public void commit(final Xid xid, final boolean onePhase) throws XAException { if (commitToEnlistment()) lookup(xid).commit(onePhase); if (onePhase && resourceRegistry != null) resourceRegistry.removeResource(this); }

Target:
public void commit(final Xid xid, final boolean onePhase) throws XAException { try { if (commitToEnlistment()) lookup(xid).commit(onePhase); } catch (XAException | RuntimeException exception) { if (onePhase && resourceRegistry != null) resourceRegistry.resourceInDoubt(this); throw exception; } if (onePhase && resourceRegistry != null) resourceRegistry.removeResource(this); }
Source:
public int refreshIndex(String indexName) throws IOException { String url = String.format("%s/%s/_refresh", baseUrl, indexName); HttpGet httpGet = new HttpGet(url); CloseableHttpResponse response = null; try { response = closeableHttpClient.execute(httpGet); } catch (IOException e) { logger.error("Refresh for index failed with status code: and exception message: {}", indexName, response.getStatusLine().getStatusCode(), e.getMessage()); } finally { response.close(); } return response.getStatusLine().getStatusCode(); }

Target:
public int refreshIndex(String indexName) throws IOException { String url = String.format("http://%s/%s/_refresh", baseUrlArray[0], indexName); HttpGet httpGet = new HttpGet(url); CloseableHttpResponse response = null; try { response = closeableHttpClient.execute(httpGet); } catch (IOException e) { logger.error("Refresh for index failed with status code: and exception message: {}", indexName, response.getStatusLine().getStatusCode(), e.getMessage()); } finally { response.close(); } return response.getStatusLine().getStatusCode(); }
Source:
public float getProgress() throws IOException, InterruptedException { if (recordReadersCount < 1) { return 1.0f; } long cur = currentRecordReader == null ? 0L : (long)(currentRecordReader.getProgress() * splitLengths[currentRecordReaderIndex]); return 1.0f * (cur + cumulativeSplitLengths[currentRecordReaderIndex]) / totalSplitLengths; }

Target:
public float getProgress() throws IOException, InterruptedException { if (recordReadersCount < 1) { return 1f; } if (totalSplitLengths == 0) { return 0f; } long cur = currentRecordReader == null ? 0L : (long)(currentRecordReader.getProgress() * splitLengths[currentRecordReaderIndex]); return 1.0f * (cur + cumulativeSplitLengths[currentRecordReaderIndex]) / totalSplitLengths; }
Source:
public ResourceGroupInfo getSummaryInfo() { synchronized (root) { return new ResourceGroupInfo( id, getState(), schedulingPolicy, schedulingWeight, DataSize.succinctBytes(softMemoryLimitBytes), softConcurrencyLimit, hardConcurrencyLimit, maxQueuedQueries, runningTimeLimit, queuedTimeLimit, DataSize.succinctBytes(cachedMemoryUsageBytes), getQueuedQueries(), getRunningQueries(), eligibleSubGroups.size(), subGroups.values().stream() .filter(group -> group.getRunningQueries() + group.getQueuedQueries() > 0) .map(InternalResourceGroup::getChildInfo) .collect(toImmutableList()), null); } }

Target:
private ResourceGroupInfo getSummaryInfo() { synchronized (root) { return new ResourceGroupInfo( id, getState(), schedulingPolicy, schedulingWeight, DataSize.succinctBytes(softMemoryLimitBytes), softConcurrencyLimit, hardConcurrencyLimit, maxQueuedQueries, runningTimeLimit, queuedTimeLimit, DataSize.succinctBytes(cachedMemoryUsageBytes), getQueuedQueries(), getRunningQueries(), eligibleSubGroups.size(), null, null); } }
Source:
public void readFields(DataInput in) throws IOException { Class<? extends org.apache.hadoop.mapreduce.InputSplit> clazz = null; String name = null; try { name = Text.readString(in); clazz = (Class<? extends org.apache.hadoop.mapreduce.InputSplit>) conf.getClassByName(name); } catch (ClassNotFoundException e) { throw new IOException("Could not find class for deserialized class name: " + name, e); } org.apache.hadoop.mapreduce.InputSplit split = ReflectionUtils.newInstance(clazz, conf); SerializationFactory factory = new SerializationFactory(conf); Deserializer deserializer = factory.getDeserializer(clazz); deserializer.open((DataInputStream) in); realSplit = (org.apache.hadoop.mapreduce.InputSplit) deserializer.deserialize(split); deserializer.close(); }

Target:
public void readFields(DataInput in) throws IOException { realSplit = SplitUtil.deserializeInputSplit(conf, (DataInputStream) in); }
Source:
private SimulatedTripStats computeSimulatedTripStats() { Mean meanInVehicleBeelineSpeed = new Mean(); Mean meanWaitTime = new Mean(); for (var sequence : drtRequestAnalyzer.getPerformedRequestSequences().values()) { if (!sequence.isCompleted()) { continue; } DrtRequestSubmittedEvent submittedEvent = sequence.getSubmitted(); Link depLink = network.getLinks().get(submittedEvent.getFromLinkId()); Link arrLink = network.getLinks().get(submittedEvent.getToLinkId()); double beelineDistance = DistanceUtils.calculateDistance(depLink, arrLink); double pickupTime = sequence.getPickedUp().get().getTime(); double waitTime = pickupTime - sequence.getSubmitted().getTime(); double rideTime = sequence.getDroppedOff().get().getTime() - pickupTime; Preconditions.checkState(rideTime > 0); Preconditions.checkState(beelineDistance > 0); meanInVehicleBeelineSpeed.increment(beelineDistance / rideTime); meanWaitTime.increment(waitTime); } int count = (int)meanWaitTime.getN(); return new SimulatedTripStats(count, count == 0 ? drtSpeedUpParams.getInitialInVehicleBeelineSpeed() : meanInVehicleBeelineSpeed.getResult(), count == 0 ? drtSpeedUpParams.getInitialWaitingTime() : meanWaitTime.getResult()); }

Target:
private SimulatedTripStats computeSimulatedTripStats() { Mean meanInVehicleBeelineSpeed = new Mean(); Mean meanWaitTime = new Mean(); for (var sequence : drtRequestAnalyzer.getPerformedRequestSequences().values()) { if (!sequence.isCompleted()) { continue; } DrtRequestSubmittedEvent submittedEvent = sequence.getSubmitted(); Link depLink = network.getLinks().get(submittedEvent.getFromLinkId()); Link arrLink = network.getLinks().get(submittedEvent.getToLinkId()); double beelineDistance = DistanceUtils.calculateDistance(depLink, arrLink); double pickupTime = sequence.getPickedUp().get().getTime(); double waitTime = pickupTime - sequence.getSubmitted().getTime(); double rideTime = sequence.getDroppedOff().get().getTime() - pickupTime; meanInVehicleBeelineSpeed.increment(beelineDistance / rideTime); meanWaitTime.increment(waitTime); } int count = (int)meanWaitTime.getN(); return new SimulatedTripStats(count, count == 0 ? drtSpeedUpParams.getInitialInVehicleBeelineSpeed() : meanInVehicleBeelineSpeed.getResult(), count == 0 ? drtSpeedUpParams.getInitialWaitingTime() : meanWaitTime.getResult()); }
Source:
public Iterator<Replica> iterator() { return new Iterator<Replica>() { final int end = begin + size; int i = begin; @Override public boolean hasNext() { return i < end; } @Override public Replica next() { return contents[i++]; } }; }

Target:
public Iterator<Replica> iterator() { return new Iterator<Replica>() { final int end = begin + size; int i = begin; @Override public boolean hasNext() { return i < end; } @Override public Replica next() { if (!hasNext()) throw new IllegalStateException(); return contents[i++]; } }; }
Source:
private void closeDrawer(Side side) { if (side==Side.RIGHT||side==Side.BOTH) { rightDrawer.closeDrawers(); } if (leftDrawer!=null&&(side==Side.LEFT||side==Side.BOTH)) { leftDrawer.closeDrawers(); } openDrawer = Side.NONE; }

Target:
private void closeDrawer(Side side) { if (side==Side.RIGHT||side==Side.BOTH) { rightDrawer.closeDrawers(); } if (leftDrawer!=null&&(side==Side.LEFT||side==Side.BOTH)) { leftDrawer.closeDrawers(); } }
Source:
public void testShouldRemoveNoCache() throws Exception { lists1.add(LIST_ID1); lists2.add(LIST_ID3); lists3.add(LIST_ID3); final Set<Geocache> toBeRemoved = RemoveNotUniqueHelper.removeNonUniqueCaches(geoCaches); assertThat(toBeRemoved.size()).isEqualTo(0); assertThat(toBeRemoved.contains(gc1)).isFalse(); assertThat(toBeRemoved.contains(gc2)).isFalse(); assertThat(toBeRemoved.contains(gc3)).isFalse(); }

Target:
public void testShouldRemoveNoCache() { lists1.add(LIST_ID1); lists2.add(LIST_ID3); lists3.add(LIST_ID3); final Set<Geocache> toBeRemoved = RemoveNotUniqueHelper.removeNonUniqueCaches(geoCaches); assertThat(toBeRemoved.size()).isEqualTo(0); assertThat(toBeRemoved.contains(gc1)).isFalse(); assertThat(toBeRemoved.contains(gc2)).isFalse(); assertThat(toBeRemoved.contains(gc3)).isFalse(); }
Source:
public LogReplicationMetadata.ReplicationStatusVal queryReplicationStatus() { return corfuReplicationDiscoveryService.queryReplicationStatus( topologyConfig.getClusters(0).getId()); }

Target:
public Map<String, LogReplicationMetadata.ReplicationStatusVal> queryReplicationStatus() { return corfuReplicationDiscoveryService.queryReplicationStatus(); }
Source:
protected void configure() { addExposedPorts(DEFAULT_AMQP_PORT, DEFAULT_AMQPS_PORT, DEFAULT_HTTP_PORT, DEFAULT_HTTPS_PORT); if (adminPassword != null) { addEnv("RABBITMQ_DEFAULT_PASS", adminPassword); } }

Target:
protected void configure() { if (adminPassword != null) { addEnv("RABBITMQ_DEFAULT_PASS", adminPassword); } }
Source:
private <T> QueryRunner<T> makeRunner() { return new QueryRunner<T>() { @Override public Sequence<T> run(Query<T> query) { try { Server instance = brokerSelector.pick(); if (instance == null) { return Sequences.empty(); } final String url = String.format( "http://%s/druid/v2/", brokerSelector.pick().getHost() ); StatusResponseHolder response = httpClient.post(new URL(url)) .setContent( "application/json", jsonMapper.writeValueAsBytes(query) ) .go(responseHandler) .get(); List<T> results = jsonMapper.readValue( response.getContent(), new TypeReference<List<T>>() { } ); return Sequences.simple(results); } catch (Exception e) { return Sequences.empty(); } } }; }

Target:
private <T> QueryRunner<T> makeRunner() { return new QueryRunner<T>() { @Override public Sequence<T> run(Query<T> query) { try { Server instance = brokerSelector.pick(); if (instance == null) { return Sequences.empty(); } final String url = String.format( "http://%s/druid/v2/", brokerSelector.pick().getHost() ); StatusResponseHolder response = httpClient.post(new URL(url)) .setContent( "application/json", jsonMapper.writeValueAsBytes(query) ) .go(responseHandler) .get(); List<T> results = jsonMapper.readValue( response.getContent(), new TypeReference<List<T>>() { } ); return Sequences.simple(results); } catch (Exception e) { log.error(e, "Exception with bridge query"); return Sequences.empty(); } } }; }
Source:
static List<String> getUniqueMetrics(List<TimelineObjectHolder<String, DataSegment>> timelineSegments) { final BiMap<String, Integer> uniqueMetrics = HashBiMap.create(); int index = 0; for (TimelineObjectHolder<String, DataSegment> timelineHolder : Lists.reverse(timelineSegments)) { for (PartitionChunk<DataSegment> chunk : timelineHolder.getObject()) { for (String metric : chunk.getObject().getMetrics()) { uniqueMetrics.putIfAbsent(metric, index++); } } } final BiMap<Integer, String> orderedMetrics = uniqueMetrics.inverse(); return IntStream.range(0, orderedMetrics.size()) .mapToObj(orderedMetrics::get) .collect(Collectors.toList()); }

Target:
static List<String> getUniqueMetrics(List<TimelineObjectHolder<String, DataSegment>> timelineSegments) { final BiMap<String, Integer> uniqueMetrics = HashBiMap.create(); int[] index = {0}; for (TimelineObjectHolder<String, DataSegment> timelineHolder : Lists.reverse(timelineSegments)) { for (PartitionChunk<DataSegment> chunk : timelineHolder.getObject()) { for (String metric : chunk.getObject().getMetrics()) { uniqueMetrics.computeIfAbsent(metric, k -> { return index[0]++; } ); } } } final BiMap<Integer, String> orderedMetrics = uniqueMetrics.inverse(); return IntStream.range(0, orderedMetrics.size()) .mapToObj(orderedMetrics::get) .collect(Collectors.toList()); }
Source:
protected boolean inProject(@NonNull String className) { Stacktrace stacktrace = new Stacktrace(new StackTraceElement[]{}, projectPackages); return stacktrace.inProject(className); }

Target:
protected boolean inProject(@NonNull String className) { return Stacktrace.inProject(className, projectPackages); }
Source:
public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); mAdapter = new LeadAnouncementAdapter(getActivity()); setListAdapter(mAdapter); mAdapter.add(LeadMessage.newMessage(getString(R.string.leads_welcome_title), getString(R.string.leads_welcome))); mAdapter.add(LeadMessage.newResource(getString(R.string.leads_resources_title), getString(R.string.leads_resources), "<LINK_0>")); mAdapter.add(LeadMessage.newResource(getString(R.string.leads_wisdom_title), getString(R.string.leads_wisdom), "<LINK_1>")); }

Target:
public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); mAdapter = new LeadAnnouncementsAdapter(getActivity()); setListAdapter(mAdapter); mAdapter.add(LeadMessage.newMessage(getString(R.string.leads_welcome_title), getString(R.string.leads_welcome))); mAdapter.add(LeadMessage.newResource(getString(R.string.leads_resources_title), getString(R.string.leads_resources), Const.URL_GDG_RESOURCE_FOLDER)); mAdapter.add(LeadMessage.newResource(getString(R.string.leads_wisdom_title), getString(R.string.leads_wisdom), Const.URL_GDG_WISDOM_BOOK)); }
Source:
public T next() throws InterruptedException { WAIT_LOOP: for (;;) { long now = TimeService.currentTimeMillis(); int myOffset = offset; INVOCATIONS_LOOP: for (int i = 0; i < numOperations; ++i) { int operationIndex = (i + myOffset) % numOperations; long myInterval = intervals[operationIndex]; long currentInterval = now / myInterval; long lastInterval; boolean set = false; do { lastInterval = lastIntervals.get(operationIndex); } while (currentInterval > lastInterval && !(set = lastIntervals.compareAndSet(operationIndex, lastInterval, currentInterval))); if (set) { int frequency = invocations[operationIndex]; todoInvocations.set(operationIndex, frequency - 1); synchronized (this) { this.notifyAll(); } } else { int todos; do { todos = todoInvocations.get(operationIndex); if (todos <= 0) continue INVOCATIONS_LOOP; } while (!todoInvocations.compareAndSet(operationIndex, todos, todos - 1)); } offset++; return operations[operationIndex]; } synchronized (this) { for (int i = 0; i < todoInvocations.length(); ++i) { if (todoInvocations.get(i) != 0) { continue WAIT_LOOP; } } this.wait(1); } } }

Target:
public T next() throws InterruptedException { WAIT_LOOP: for (;;) { long now = TimeService.currentTimeMillis(); int myOffset = offset; INVOCATIONS_LOOP: for (int i = 0; i < operations.length; ++i) { int operationIndex = (i + myOffset) % operations.length; long myInterval = intervals[operationIndex]; long currentInterval = now / myInterval; long lastInterval; boolean hasSetLastInterval = false; do { lastInterval = lastIntervals.get(operationIndex); } while (currentInterval > lastInterval && !(hasSetLastInterval = lastIntervals.compareAndSet(operationIndex, lastInterval, currentInterval))); if (hasSetLastInterval) { int frequency = invocations[operationIndex]; todoInvocations.set(operationIndex, frequency - 1); synchronized (this) { this.notifyAll(); } } else { int todos; do { todos = todoInvocations.get(operationIndex); if (todos <= 0) continue INVOCATIONS_LOOP; } while (!todoInvocations.compareAndSet(operationIndex, todos, todos - 1)); } offset++; return operations[operationIndex]; } synchronized (this) { for (int i = 0; i < todoInvocations.length(); ++i) { if (todoInvocations.get(i) != 0) { continue WAIT_LOOP; } } this.wait(1); } } }
Source:
public static void queryTwins() throws IOException, InterruptedException { System.out.println("QUERY DIGITAL TWINS"); final CountDownLatch queryLatch = new CountDownLatch(1); System.out.println("Making a twin query and iterating over the results."); client.query("SELECT * FROM digitaltwins") .doOnNext(queryResult -> System.out.println("Query result: " + queryResult)) .doOnError(throwable -> System.err.println("Query error: " + throwable)) .doOnTerminate(queryLatch::countDown) .subscribe(); queryLatch.await(MaxWaitTimeAsyncOperationsInSeconds, TimeUnit.SECONDS); System.out.println("Making a twin query, with query-charge header extraction."); final CountDownLatch queryWithChargeLatch = new CountDownLatch(1); client.query("SELECT * FROM digitaltwins", BasicDigitalTwin.class) .byPage() .doOnNext(page -> { System.out.println("Query charge: " + getQueryCharge(page)); page.getValue() .forEach(item -> System.out.println("Found digital twin: " + item.getId())); }) .doOnError(throwable -> System.err.println("Query error: " + throwable)) .doOnTerminate(queryLatch::countDown) .subscribe(); queryWithChargeLatch.await(MaxWaitTimeAsyncOperationsInSeconds, TimeUnit.SECONDS); }

Target:
public static void queryTwins() throws InterruptedException { ConsoleLogger.printHeader("QUERY DIGITAL TWINS"); final CountDownLatch queryLatch = new CountDownLatch(1); ConsoleLogger.printHeader("Making a twin query and iterating over the results."); client.query("SELECT * FROM digitaltwins") .doOnNext(queryResult -> ConsoleLogger.printHeader("Query result: " + queryResult)) .doOnError(throwable -> ConsoleLogger.printFatal("Query error: " + throwable)) .doOnTerminate(queryLatch::countDown) .subscribe(); queryLatch.await(MAX_WAIT_TIME_ASYNC_OPERATIONS_IN_SECONDS, TimeUnit.SECONDS); ConsoleLogger.printHeader("Making a twin query, with query-charge header extraction."); final CountDownLatch queryWithChargeLatch = new CountDownLatch(1); client.query("SELECT * FROM digitaltwins", BasicDigitalTwin.class) .byPage() .doOnNext(page -> { ConsoleLogger.printHeader("Query charge: " + getQueryCharge(page)); page.getValue() .forEach(item -> ConsoleLogger.printHeader("Found digital twin: " + item.getId())); }) .doOnError(throwable -> ConsoleLogger.printFatal("Query error: " + throwable)) .doOnTerminate(queryLatch::countDown) .subscribe(); queryWithChargeLatch.await(MAX_WAIT_TIME_ASYNC_OPERATIONS_IN_SECONDS, TimeUnit.SECONDS); }
Source:
public int getKala(float kalamees) { Integer result = null; try { result = (Integer) handler.invoke(this, ProxySampleInterface_ReturnsBasic.class.getMethod("getKala", new Class[] {Float.TYPE}), new Object[] {new Float(kalamees)}); } catch (ClassCastException e) { throw e; } catch (NoSuchMethodException e) { } catch (RuntimeException e) { throw e; } catch (Error e) { throw e; } catch (Throwable e) { throw new UndeclaredThrowableException(e); } if (result != null) { return result; } else { return 0; } }

Target:
public int getKala(float kalamees) { Integer result = null; try { result = (Integer) handler.invoke(this, ProxySampleInterface_ReturnsBasic.class.getMethod("getKala", new Class[] {Float.TYPE}), new Object[] {new Float(kalamees)}); } catch (ClassCastException e) { throw e; } catch (NoSuchMethodException e) { } catch (RuntimeException e) { throw e; } catch (Error e) { throw e; } catch (Throwable e) { throw new UndeclaredThrowableException(e); } return result.intValue(); }
Source:
public void apply(OnlineCommandContext ctx) throws Exception { if (ctx.options.isDomain) { throw new CommandFailedException("AddModule command isn't supported in domain mode"); } StringBuilder cmd = new StringBuilder("module add"); cmd.append(" --name=" + moduleName); cmd.append(" --slot=" + slot); cmd.append(" --resource-delimiter=" + resourceDelimiter); if (moduleXml != null) cmd.append(" --module-xml=" + moduleXml); if (mainClass != null) cmd.append(" --main-class=" + mainClass); Joiner joiner = Joiner.on(','); if (!resources.isEmpty()) { cmd.append(" --resources=" + joiner.join(resources)); } if (!dependencies.isEmpty()) { cmd.append(" --dependencies=" + joiner.join(dependencies)); } if (!properties.isEmpty()) { cmd.append(" --properties=" + joiner.join(properties)); } ctx.client.executeCli(cmd.toString()); }

Target:
public void apply(OnlineCommandContext ctx) throws Exception { if (ctx.options.isDomain) { throw new CommandFailedException("AddModule command isn't supported in domain mode"); } StringBuilder cmd = new StringBuilder("module add"); cmd.append(" --name=" + moduleName); cmd.append(" --slot=" + slot); if (moduleXml != null) cmd.append(" --module-xml=" + moduleXml); if (mainClass != null) cmd.append(" --main-class=" + mainClass); Joiner resourcesJoiner = Joiner.on(File.pathSeparatorChar); if (ctx.serverVersion.greaterThanOrEqualTo(ManagementVersion.VERSION_2_0_0)) { cmd.append(" --resource-delimiter=" + resourceDelimiter); resourcesJoiner = Joiner.on(resourceDelimiter); } if (!resources.isEmpty()) { cmd.append(" --resources=" + resourcesJoiner.join(resources).replaceAll(" ", "\\\\ ")); } Joiner defaultJoiner = Joiner.on(","); if (!dependencies.isEmpty()) { cmd.append(" --dependencies=" + defaultJoiner.join(dependencies)); } if (!properties.isEmpty()) { cmd.append(" --properties=" + defaultJoiner.join(properties)); } ctx.client.executeCli(cmd.toString()); }
Source:
public List<LogicalDevice> getLogicalDevices() { return logicalDevices; }

Target:
public List<LogicalDevice> getLogicalDevices() { return this.logicalDevices; }
Source:
public CompletionStage<Metadata> refreshSchema( String keyspace, boolean evenIfDisabled, boolean flushNow) { boolean isRefreshedKeyspace = keyspace == null || refreshedKeyspaces.isEmpty() || refreshedKeyspaces.contains(keyspace); CompletableFuture<Metadata> future = new CompletableFuture<>(); if (isRefreshedKeyspace && (evenIfDisabled || isSchemaEnabled())) { RunOrSchedule.on(adminExecutor, () -> singleThreaded.acceptSchemaRequest(future, flushNow)); } else { future.complete(metadata); singleThreaded.firstSchemaRefreshFuture.complete(null); } return future; }

Target:
public CompletionStage<Metadata> refreshSchema( String keyspace, boolean evenIfDisabled, boolean flushNow) { CompletableFuture<Metadata> future = new CompletableFuture<>(); RunOrSchedule.on( adminExecutor, () -> singleThreaded.refreshSchema(keyspace, evenIfDisabled, flushNow, future)); return future; }
Source:
public void setMetadata(String id, String value) { esClient.prepareIndex(MetadataIndexDefinition.INDEX_TYPE_METADATA) .setId(id) .setSource(MetadataIndexDefinition.FIELD_VALUE, value) .setRefreshPolicy(REFRESH_IMMEDIATE) .get(); }

Target:
private void setMetadata(String id, String value) { esClient.prepareIndex(MetadataIndexDefinition.INDEX_TYPE_METADATA) .setId(id) .setSource(MetadataIndexDefinition.FIELD_VALUE, value) .setRefreshPolicy(REFRESH_IMMEDIATE) .get(); }
Source:
public void setup() { metadata = getQueryRunner().getMetadata(); sqlParser = getQueryRunner().getSqlParser(); ConnectorId connectorId = getCurrentConnectorId(); nationTableHandle = new TableHandle( connectorId, new TpchTableHandle("nation", 1.0), TestingTransactionHandle.create(), Optional.of(TestingHandle.INSTANCE)); nationTableLayoutHandle = new TableLayoutHandle(connectorId, TestingTransactionHandle.create(), new TpchTableLayoutHandle((TpchTableHandle) nationTableHandle.getConnectorHandle(), TupleDomain.all())); }

Target:
public void setup() { metadata = getQueryRunner().getMetadata(); sqlParser = getQueryRunner().getSqlParser(); TpchTableHandle nationTpchTableHandle = new TpchTableHandle("nation", 1.0); ConnectorId connectorId = getCurrentConnectorId(); nationTableHandle = new TableHandle( connectorId, nationTpchTableHandle, TestingTransactionHandle.create(), Optional.of(new TpchTableLayoutHandle(nationTpchTableHandle, TupleDomain.all()))); }
Source:
public void shouldAddDefaultHeaders() throws Exception { systemEnvironment.setProperty("gocd.enable.hsts.header", "true"); filter.doFilter(request, response, chain); verify(response).isCommitted(); verify(response).setHeader("X-XSS-Protection", "1; mode=block"); verify(response).setHeader("X-Content-Type-Options", "nosniff"); verify(response).setHeader("X-Frame-Options", "SAMEORIGIN"); verify(response).setHeader("X-UA-Compatible", "chrome=1"); verify(response).setHeader("Strict-Transport-Security", "31536000"); }

Target:
public void shouldAddDefaultHeaders() throws Exception { systemEnvironment.setProperty("gocd.enable.hsts.header", "true"); filter.doFilter(request, response, chain); verify(response).isCommitted(); verify(response).setHeader("X-XSS-Protection", "1; mode=block"); verify(response).setHeader("X-Content-Type-Options", "nosniff"); verify(response).setHeader("X-Frame-Options", "SAMEORIGIN"); verify(response).setHeader("X-UA-Compatible", "chrome=1"); verify(response).setHeader("Strict-Transport-Security", "max-age=31536000"); }
Source:
private static String[] getFolders() { File backupFolder = new File(BACKUP_FOLDER); String[] folders = backupFolder.list(); if (folders == null) { return new String[] {}; } List<String> listOfFolders = Arrays.asList(folders); listOfFolders.sort(new Comparator<String>() { @Override public int compare(String o1, String o2) { DateFormat dateFormat = new SimpleDateFormat("yyyy_MM_dd HH.mm.ss"); try { Date firstDate = dateFormat.parse(o1); Date secondDate = dateFormat.parse(o2); return secondDate.compareTo(firstDate); } catch (ParseException e) { return 0; } } }); listOfFolders.toArray(folders); return folders; }

Target:
private static String[] getFolders() { File backupFolder = new File(BACKUP_FOLDER); String[] folders = backupFolder.list(); if (folders == null) { return new String[] {}; } List<String> listOfFolders = Arrays.asList(folders); listOfFolders.sort((o1, o2) -> { DateFormat dateFormat = new SimpleDateFormat("yyyy_MM_dd HH.mm.ss"); try { Date firstDate = dateFormat.parse(o1); Date secondDate = dateFormat.parse(o2); return secondDate.compareTo(firstDate); } catch (ParseException e) { return 0; } }); listOfFolders.toArray(folders); return folders; }
Source:
public void testBasicDeletion() throws Exception { ifServerRespond = true; initialize("9"); ServerErrorCode[] serverErrorCodes = new ServerErrorCode[9]; Arrays.fill(serverErrorCodes, ServerErrorCode.No_Error); writeBlobRecordToServers(serverErrorCodes); future = router.deleteBlob(blobIdString, new ClientCallback()); future.get(); assertCloseCleanup(); }

Target:
public void testBasicDeletion() throws Exception { ServerErrorCode[] serverErrorCodes = new ServerErrorCode[9]; Arrays.fill(serverErrorCodes, ServerErrorCode.No_Error); presetServerErrorCode(serverErrorCodes); future = router.deleteBlob(blobIdString, new ClientCallback()); future.get(); }
Source:
public Optional<Message> next() { try { if (readQueue.isEmpty()) { ConsumerRecords<byte[], byte[]> records = consumer.poll(pollTimeout); try { for (ConsumerRecord<byte[], byte[]> record : records) { readQueue.add(convertToMessage(record)); } } catch (Exception ex) { logger.error("Failed to read message for subscription {}, readQueueSize {}, records {}", subscription.getQualifiedName(), readQueue.size(), records.count(), ex); } } return Optional.ofNullable(readQueue.poll()); } catch (InterruptException ex ) { logger.debug("Interrupting kafka consumer...", ex); Thread.currentThread().interrupt(); return Optional.empty(); } catch (KafkaException ex) { logger.error("Error while reading message for subscription {}", subscription.getQualifiedName(), ex); return Optional.empty(); } catch (Exception ex) { logger.error("Failed to read message for subscription {}, readQueueSize {}", subscription.getQualifiedName(), readQueue.size(), ex); return Optional.empty(); } }

Target:
public Optional<Message> next() { try { if (readQueue.isEmpty()) { ConsumerRecords<byte[], byte[]> records = consumer.poll(pollTimeout); try { for (ConsumerRecord<byte[], byte[]> record : records) { readQueue.add(convertToMessage(record)); } } catch (Exception ex) { logger.error("Failed to read message for subscription {}, readQueueSize {}, records {}", subscription.getQualifiedName(), readQueue.size(), records.count(), ex); } } return Optional.ofNullable(readQueue.poll()); } catch (InterruptException ex ) { logger.info("Kafka consumer thread interrupted", ex); Thread.currentThread().interrupt(); return Optional.empty(); } catch (KafkaException ex) { logger.error("Error while reading message for subscription {}", subscription.getQualifiedName(), ex); return Optional.empty(); } catch (Exception ex) { logger.error("Failed to read message for subscription {}, readQueueSize {}", subscription.getQualifiedName(), readQueue.size(), ex); return Optional.empty(); } }
Source:
public static int getSmallImageGrade(Product product) { String nutritionGrade = null; if (product != null) { nutritionGrade = product.getNutritionGradeFr() != null ? product.getNutritionGradeFr() : product.getNutritionGradeTag(); } return getSmallImageGrade(nutritionGrade); }

Target:
public static int getSmallImageGrade(Product product) { if (product == null) { return getSmallImageGrade((String) null); } if (product.getNutritionGradeTag() != null) { return getSmallImageGrade(product.getNutritionGradeTag()); } else { return getSmallImageGrade(product.getNutritionGradeFr()); } }
Source:
public Img< DoubleType > createOutput( final IterableInterval< T > input ) { final int numDimensions = input.numDimensions(); if ( input.numDimensions() != 2 ) { throw new IllegalArgumentException( "Cannot compute Hough circle transform for non-2D images. Got " + numDimensions + "D image." ); } maxRadius = Math.max( minRadius, maxRadius ); minRadius = Math.min( minRadius, maxRadius ); final long nRadiuses = ( maxRadius - minRadius ) / stepRadius + 1; final long[] dims = new long[ numDimensions + 1 ]; for ( int d = 0; d < numDimensions; d++ ) dims[ d ] = input.dimension( d ); dims[ numDimensions ] = nRadiuses; final Dimensions dimensions = FinalDimensions.wrap( dims ); final ImgFactory< DoubleType > factory = ops().create().imgFactory( dimensions ); final Img< DoubleType > votes = factory.create( dimensions, new DoubleType() ); return votes; }

Target:
public Img<DoubleType> createOutput(final IterableInterval<T> input) { final long maxR = Math.max(minRadius, maxRadius); final long minR = Math.min(minRadius, maxRadius); maxRadius = maxR; minRadius = minR; final long nRadiuses = (maxRadius - minRadius) / stepRadius + 1; final int numDimensions = input.numDimensions(); final long[] dims = new long[numDimensions + 1]; for (int d = 0; d < numDimensions; d++) dims[d] = input.dimension(d); dims[numDimensions] = nRadiuses; final Dimensions dimensions = FinalDimensions.wrap(dims); final ImgFactory<DoubleType> factory = ops().create().imgFactory( dimensions); final Img<DoubleType> votes = factory.create(dimensions, new DoubleType()); return votes; }
Source:
public void tearDown() throws Exception { InitialSQL ini = new InitialSQL(mConfig); ini.exe(); ProjectManager projectManager = new ProjectManager(); projectManager.deleteAllProject(); ini = null; mCP = null; mConfig = null; mControl = null; }

Target:
public void tearDown() throws Exception { InitialSQL ini = new InitialSQL(mConfig); ini.exe(); ProjectManager projectManager = new ProjectManager(); projectManager.deleteAllProject(); mConfig.setTestMode(false); mConfig.save(); ini = null; mCP = null; mConfig = null; mControl = null; }
Source:
protected List<MethodMatcher> getMethodInvocationMatchers() { return ImmutableList.of( MethodMatcher.create() .typeDefinition(TypeCriteria.is("javax.crypto.Cipher")) .name("getInstance") .withAnyParameters(), MethodMatcher.create() .typeDefinition(TypeCriteria.is("org.apache.commons.crypto.utils.Utils")) .name("getCipherInstance") .withAnyParameters()); }

Target:
protected List<MethodMatcher> getMethodInvocationMatchers() { return ImmutableList.of( MethodMatcher.create() .typeDefinition("javax.crypto.Cipher") .name("getInstance") .withAnyParameters(), MethodMatcher.create() .typeDefinition("org.apache.commons.crypto.utils.Utils") .name("getCipherInstance") .withAnyParameters()); }
Source:
public void shoulReturnSameResourceVariant() throws Exception { String fileName = "Main.java"; File file = testRepo.createFile(iProject, fileName); testRepo.appendContentAndCommit(iProject, file, "class Main {}", "initial commit"); IFile mainJava = testRepo.getIFile(iProject, file); GitSynchronizeData data = new GitSynchronizeData(repo, Constants.HEAD, Constants.MASTER, false); GitSynchronizeDataSet dataSet = new GitSynchronizeDataSet(data); GitResourceVariantTree grvt = new GitRemoteResourceVariantTree(dataSet); IResourceVariant actual = grvt.getResourceVariant(mainJava); assertNotNull(actual); assertEquals(fileName, actual.getName()); InputStream actualIn = actual.getStorage(new NullProgressMonitor()) .getContents(); byte[] actualByte = new byte[actualIn.available()]; actualIn.read(actualByte); InputStream expectedIn = mainJava.getContents(); byte[] expectedByte = new byte[expectedIn.available()]; expectedIn.read(expectedByte); assertArrayEquals(expectedByte, actualByte); }

Target:
public void shoulReturnSameResourceVariant() throws Exception { String fileName = "Main.java"; File file = testRepo.createFile(iProject, fileName); testRepo.appendContentAndCommit(iProject, file, "class Main {}", "initial commit"); IFile mainJava = testRepo.getIFile(iProject, file); GitSynchronizeData data = new GitSynchronizeData(repo, Constants.HEAD, Constants.MASTER, false); GitSynchronizeDataSet dataSet = new GitSynchronizeDataSet(data); GitResourceVariantTree grvt = new GitRemoteResourceVariantTree(dataSet); IResourceVariant actual = grvt.getResourceVariant(mainJava); assertNotNull(actual); assertEquals(fileName, actual.getName()); InputStream actualIn = actual.getStorage(new NullProgressMonitor()) .getContents(); byte[] actualByte = getBytesAndCloseStream(actualIn); InputStream expectedIn = mainJava.getContents(); byte[] expectedByte = getBytesAndCloseStream(expectedIn); assertArrayEquals(expectedByte, actualByte); }
Source:
public Task<Void> saveInBackground(final ProgressCallback uploadProgressCallback) { if (data != null && file != null) { throw new IllegalArgumentException("File and data can not be set at the same time"); } final Task<Void>.TaskCompletionSource cts = Task.create(); currentTasks.add(cts); return ParseUser.getCurrentSessionTokenAsync().onSuccessTask(new Continuation<String, Task<Void>>() { @Override public Task<Void> then(Task<String> task) throws Exception { final String sessionToken = task.getResult(); return saveAsync(sessionToken, uploadProgressCallback, cts.getTask()); } }).continueWithTask(new Continuation<Void, Task<Void>>() { @Override public Task<Void> then(Task<Void> task) throws Exception { cts.trySetResult(null); currentTasks.remove(cts); return task; } }); }

Target:
public Task<Void> saveInBackground(final ProgressCallback uploadProgressCallback) { final Task<Void>.TaskCompletionSource cts = Task.create(); currentTasks.add(cts); return ParseUser.getCurrentSessionTokenAsync().onSuccessTask(new Continuation<String, Task<Void>>() { @Override public Task<Void> then(Task<String> task) throws Exception { final String sessionToken = task.getResult(); return saveAsync(sessionToken, uploadProgressCallback, cts.getTask()); } }).continueWithTask(new Continuation<Void, Task<Void>>() { @Override public Task<Void> then(Task<Void> task) throws Exception { cts.trySetResult(null); currentTasks.remove(cts); return task; } }); }
Source:
protected List<String> getTabCompleteOptions(Server server, CommandSource sender, String commandLabel, String[] args) { if (args.length == 3 && sender.isAuthorized("essentials.speed.others", ess)) { return getPlayers(server, sender); } else { return Collections.emptyList(); } }

Target:
protected List<String> getTabCompleteOptions(Server server, CommandSource sender, String commandLabel, String[] args) { if (args.length == 1) { return types; } else if (args.length == 2) { return speeds; } else if (args.length == 3 && sender.isAuthorized("essentials.speed.others", ess)) { return getPlayers(server, sender); } else { return Collections.emptyList(); } }
Source:
public final BlobQuickQueryInputStream openInputStream(String expression, BlobQuickQuerySerialization input, BlobQuickQuerySerialization output, BlobRequestConditions requestConditions, ErrorReceiver<BlobQuickQueryError> nonFatalErrorReceiver, ProgressReceiver progressReceiver) { Flux<ByteBuffer> data = client.queryWithResponse(expression, input, output, requestConditions) .flatMapMany(ResponseBase::getValue); FluxInputStream fluxInputStream = new FluxInputStream(data, logger); return new BlobQuickQueryInputStream(fluxInputStream, nonFatalErrorReceiver, progressReceiver); }

Target:
public final BlobQuickQueryInputStream openInputStream(String expression, BlobQuickQuerySerialization input, BlobQuickQuerySerialization output, BlobRequestConditions requestConditions, ErrorReceiver<BlobQuickQueryError> nonFatalErrorReceiver, ProgressReceiver progressReceiver) { Flux<ByteBuffer> data = client.queryWithResponse(expression, input, output, requestConditions) .flatMapMany(BlobQuickQueryAsyncResponse::getValue); FluxInputStream fluxInputStream = new FluxInputStream(data, logger); return new BlobQuickQueryInputStream(fluxInputStream, nonFatalErrorReceiver, progressReceiver); }
Source:
private static void dumpThreads(String safeTestName, List<String> pids) { try { File jstackFile = new File(System.getProperty("java.home") + "/../bin/jstack"); if (!jstackFile.canExecute()) { jstackFile = new File(System.getProperty("java.home") + "/bin/jstack"); } LocalDateTime now = LocalDateTime.now(); if (jstackFile.canExecute() && !pids.isEmpty()) { for (String pid : pids) { File dumpFile = new File(String.format("threaddump-%1$s-%2$tY-%2$tm-%2$td-%3$s.log", safeTestName, now, pid)); System.out.printf("Dumping thread stacks of process %s to %s\n", pid, dumpFile.getAbsolutePath()); Process jstack = new ProcessBuilder() .command(System.getProperty("java.home") + "/../bin/jstack", pid) .redirectOutput(dumpFile) .start(); jstack.waitFor(10, SECONDS); } } else { File dumpFile = new File(String.format("threaddump-%1$s-%2$tY-%2$tm-%2$td.log", safeTestName, now)); ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean(); try (PrintWriter writer = new PrintWriter(new FileWriter(dumpFile))) { writer.printf("%1$tF %1$tT\nTest thread dump:\n\n", now); ThreadInfo[] threads = threadMXBean.dumpAllThreads(true, true); for (ThreadInfo thread : threads) { dumpThread(writer, thread); } } } } catch (Exception e) { System.err.println("Error dumping threads:"); e.printStackTrace(System.err); } }

Target:
private static void dumpThreads(String safeTestName, List<String> pids) { try { File jstackFile = new File(System.getProperty("java.home") + "/../bin/jstack"); if (!jstackFile.canExecute()) { jstackFile = new File(System.getProperty("java.home") + "/bin/jstack"); } LocalDateTime now = LocalDateTime.now(); if (jstackFile.canExecute() && !pids.isEmpty()) { for (String pid : pids) { File dumpFile = new File(String.format("threaddump-%1$s-%2$tY-%2$tm-%2$td-%3$s.log", safeTestName, now, pid)); System.out.printf("Dumping thread stacks of process %s to %s\n", pid, dumpFile.getAbsolutePath()); Process jstack = new ProcessBuilder() .command(jstackFile.getAbsolutePath(), pid) .redirectOutput(dumpFile) .start(); jstack.waitFor(10, SECONDS); } } else { File dumpFile = new File(String.format("threaddump-%1$s-%2$tY-%2$tm-%2$td.log", safeTestName, now)); ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean(); try (PrintWriter writer = new PrintWriter(new FileWriter(dumpFile))) { writer.printf("%1$tF %1$tT\nTest thread dump:\n\n", now); ThreadInfo[] threads = threadMXBean.dumpAllThreads(true, true); for (ThreadInfo thread : threads) { dumpThread(writer, thread); } } } } catch (Exception e) { System.err.println("Error dumping threads:"); e.printStackTrace(System.err); } }
Source:
public static void tearDown() throws Exception { List inputList = new ArrayList<>(); inputList.addAll(Arrays.asList(SessionVars.GROUPBY_MULTI_LEVEL_ENABLED.keyname())); client.unsetSessionVariables(inputList); }

Target:
public static void tearDown() throws Exception { client.unsetSessionVariables(Arrays.asList(SessionVars.GROUPBY_MULTI_LEVEL_ENABLED.keyname())); }
Source:
public boolean configureNetworkRulesVMSecondaryIP(final Connect conn, final String vmName, final String secIp, final String action) { if (!_canBridgeFirewall) { return false; } final Script cmd = new Script(_securityGroupPath, _timeout.getMillis(), s_logger); cmd.add("network_rules_vmSecondaryIp"); cmd.add("--vmname", vmName); cmd.add("--nicsecips", secIp); cmd.add("--action", action); final String result = cmd.execute(); if (result != null) { return false; } return true; }

Target:
public boolean configureNetworkRulesVMSecondaryIP(final Connect conn, final String vmName, final String secIp, final String action) { if (!_canBridgeFirewall) { return false; } final Script cmd = new Script(_securityGroupPath, _timeout, s_logger); cmd.add("network_rules_vmSecondaryIp"); cmd.add("--vmname", vmName); cmd.add("--nicsecips", secIp); cmd.add("--action", action); final String result = cmd.execute(); if (result != null) { return false; } return true; }
Source:
public void setup() { hydrator = new HandlebarsHydrator(); testClass = new DynamicConfigValidator(CONFIG_PATH); try { testClass.readAndValidateConfigs(); } catch (IOException e) { e.printStackTrace(); } }

Target:
public void setup() throws IOException { hydrator = new HandlebarsHydrator(); testClass = new DynamicConfigValidator(CONFIG_PATH); testClass.readAndValidateConfigs(); }
Source:
public void test() { String title = getViewTitle(); SWTBotView viewBot = fBot.viewByTitle(title); viewBot.show(); viewBot.setFocus(); TmfSignalManager.dispatchSignal(new TmfSelectionRangeUpdatedSignal(this, START_TIME)); fBot.waitUntil(ConditionHelpers.timeGraphIsReadyCondition((AbstractTimeGraphView) viewBot.getViewReference().getPart(false), new TmfTimeRange(START_TIME, START_TIME), START_TIME)); openDialog(viewBot); SWTBotShell shell = fBot.shell("Find"); SWTBot bot = shell.bot(); SWTBotButton findButton = bot.button("Fi&nd"); String text = getFindText(); testWrapSearch(text, bot, findButton, viewBot); testDirectionSearch(true, text, bot, findButton, viewBot); testCaseSensitive(text, bot, findButton); final @NonNull String ttext = text.split(SPACE)[0]; testWholeWord(ttext, bot, findButton); testRegEx(REGEX_PREFIX + ttext, bot, findButton); testDirectionSearch(false, text, bot, findButton, viewBot); }

Target:
public void test() { String title = getViewTitle(); SWTBotView viewBot = fBot.viewByTitle(title); viewBot.show(); viewBot.setFocus(); TmfSignalManager.dispatchSignal(new TmfSelectionRangeUpdatedSignal(this, START_TIME)); fBot.waitUntil(ConditionHelpers.timeGraphIsReadyCondition((AbstractTimeGraphView) viewBot.getViewReference().getPart(false), new TmfTimeRange(START_TIME, START_TIME), START_TIME)); openDialog(viewBot); SWTBot bot = getDialogBot(); SWTBotButton findButton = bot.button("Fi&nd"); String text = getFindText(); testWrapSearch(text, bot, findButton, viewBot); testDirectionSearch(true, text, bot, findButton, viewBot); testCaseSensitive(text, bot, findButton); final @NonNull String ttext = text.split(SPACE)[0]; testWholeWord(ttext, bot, findButton); testRegEx(REGEX_PREFIX + ttext, bot, findButton); testDirectionSearch(false, text, bot, findButton, viewBot); testOpenCloseDialog(viewBot); }
Source:
public void sendVerificationmail(User user, String url) { String message = "Please click on the following link to complete your registration: <a href=\"" + url + "\">" + url + "</a><br /><br />If the link does not work, please copy the link and" + " paste it into your browser."; sendMail(user.getUsername(), user.getProfile().getFirstName() + " " + user.getProfile().getLastName(), "Confirm your registration", message); }

Target:
public void sendVerificationmail(User user, String url) { String message = "Please click on the following link to complete your registration: <a href=\"" + url + "\">" + url + "</a><br /><br />If the link does not work, please copy the link and" + " paste it into your browser."; sendMail(user.getUsername(), formatRecipient(user), "Confirm your registration", message); }