auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public CompletableFuture<Void> visitKeySetCommand(InvocationContext ctx, KeySetCommand command) throws Throwable { if (ctx.isOriginLocal()) { TypeConverter<Object, Object, Object, Object> converter = determineTypeConverter(command.getFlags()); CacheSet<K> set = (CacheSet<K>) ctx.forkInvocationSync(command); return ctx.shortCircuit(new AbstractDelegatingKeyCacheSet<K, V>(Caches.getCacheWithFlags(cache, command), set) { @Override public CloseableIterator<K> iterator() { return new CloseableIteratorMapper<>(super.iterator(), k -> (K) converter.unboxKey(k)); } @Override public CloseableSpliterator<K> spliterator() { return new IteratorAsSpliterator.Builder<>(iterator()) .setEstimateRemaining(super.spliterator().estimateSize()) .setCharacteristics(Spliterator.CONCURRENT | Spliterator.DISTINCT | Spliterator.NONNULL) .get(); } protected CacheStream<K> getStream(boolean parallel) { DistributionManager dm = cache.getAdvancedCache().getDistributionManager(); CloseableSpliterator<K> closeableSpliterator = super.spliterator(); CacheStream<K> stream = new LocalCacheStream<>(new KeyStreamSupplier<>(cache, dm != null ? dm.getConsistentHash() : null, () -> StreamSupport.stream(closeableSpliterator, parallel)), parallel, cache.getAdvancedCache().getComponentRegistry()); stream.onClose(() -> closeableSpliterator.close()); return new TypeConverterStream(stream, converter, entryFactory); } }); } return ctx.continueInvocation(); }

Target:
public CompletableFuture<Void> visitKeySetCommand(InvocationContext ctx, KeySetCommand command) throws Throwable { if (ctx.isOriginLocal()) { TypeConverter<Object, Object, Object, Object> converter = determineTypeConverter(command.getFlags()); CacheSet<K> set = (CacheSet<K>) ctx.forkInvocationSync(command); return ctx.shortCircuit(new AbstractDelegatingKeyCacheSet<K, V>(Caches.getCacheWithFlags(cache, command), set) { @Override public CloseableIterator<K> iterator() { return new CloseableIteratorMapper<>(super.iterator(), k -> (K) converter.unboxKey(k)); } @Override public CloseableSpliterator<K> spliterator() { return new IteratorAsSpliterator.Builder<>(iterator()) .setEstimateRemaining(super.spliterator().estimateSize()) .setCharacteristics(Spliterator.CONCURRENT | Spliterator.DISTINCT | Spliterator.NONNULL) .get(); } protected CacheStream<K> getStream(boolean parallel) { DistributionManager dm = cache.getAdvancedCache().getDistributionManager(); CloseableSpliterator<K> closeableSpliterator = super.spliterator(); CacheStream<K> stream = new LocalCacheStream<>(new KeyStreamSupplier<>(cache, dm != null ? dm.getConsistentHash() : null, () -> StreamSupport.stream(closeableSpliterator, parallel)), parallel, cache.getAdvancedCache().getComponentRegistry()); stream.onClose(closeableSpliterator::close); return new TypeConverterStream(stream, converter, entryFactory); } }); } return ctx.continueInvocation(); }
Source:
boolean doesColumnExist(Connection conn, String tableName, String columnName) throws SQLException { final String tableInfoQueryTemplate = "PRAGMA table_info(%s)"; ResultSet resultSet; Statement statement = conn.createStatement(); boolean columnExists = false; resultSet = statement.executeQuery(String.format(tableInfoQueryTemplate, tableName)); try { while (resultSet.next()) { if (resultSet.getString(2).equals(columnName)) { columnExists = true; break; } } } finally { resultSet.close(); statement.close(); } return columnExists; }

Target:
boolean doesColumnExist(Connection conn, String tableName, String columnName) throws SQLException { final String tableInfoQueryTemplate = "PRAGMA table_info(%s)"; ResultSet resultSet = null; Statement statement = null; boolean columnExists = false; try { statement = conn.createStatement(); resultSet = statement.executeQuery(String.format(tableInfoQueryTemplate, tableName)); while (resultSet.next()) { if (resultSet.getString(2).equals(columnName)) { columnExists = true; break; } } } finally { EamDbUtil.closeResultSet(resultSet); EamDbUtil.closeStatement(statement); } return columnExists; }
Source:
public static TNodeTemplate.Capabilities cloneCapabilities(TNodeTemplate nodeTemplate) { if (nodeTemplate.getCapabilities() == null) { LOGGER.info("Capabilites are null, not cloned any capabilities for " + nodeTemplate.getId()); return null; } TNodeTemplate.Capabilities fixedCapabilities = new TNodeTemplate.Capabilities(); for (int i = 0; i < nodeTemplate.getCapabilities().getCapability().size(); i++) { TCapability tempCapability = new TCapability(); String id = nodeTemplate.getCapabilities().getCapability().get(i).getId() + "_" + idCounterCapabilities; tempCapability.setId(id); tempCapability.setName(nodeTemplate.getCapabilities().getCapability().get(i).getName()); tempCapability.setProperties(nodeTemplate.getCapabilities().getCapability().get(i).getProperties()); tempCapability.setPropertyConstraints(nodeTemplate.getCapabilities().getCapability().get(i).getPropertyConstraints()); tempCapability.setType(nodeTemplate.getCapabilities().getCapability().get(i).getType()); fixedCapabilities.getCapability().add(tempCapability); LOGGER.info("Cloned requirements for " + nodeTemplate.getId()); idCounterCapabilities++; } return fixedCapabilities; }

Target:
public static TNodeTemplate.Capabilities cloneCapabilities(TNodeTemplate nodeTemplate) { if (nodeTemplate.getCapabilities() == null) { LOGGER.debug("Capabilites are null, not cloned any capabilities for " + nodeTemplate.getId()); return null; } TNodeTemplate.Capabilities fixedCapabilities = new TNodeTemplate.Capabilities(); for (int i = 0; i < nodeTemplate.getCapabilities().getCapability().size(); i++) { TCapability tempCapability = new TCapability(); String id = nodeTemplate.getCapabilities().getCapability().get(i).getId() + "_" + idCounterCapabilities; tempCapability.setId(id); tempCapability.setName(nodeTemplate.getCapabilities().getCapability().get(i).getName()); tempCapability.setProperties(nodeTemplate.getCapabilities().getCapability().get(i).getProperties()); tempCapability.setPropertyConstraints(nodeTemplate.getCapabilities().getCapability().get(i).getPropertyConstraints()); tempCapability.setType(nodeTemplate.getCapabilities().getCapability().get(i).getType()); fixedCapabilities.getCapability().add(tempCapability); LOGGER.debug("Cloned requirements for " + nodeTemplate.getId()); idCounterCapabilities++; } return fixedCapabilities; }
Source:
private List<Row> updateRows(List<Row> rows) { for (ListIterator<Row> it = rows.listIterator(); it.hasNext();) { final Row original = (Row) it.next(); validateUpdateType(original); final Row updated = update(original); it.set(updated); } return rows; }

Target:
private List<Row> updateRows(List<Row> rows) { for (ListIterator<Row> it = rows.listIterator(); it.hasNext();) { final Row original = (Row) it.next(); final Row updated = update(original); it.set(updated); } return rows; }
Source:
public void start(DatastreamEventCollectorFactory collectorFactory) { LOG.info("START: Connector::start. Connector: " + _connector.getConnectorType() + ", Instance: " + _instanceName); _lastError = null; long startTime = System.currentTimeMillis(); try { _connector.start(collectorFactory); } catch (Exception ex) { LOG.error("Failed to call connector API: Connector::start", ex); _lastError = ex.getStackTrace().toString(); } long endTime = System.currentTimeMillis(); LOG.info("END: Connector::start. Connector: " + _connector.getConnectorType() + ", Instance: " + _instanceName + ", duration: " + (endTime - startTime) + " milliseconds"); }

Target:
public void start(DatastreamEventCollectorFactory collectorFactory) { logApiStart("start"); try { _connector.start(collectorFactory); } catch (Exception ex) { logErrorAndException("start", ex); } logApiEnd("start"); }
Source:
public EntityRef create(Iterable<Component> components) { EntityRef entity = create(); String prefabName = null; BlockUri blockUri = null; for (Component component : components) { if (component instanceof EntityInfoComponent) { EntityInfoComponent comp = (EntityInfoComponent) component; prefabName = comp.parentPrefab; if (blockUri != null) break; } else if (component instanceof BlockComponent) { BlockComponent comp = (BlockComponent) component; blockUri = comp.getBlock().getBlockFamily().getURI(); if (prefabName != null) break; } } EntityBeingGenerated event = new EntityBeingGenerated(prefabName, blockUri, components); eventSystem.send(entity, event); components = event.getResultComponents(); for (Component c : components) { store.put(entity.getId(), c); } if (eventSystem != null) { eventSystem.send(entity, OnAddedComponent.newInstance()); eventSystem.send(entity, OnActivatedComponent.newInstance()); } return entity; }

Target:
public EntityRef create(Iterable<Component> components) { EntityRef entity = createAndSendEvent(components); if (eventSystem != null) { eventSystem.send(entity, OnAddedComponent.newInstance()); eventSystem.send(entity, OnActivatedComponent.newInstance()); } return entity; }
Source:
private void ensureDateActivatedIsSet(Order order) { isDrugOrder = DrugOrder.class.isAssignableFrom(getActualType(order)); concept = order.getConcept(); }

Target:
private void ensureDateActivatedIsSet(Order order) { if (order.getDateActivated() == null) { order.setDateActivated(new Date()); } }
Source:
public CsvParserConfig(CsvPreference preferences) { this.preferences = preferences; this.oneLineRecord = false; this.quotedEmptyIsNull = false; this.skipCarriageReturn = true; }

Target:
public CsvParserConfig(CsvPreference preferences) { this.preferences = preferences; this.oneLineRecord = false; this.quotedEmptyIsNull = false; this.preserveLineEndings = true; }
Source:
public Map<String, String> getJobMessageProperties() { if (jobProperties == null) { jobProperties = super.getJobMessageProperties(); jobProperties.put(VdcObjectType.VM.name().toLowerCase(), (getVmName() == null) ? "" : getVmName()); jobProperties.put(VdcObjectType.VdsGroups.name().toLowerCase(), getVdsGroupName()); jobProperties.put(VdcObjectType.StoragePool.name(), getStoragePoolName()); } return jobProperties; }

Target:
public Map<String, String> getJobMessageProperties() { if (jobProperties == null) { jobProperties = super.getJobMessageProperties(); jobProperties.put(VdcObjectType.VM.name().toLowerCase(), (getVmName() == null) ? "" : getVmName()); jobProperties.put(VdcObjectType.VdsGroups.name().toLowerCase(), getVdsGroupName()); } return jobProperties; }
Source:
private String createResults() { QueryResults queryResults = new QueryResults( "20160128_214710_00012_rk68b", server.url("/query.html?20160128_214710_00012_rk68b").uri(), null, null, ImmutableList.of(new Column("_col0", BigintType.BIGINT)), ImmutableList.of(ImmutableList.of(123)), StatementStats.builder().setState("FINISHED").build(), null, null, null, null); return QUERY_RESULTS_CODEC.toJson(queryResults); }

Target:
private String createResults() { QueryResults queryResults = new QueryResults( "20160128_214710_00012_rk68b", server.url("/query.html?20160128_214710_00012_rk68b").uri(), null, null, ImmutableList.of(new Column("_col0", BigintType.BIGINT)), ImmutableList.of(ImmutableList.of(123)), StatementStats.builder().setState("FINISHED").build(), null, ImmutableList.of(), null, null); return QUERY_RESULTS_CODEC.toJson(queryResults); }
Source:
public boolean isConnectSucceeded(final Map<String, String> returnValue, List<StorageServerConnections> connections) { boolean result = true; List<String> failedConnectionsList = LinqUtils.filter(returnValue.keySet(), new Predicate<String>() { @Override public boolean eval(String a) { return !"0".equals(returnValue.get(a)); } }); for (String failedConnection : failedConnectionsList) { List<LUNs> failedLuns = DbFacade.getInstance().getLunDao() .getAllForStorageServerConnection(failedConnection); if (!failedLuns.isEmpty()) { for (LUNs lun : failedLuns) { List<String> strings = LinqUtils.transformToList( DbFacade.getInstance() .getStorageServerConnectionLunMapDao() .getAll(lun.getLUN_id()), new Function<LUN_storage_server_connection_map, String>() { @Override public String eval(LUN_storage_server_connection_map a) { return a.getstorage_server_connection(); } }); if (CollectionUtils.subtract(strings, failedConnectionsList).size() == 0) { log.info("The lun with id '{}' was reported as problematic !", lun.getphysical_volume_id()); for (String connectionFailed : failedConnectionsList) { String connectionField = addToAuditLogErrorMessage(connectionFailed, returnValue.get(connectionFailed), connections, lun); printLog(log, connectionField, returnValue.get(connectionFailed)); } return false; } } } else { result = false; printLog(log, failedConnection, returnValue.get(failedConnection)); } } return result; }

Target:
public boolean isConnectSucceeded(final Map<String, String> returnValue, List<StorageServerConnections> connections) { boolean result = true; List<String> failedConnectionsList = LinqUtils.filter(returnValue.keySet(), new Predicate<String>() { @Override public boolean eval(String a) { return !"0".equals(returnValue.get(a)); } }); for (String failedConnection : failedConnectionsList) { List<LUNs> failedLuns = DbFacade.getInstance().getLunDao() .getAllForStorageServerConnection(failedConnection); if (!failedLuns.isEmpty()) { for (LUNs lun : failedLuns) { List<String> strings = LinqUtils.transformToList( DbFacade.getInstance() .getStorageServerConnectionLunMapDao() .getAll(lun.getLUN_id()), new Function<LUN_storage_server_connection_map, String>() { @Override public String eval(LUN_storage_server_connection_map a) { return a.getstorage_server_connection(); } }); if (CollectionUtils.subtract(strings, failedConnectionsList).size() == 0) { log.info("The lun with id '{}' was reported as problematic", lun.getphysical_volume_id()); for (String connectionFailed : failedConnectionsList) { String connectionField = addToAuditLogErrorMessage(connectionFailed, returnValue.get(connectionFailed), connections, lun); printLog(log, connectionField, returnValue.get(connectionFailed)); } return false; } } } else { result = false; printLog(log, failedConnection, returnValue.get(failedConnection)); } } return result; }
Source:
private Boolean buildFile(String path) { File csvFile = new File(path); if(csvFile.exists() && !csvFile.isDirectory()) { Long currentTime = System.currentTimeMillis(); Long fileCreationTime = csvFile.lastModified(); if ((currentTime - fileCreationTime ) > 3600000) { return true; } return false; } else if (!csvFile.exists()) { return true; } else { return false; } }

Target:
private Boolean buildFile(String path) { File csvFile = new File(path); if (csvFile.exists() && !csvFile.isDirectory()) { Long currentTime = System.currentTimeMillis(); Long fileCreationTime = csvFile.lastModified(); if ((currentTime - fileCreationTime ) > SECONDS_IN_ONE_HOUR) { return true; } return false; } else if (!csvFile.exists()) { return true; } else { return false; } }
Source:
private ComputerLauncher determineLauncher(final VSphere vSphere, final String cloneName) throws VSphereException { if (launcher instanceof JNLPLauncher) { return launcher; } if (launcher instanceof CommandLauncher) { return launcher; } if (launcher instanceof SSHLauncher) { final SSHLauncher sshLauncher = (SSHLauncher) launcher; LOGGER.log(Level.FINER, "Slave {0} uses SSHLauncher - obtaining IP address...", cloneName); final String ip = vSphere.getIp(vSphere.getVmByName(cloneName), 1000); LOGGER.log(Level.FINER, "Slave {0} has IP address {1}", new Object[] { cloneName, ip }); final SSHLauncher launcherWithIPAddress = new SSHLauncher(ip, sshLauncher.getPort(), sshLauncher.getCredentialsId(), sshLauncher.getJvmOptions(), sshLauncher.getJavaPath(), sshLauncher.getPrefixStartSlaveCmd(), sshLauncher.getSuffixStartSlaveCmd(), sshLauncher.getLaunchTimeoutSeconds(), sshLauncher.getMaxNumRetries(), sshLauncher.getRetryWaitTime(), sshLauncher.getSshHostKeyVerificationStrategy()); } throw new IllegalStateException("Unsupported launcher (" + launcher + ") in template configuration"); }

Target:
private ComputerLauncher determineLauncher(final VSphere vSphere, final String cloneName) throws VSphereException { if (launcher instanceof JNLPLauncher) { return launcher; } if (launcher instanceof CommandLauncher) { return launcher; } if (launcher instanceof SSHLauncher) { final SSHLauncher sshLauncher = (SSHLauncher) launcher; LOGGER.log(Level.FINER, "Slave {0} uses SSHLauncher - obtaining IP address...", cloneName); final String ip = vSphere.getIp(vSphere.getVmByName(cloneName), 1000); LOGGER.log(Level.FINER, "Slave {0} has IP address {1}", new Object[] { cloneName, ip }); final SSHLauncher launcherWithIPAddress = new SSHLauncher(ip, sshLauncher.getPort(), sshLauncher.getCredentialsId(), sshLauncher.getJvmOptions(), sshLauncher.getJavaPath(), sshLauncher.getPrefixStartSlaveCmd(), sshLauncher.getSuffixStartSlaveCmd(), sshLauncher.getLaunchTimeoutSeconds(), sshLauncher.getMaxNumRetries(), sshLauncher.getRetryWaitTime(), sshLauncher.getSshHostKeyVerificationStrategy()); return launcherWithIPAddress; } throw new IllegalStateException("Unsupported launcher (" + launcher + ") in template configuration"); }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_crash_warning); Button closeButton = (Button)findViewById(R.id.CloseWarning); closeButton.setText(Localization.get("crash.warning.button")); closeButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { setResult(RESULT_OK); finish(); } }); Intent intent = getIntent(); setWarningText(intent); setHowToProceedText(intent); }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); loadSaveInstanceState(savedInstanceState); setContentView(R.layout.activity_crash_warning); setupUi(); }
Source:
public void testRemoveAll(){ final AtomicBoolean removed = new AtomicBoolean(false); final AtomicBoolean added = new AtomicBoolean(false); final AtomicInteger callCount = new AtomicInteger(0); final ObservableArrayList<String> list = new ObservableArrayList<>(); Assert.assertTrue(list.isEmpty()); Assert.assertEquals(list.size(), 0); addOnChangeListener(removed, added, callCount, list); list.addAll("1", "2", "3", "4", "5", "6", "7" ,"8" , "9", "10"); Assert.assertFalse(list.isEmpty()); Assert.assertEquals(list.size(), 10); Assert.assertTrue(added.get()); list.removeAll(Arrays.asList("1", "2", "3", "4", "5")); Assert.assertFalse(list.isEmpty()); Assert.assertEquals(list.size(), 5); assertSameContent(list, Arrays.asList("6", "7" ,"8" , "9", "10")); Assert.assertTrue(removed.get()); Assert.assertEquals(2, callCount.get()); list.clear(); }

Target:
public void testRemoveAll(){ final AtomicBoolean removed = new AtomicBoolean(false); final AtomicBoolean added = new AtomicBoolean(false); final AtomicInteger callCount = new AtomicInteger(0); final ObservableArrayList<String> list = new ObservableArrayList<>(); Assert.assertTrue(list.isEmpty()); Assert.assertEquals(list.size(), 0); addOnChangeListener(removed, added, callCount, list); list.addAll("1", "2", "3", "4", "5", "6", "7" ,"8" , "9", "10"); Assert.assertFalse(list.isEmpty()); Assert.assertEquals(list.size(), 10); Assert.assertTrue(added.get()); Assert.assertFalse(removed.get()); list.removeAll(Arrays.asList("1", "2", "3", "4", "5")); Assert.assertFalse(list.isEmpty()); Assert.assertEquals(list.size(), 5); assertSameContent(list, Arrays.asList("6", "7" ,"8" , "9", "10")); Assert.assertTrue(removed.get()); Assert.assertFalse(added.get()); Assert.assertEquals(2, callCount.get()); list.clear(); }
Source:
public Map<String, Metric.Builder> processRunMetrics(HashMap<String, Metric> rawMetrics) { Map<String, Metric.Builder> aggregateMetrics = new HashMap<String, Metric.Builder>(); for (String key : aggregate.keySet()) { Collection<Metric> metrics = aggregate.get(key); Collection<Measurements> measures = metrics.stream().map(Metric::getMeasurements).collect(Collectors.toList()); List<String> rawValues = measures.stream() .map(Measurements::getSingleString) .map( m -> { List<String> splitVals = Arrays.asList(m.split(",", 0)); if (splitVals.size() == 1 && "".equals(splitVals.get(0))) { return Collections.<String>emptyList(); } return splitVals; }) .flatMap(Collection::stream) .map(String::trim) .collect(Collectors.toList()); if (rawValues.isEmpty()) { continue; } boolean areAllDoubles = rawValues .stream() .allMatch( val -> { try { Double.parseDouble(val); return true; } catch (NumberFormatException e) { return false; } }); if (areAllDoubles) { Collection<Double> values = rawValues.stream().map(Double::parseDouble).collect(Collectors.toList()); HashMap<String, Double> stats = getStats(values); for (String statKey : stats.keySet()) { Metric.Builder metricBuilder = Metric.newBuilder(); metricBuilder .getMeasurementsBuilder() .setSingleString(String.format("%2.2f", stats.get(statKey))); aggregateMetrics.put( String.join(STATS_KEY_SEPARATOR, key, statKey), metricBuilder); } } else { CLog.i("Metric %s is not numeric", key); } } return aggregateMetrics; }

Target:
public Map<String, Metric.Builder> processRunMetrics(HashMap<String, Metric> rawMetrics) { return new HashMap<String, Metric.Builder>(); }
Source:
private ConditionalFlutation prewrite(ConditionalFlutation cm, Bytes row, Column col, Bytes val, Bytes primaryRow, Column primaryColumn, boolean isTriggerRow) { IteratorSetting iterConf = new IteratorSetting(10, PrewriteIterator.class); PrewriteIterator.setSnaptime(iterConf, startTs); boolean isTrigger = isTriggerRow && col.equals(notification.getColumn()); if (isTrigger) { PrewriteIterator.enableAckCheck(iterConf, notification.getTimestamp()); } Condition cond = new FluoCondition(env, col).setIterators(iterConf); if (cm == null) { cm = new ConditionalFlutation(env, row, cond); } else { cm.addCondition(cond); } if (val != null && val != DELETE) { cm.put(col, ColumnConstants.DATA_PREFIX | startTs, val.toArray()); } cm.put(col, ColumnConstants.LOCK_PREFIX | startTs, LockValue.encode(primaryRow, primaryColumn, val != null, val == DELETE, isTriggerRow, getTransactorID())); cm.put(col, ColumnConstants.LOCK_PREFIX | startTs, LockValue.encode(primaryRow, primaryColumn, val != null, val == DELETE, isTriggerRow, getTransactorID())); return cm; }

Target:
private ConditionalFlutation prewrite(ConditionalFlutation cm, Bytes row, Column col, Bytes val, Bytes primaryRow, Column primaryColumn, boolean isTriggerRow) { IteratorSetting iterConf = new IteratorSetting(10, PrewriteIterator.class); PrewriteIterator.setSnaptime(iterConf, startTs); boolean isTrigger = isTriggerRow && col.equals(notification.getColumn()); if (isTrigger) { PrewriteIterator.enableAckCheck(iterConf, notification.getTimestamp()); } Condition cond = new FluoCondition(env, col).setIterators(iterConf); if (cm == null) { cm = new ConditionalFlutation(env, row, cond); } else { cm.addCondition(cond); } if (val != null && val != DELETE) { cm.put(col, ColumnConstants.DATA_PREFIX | startTs, val.toArray()); } cm.put(col, ColumnConstants.LOCK_PREFIX | startTs, LockValue.encode(primaryRow, primaryColumn, val != null, val == DELETE, isTriggerRow, getTransactorID())); return cm; }
Source:
public AzkabanNode toAzkabanNode(final NodeBean nodeBean) { if (nodeBean.getType().equals(Constants.FLOW_NODE_TYPE)) { return new AzkabanFlow.AzkabanFlowBuilder() .setName(nodeBean.getName()) .setProps(nodeBean.getProps()) .setDependsOn(nodeBean.getDependsOn()) .setNodes( nodeBean.getNodes().stream().map(this::toAzkabanNode).collect(Collectors.toList())) .setFlowTrigger(toFlowTrigger(nodeBean.getTrigger())) .build(); } else { return new AzkabanJob.AzkabanJobBuilder() .setName(nodeBean.getName()) .setProps(nodeBean.getProps()) .setType(nodeBean.getType()) .setDependsOn(nodeBean.getDependsOn()) .build(); } }

Target:
public AzkabanNode toAzkabanNode(final NodeBean nodeBean) { if (nodeBean.getType().equals(Constants.FLOW_NODE_TYPE)) { return new AzkabanFlow.AzkabanFlowBuilder() .name(nodeBean.getName()) .props(nodeBean.getProps()) .dependsOn(nodeBean.getDependsOn()) .nodes(nodeBean.getNodes().stream().map(this::toAzkabanNode).collect(Collectors.toList())) .flowTrigger(toFlowTrigger(nodeBean.getTrigger())) .build(); } else { return new AzkabanJob.AzkabanJobBuilder() .name(nodeBean.getName()) .props(nodeBean.getProps()) .type(nodeBean.getType()) .dependsOn(nodeBean.getDependsOn()) .build(); } }
Source:
protected void fillFileBox(RemoteWebElement fileBoxElement, String fileName) { if (fileName.isEmpty()) { fileBoxElement.clear(); } else { fileBoxElement.setFileDetector(new UselessFileDetector()); String newFilePath = new File(fileName).getAbsolutePath(); fileBoxElement.sendKeys(newFilePath); } }

Target:
protected void fillFileBox(RemoteWebElement fileBoxElement, String fileName) { if (fileName.isEmpty()) { fileBoxElement.clear(); } else { fileBoxElement.setFileDetector(new UselessFileDetector()); String filePath = new File(fileName).getAbsolutePath(); fileBoxElement.sendKeys(filePath); } }
Source:
public static VmInterfaceType getDefaultNicType(Collection<VmInterfaceType> items) { return items.contains(VmInterfaceType.pv) ? VmInterfaceType.pv : items.iterator().next(); }

Target:
public static VmInterfaceType getDefaultNicType(Collection<VmInterfaceType> items) { if (items == null || items.isEmpty()) { return null; } else if (items.contains(VmInterfaceType.pv)) { return VmInterfaceType.pv; } else { return items.iterator().next(); } }
Source:
private void testMergeCacheConfig(int firstIdx, int secondIdx) throws Exception { prepareTestGrid(); { IgniteEx ig = startGrid(firstIdx); startGrid(secondIdx); ig.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); performQueryingIntegrityCheck(ig); stopAllGrids(); } { IgniteEx ig = startGrids(2); ig.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); performQueryingIntegrityCheck(ig); } }

Target:
private void testMergeCacheConfig(int firstIdx, int secondIdx) throws Exception { prepareTestGrid(); IgniteEx ig = startGrid(firstIdx); startGrid(secondIdx); ig.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); performQueryingIntegrityCheck(ig); stopAllGrids(); ig = startGrids(2); ig.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); performQueryingIntegrityCheck(ig); }
Source:
public void startServers() throws Exception { System.out.println("In @Before method"); CLUSTER.getClusterControl().startAllServers(); CLUSTER.getClusterControl().waitForActive(); CLUSTER.getClusterControl().waitForRunningPassivesInStandby(); final CacheManagerBuilder<PersistentCacheManager> clusteredCacheManagerBuilder = CacheManagerBuilder.newCacheManagerBuilder() .with(ClusteringServiceConfigurationBuilder.cluster(CLUSTER.getConnectionURI().resolve("/cm-replication")) .timeouts(TimeoutsBuilder.timeouts() .read(Duration.ofMinutes(1)) .write(Duration.ofMinutes(1))) .autoCreate(server -> server.defaultServerResource("primary-server-resource"))); cacheManager = clusteredCacheManagerBuilder.build(true); CacheConfiguration<Long, String> config = CacheConfigurationBuilder.newCacheConfigurationBuilder(Long.class, String.class, ResourcePoolsBuilder.newResourcePoolsBuilder().heap(100, EntryUnit.ENTRIES) .with(ClusteredResourcePoolBuilder.clusteredDedicated("primary-server-resource", 1, MemoryUnit.MB))) .withService(ClusteredStoreConfigurationBuilder.withConsistency(cacheConsistency)) .build(); cacheOne = cacheManager.createCache(testName.getMethodName() + "-1", config); cacheTwo = cacheManager.createCache(testName.getMethodName() + "-2", config); }

Target:
public void startServers() throws Exception { CLUSTER.getClusterControl().startAllServers(); CLUSTER.getClusterControl().waitForActive(); CLUSTER.getClusterControl().waitForRunningPassivesInStandby(); final CacheManagerBuilder<PersistentCacheManager> clusteredCacheManagerBuilder = CacheManagerBuilder.newCacheManagerBuilder() .with(ClusteringServiceConfigurationBuilder.cluster(CLUSTER.getConnectionURI().resolve("/cm-replication")) .timeouts(TimeoutsBuilder.timeouts() .read(Duration.ofMinutes(1)) .write(Duration.ofMinutes(1))) .autoCreate(server -> server.defaultServerResource("primary-server-resource"))); cacheManager = clusteredCacheManagerBuilder.build(true); CacheConfiguration<Long, String> config = CacheConfigurationBuilder.newCacheConfigurationBuilder(Long.class, String.class, ResourcePoolsBuilder.newResourcePoolsBuilder().heap(100, EntryUnit.ENTRIES) .with(ClusteredResourcePoolBuilder.clusteredDedicated("primary-server-resource", 1, MemoryUnit.MB))) .withService(ClusteredStoreConfigurationBuilder.withConsistency(cacheConsistency)) .build(); cacheOne = cacheManager.createCache(testName.getMethodName() + "-1", config); cacheTwo = cacheManager.createCache(testName.getMethodName() + "-2", config); }
Source:
protected final void layoutChildren() { final double width = rectangle.getWidth(); final double height = rectangle.getHeight(); clip.setWidth(width); clip.setHeight(height); clip.setLayoutX(0); clip.setLayoutY(-height / 2); if (resizeWidth == -1) { rectangle.setWidth(text.getLayoutBounds().getWidth()); } else { rectangle.setWidth(resizeWidth); } text.setLayoutX(width / 2 - text.getLayoutBounds().getWidth() / 2); text.setLayoutY(height / 2); }

Target:
protected final void layoutChildren() { double width = rectangle.getWidth(); double height = rectangle.getHeight(); clip.setWidth(width); clip.setHeight(height); clip.setLayoutX(0); clip.setLayoutY(-height / 2); if (resizeWidth == -1) { rectangle.setWidth(text.getLayoutBounds().getWidth()); } else { rectangle.setWidth(resizeWidth); } text.setLayoutX(width / 2 - text.getLayoutBounds().getWidth() / 2); text.setLayoutY(height / 2); }
Source:
public Action onFragment( final DirectBuffer srcBuffer, final int srcOffset, final int srcLength, final Header header) { final int messageLength = srcLength - FRAME_LENGTH; final int messageOffset = srcOffset + FRAME_LENGTH; messageHeaderDecoder.wrap(srcBuffer, srcOffset); messageDecoder.wrap( srcBuffer, srcOffset + MessageHeaderDecoder.ENCODED_LENGTH, messageHeaderDecoder.blockLength(), messageHeaderDecoder.version()); asciiBuffer.wrap(srcBuffer, messageOffset, messageLength); headerDecoder.decode(asciiBuffer, 0, messageLength); final long messageType = messageDecoder.sbeSchemaVersion() > 2 ? messageDecoder.messageType() : messageDecoder.deprecatedMessageType(); if (messageType == HEARTBEAT_MESSAGE_TYPE) { if (heartbeatRangeSequenceNumberStart == OUT_OF_RANGE) { heartbeatRangeSequenceNumberStart = headerDecoder.msgSeqNum(); } return CONTINUE; } else { if (heartbeatRangeSequenceNumberStart != OUT_OF_RANGE) { if (!sendGapFill()) { return ABORT; } } return processNormalMessage(srcBuffer, srcOffset, srcLength, messageLength, messageOffset); } }

Target:
public Action onFragment( final DirectBuffer srcBuffer, final int srcOffset, final int srcLength, final Header header) { final int messageLength = srcLength - FRAME_LENGTH; final int messageOffset = srcOffset + FRAME_LENGTH; messageHeaderDecoder.wrap(srcBuffer, srcOffset); messageDecoder.wrap( srcBuffer, srcOffset + MessageHeaderDecoder.ENCODED_LENGTH, messageHeaderDecoder.blockLength(), messageHeaderDecoder.version()); asciiBuffer.wrap(srcBuffer, messageOffset, messageLength); headerDecoder.decode(asciiBuffer, 0, messageLength); final long messageType = MessageTypeExtractor.getMessageType(messageDecoder); if (messageType == HEARTBEAT_MESSAGE_TYPE) { if (heartbeatRangeSequenceNumberStart == OUT_OF_RANGE) { heartbeatRangeSequenceNumberStart = headerDecoder.msgSeqNum(); } return CONTINUE; } else { if (heartbeatRangeSequenceNumberStart != OUT_OF_RANGE) { if (!sendGapFill()) { return ABORT; } } return processNormalMessage(srcBuffer, srcOffset, srcLength, messageLength, messageOffset); } }
Source:
private void register() { if ( this.clientReg != null ) { return; } this.clientReg = context.registerService( EsClient.class, client, new Hashtable<>() ); this.isRegistered = true; }

Target:
private synchronized void register() { if ( this.clientReg != null ) { return; } this.clientReg = context.registerService( EsClient.class, client, null ); }
Source:
public Object deliverMessage(final Method method, final Object[] args) throws Throwable { boolean callBeforeAfter = false; switch (state) { case NONE: try { beforeDelivery(method); } catch (final ApplicationServerInternalException e) { throw (EJBException) new EJBException().initCause(e.getCause()); } callBeforeAfter = true; state = State.METHOD_CALLED; break; case BEFORE_CALLED: state = State.METHOD_CALLED; break; case RELEASED: throw new IllegalStateException("Message endpoint factory has been released"); case METHOD_CALLED: case SYSTEM_EXCEPTION: throw new IllegalStateException("The last message delivery must be completed with an afterDeliver before another message can be delivered"); } Throwable throwable = null; Object value = null; try { value = container.invoke(instance, method, null, wrapMessageForAmq5(args)); } catch (final SystemException se) { throwable = se.getRootCause() != null ? se.getRootCause() : se; state = State.SYSTEM_EXCEPTION; } catch (final ApplicationException ae) { throwable = ae.getRootCause() != null ? ae.getRootCause() : ae; } finally { if (callBeforeAfter) { try { afterDelivery(); } catch (final ApplicationServerInternalException e) { throwable = throwable == null ? e.getCause() : throwable; } catch (final UnavailableException e) { throwable = throwable == null ? e : throwable; } } } if (throwable != null) { throwable.printStackTrace(); if (isValidException(method, throwable)) { throw throwable; } else { throw new EJBException().initCause(throwable); } } return value; }

Target:
public Object deliverMessage(final Method method, final Object[] args) throws Throwable { boolean callBeforeAfter = false; switch (state) { case NONE: try { beforeDelivery(method); } catch (final ApplicationServerInternalException e) { throw (EJBException) new EJBException().initCause(e.getCause()); } callBeforeAfter = true; state = State.METHOD_CALLED; break; case BEFORE_CALLED: state = State.METHOD_CALLED; break; case RELEASED: throw new IllegalStateException("Message endpoint factory has been released"); case METHOD_CALLED: case SYSTEM_EXCEPTION: throw new IllegalStateException("The last message delivery must be completed with an afterDeliver before another message can be delivered"); } Throwable throwable = null; Object value = null; try { value = container.invoke(instance, method, null, wrapMessageForAmq5(args)); } catch (final SystemException se) { throwable = se.getRootCause() != null ? se.getRootCause() : se; state = State.SYSTEM_EXCEPTION; } catch (final ApplicationException ae) { throwable = ae.getRootCause() != null ? ae.getRootCause() : ae; } finally { if (callBeforeAfter) { try { afterDelivery(); } catch (final ApplicationServerInternalException e) { throwable = throwable == null ? e.getCause() : throwable; } catch (final UnavailableException e) { throwable = throwable == null ? e : throwable; } } } if (throwable != null) { if (isValidException(method, throwable)) { throw throwable; } else { throw new EJBException().initCause(throwable); } } return value; }
Source:
public void blockServiceOnDestination(PerunSession sess, Service service, int destinationId) throws InternalErrorException, PrivilegeException, DestinationNotExistsException, ServiceAlreadyBannedException, FacilityNotExistsException { Destination destination = getDestinationById(sess, destinationId); List<Facility> destinationFacilities = perunBl.getFacilitiesManager().getFacilitiesByDestination(sess, destination.getDestination()); boolean isFacilityAdminAtLeastOnce = false; for (Facility facility : destinationFacilities) { if (AuthzResolver.isAuthorized(sess, Role.FACILITYADMIN, facility)) { isFacilityAdminAtLeastOnce = true; } } if (!isFacilityAdminAtLeastOnce && !AuthzResolver.isAuthorized(sess, Role.PERUNADMIN)) { throw new PrivilegeException(sess, "blockServiceOnDestination"); } getServicesManagerBl().blockServiceOnDestination(sess, service, destinationId); }

Target:
public void blockServiceOnDestination(PerunSession sess, Service service, int destinationId) throws InternalErrorException, PrivilegeException, DestinationNotExistsException, ServiceAlreadyBannedException, FacilityNotExistsException { Destination destination = getServicesManagerBl().getDestinationById(sess, destinationId); List<Facility> destinationFacilities = perunBl.getFacilitiesManagerBl().getFacilitiesByDestination(sess, destination.getDestination()); boolean isFacilityAdminAtLeastOnce = false; for (Facility facility : destinationFacilities) { if (AuthzResolver.isAuthorized(sess, Role.FACILITYADMIN, facility)) { isFacilityAdminAtLeastOnce = true; } } if (!isFacilityAdminAtLeastOnce && !AuthzResolver.isAuthorized(sess, Role.PERUNADMIN)) { throw new PrivilegeException(sess, "blockServiceOnDestination"); } getServicesManagerBl().blockServiceOnDestination(sess, service, destinationId); }
Source:
static void set(TenantId tenantId) { checkNotDefaultArg(tenantId); threadLocal.set(tenantId); }

Target:
static void set(TenantId tenantId) { checkNotDefaultArg(tenantId, "A tenant ID must not be a default value."); threadLocal.set(tenantId); }
Source:
public void testConcurrentMoveToSameDest() throws Exception { final int N = 5; final Fqn X = Fqn.fromString("/x"), Y = Fqn.fromString("/y"); Node<Object, Object> rootNode = treeCache.getRoot(); Node<Object, Object> nodeA = rootNode.addChild(A); nodeA.addChild(X); Node<Object, Object> nodeB = rootNode.addChild(B); nodeB.addChild(Y); Node<Object, Object> nodeC = rootNode.addChild(C); Callable<Object>[] movers = new Callable[N]; for (int i = 0; i < N; i++) { final Fqn source = i % 2 == 0 ? Fqn.fromRelativeFqn(A, X) : Fqn.fromRelativeFqn(B, Y); movers[i] = new Callable<Object>() { public Object call() throws Exception { try { treeCache.move(source, C); } catch (Exception e) { } return null; } }; } runConcurrently(movers[0], movers[1], Arrays.copyOfRange(movers, 2, movers.length)); log.info("Tree: " + TreeStructureSupport.printTree(treeCache, true)); assertNoLocks(); assertTrue(nodeA.getChildrenNames().contains("x") ^ nodeC.getChildrenNames().contains("x")); assertTrue(nodeB.getChildrenNames().contains("y") ^ nodeC.getChildrenNames().contains("y")); }

Target:
public void testConcurrentMoveToSameDest() throws Exception { final int N = 5; final Fqn X = Fqn.fromString("/x"), Y = Fqn.fromString("/y"); Node<Object, Object> rootNode = treeCache.getRoot(); Node<Object, Object> nodeA = rootNode.addChild(A); nodeA.addChild(X); Node<Object, Object> nodeB = rootNode.addChild(B); nodeB.addChild(Y); Node<Object, Object> nodeC = rootNode.addChild(C); Callable<Object>[] movers = new Callable[N]; for (int i = 0; i < N; i++) { final Fqn source = i % 2 == 0 ? Fqn.fromRelativeFqn(A, X) : Fqn.fromRelativeFqn(B, Y); movers[i] = new Callable<Object>() { public Object call() throws Exception { try { treeCache.move(source, C); } catch (Exception e) { } return null; } }; } runConcurrently(movers); log.info("Tree: " + TreeStructureSupport.printTree(treeCache, true)); assertNoLocks(); assertTrue(nodeA.getChildrenNames().contains("x") ^ nodeC.getChildrenNames().contains("x")); assertTrue(nodeB.getChildrenNames().contains("y") ^ nodeC.getChildrenNames().contains("y")); }
Source:
public String toString() { StringBuilder sb = new StringBuilder(); sb.append("COMPLETE_TRANSACTION (FROM COORD: "); sb.append(CoreUtils.hsIdToString(m_coordinatorHSId)); sb.append(") FOR TXN "); sb.append(TxnEgo.txnIdToString(m_txnId) + "(" + m_txnId + ")"); sb.append("\n SP HANDLE: "); sb.append(TxnEgo.txnIdToString(getSpHandle())); sb.append("\n FLAGS: ").append(m_flags); if (isNPartTxn()) sb.append("\n ").append(" N Partition TXN"); sb.append("\n TIMESTAMP: "); MpRestartSequenceGenerator.restartSeqIdToString(m_timestamp, sb); sb.append("\n TRUNCATION HANDLE:" + TxnEgo.txnIdToString(getTruncationHandle())); sb.append("\n HASH: " + String.valueOf(m_hash)); if (isRollback()) sb.append("\n THIS IS AN ROLLBACK REQUEST"); if (requiresAck()) sb.append("\n THIS MESSAGE REQUIRES AN ACK"); if (isRestart()) { sb.append("\n THIS IS A TRANSACTION RESTART"); } if (!isForReplica()) { sb.append("\n SEND TO LEADER"); } if(!isRestartable()) { sb.append("\n THIS IS NOT RESTARTaable"); } return sb.toString(); }

Target:
public String toString() { StringBuilder sb = new StringBuilder(); sb.append("COMPLETE_TRANSACTION (FROM COORD: "); sb.append(CoreUtils.hsIdToString(m_coordinatorHSId)); sb.append(") FOR TXN "); sb.append(TxnEgo.txnIdToString(m_txnId) + "(" + m_txnId + ")"); sb.append("\n SP HANDLE: "); sb.append(TxnEgo.txnIdToString(getSpHandle())); sb.append("\n FLAGS: ").append(m_flags); if (isNPartTxn()) sb.append("\n ").append(" N Partition TXN"); sb.append("\n TIMESTAMP: "); MpRestartSequenceGenerator.restartSeqIdToString(m_timestamp, sb); sb.append("\n TRUNCATION HANDLE:" + TxnEgo.txnIdToString(getTruncationHandle())); sb.append("\n HASH: " + String.valueOf(m_hash)); if (isRollback()) sb.append("\n THIS IS AN ROLLBACK REQUEST"); if (requiresAck()) sb.append("\n THIS MESSAGE REQUIRES AN ACK"); if (isRestart()) { sb.append("\n THIS IS A TRANSACTION RESTART"); } if (!isForReplica()) { sb.append("\n SEND TO LEADER"); } if(!isRestartable()) { sb.append("\n THIS IS NOT RESTARTABLE"); } return sb.toString(); }
Source:
public static Scheduler initMainThreadScheduler(Callable<Scheduler> scheduler) { ObjectHelper.requireNonNull(scheduler, "Scheduler Callable can't be null"); Function<Callable<Scheduler>, Scheduler> f = onInitMainThreadHandler; if (f == null) { return callRequireNonNull(scheduler); } return applyRequireNonNull(f, scheduler); }

Target:
public static Scheduler initMainThreadScheduler(Callable<Scheduler> scheduler) { if (scheduler == null) { throw new NullPointerException("scheduler == null"); } Function<Callable<Scheduler>, Scheduler> f = onInitMainThreadHandler; if (f == null) { return callRequireNonNull(scheduler); } return applyRequireNonNull(f, scheduler); }
Source:
public void configure() throws ConfigurationException { try { KeyringConfigCallback callback = KeyringConfigCallbacks.withUnprotectedKeys(); if(secretPassword != null) callback = KeyringConfigCallbacks.withPassword(secretPassword); keyringConfig = KeyringConfigs.forGpgExportedKeys(callback); if(publicKey != null) for(String s : publicKey) keyringConfig.addPublicKey(IOUtils.toByteArray(new FileInputStream(s))); if(secretKey != null ) keyringConfig.addSecretKey(IOUtils.toByteArray(new FileInputStream(secretKey))); } catch (IOException | PGPException e) { throw new ConfigurationException("Unknown exception has occurred.", e); } }

Target:
public void configure() throws ConfigurationException { try { KeyringConfigCallback callback = KeyringConfigCallbacks.withUnprotectedKeys(); if (secretPassword != null) callback = KeyringConfigCallbacks.withPassword(secretPassword); keyringConfig = KeyringConfigs.forGpgExportedKeys(callback); if (publicKeys != null) { for (String s : publicKeys) { URL url = ClassUtils.getResourceURL(Thread.currentThread().getContextClassLoader(), s); keyringConfig.addPublicKey(IOUtils.toByteArray(url.openStream())); } } if (secretKey != null) { URL url = ClassUtils.getResourceURL(Thread.currentThread().getContextClassLoader(), secretKey); keyringConfig.addSecretKey(IOUtils.toByteArray(url.openStream())); } } catch (IOException | PGPException e) { throw new ConfigurationException("Unknown exception has occurred.", e); } }
Source:
public Reason getReason(int start) { String reason = StringUtils.join(args, " ", start, args.length); List<String> notes = new ArrayList<>(); String[] matches = null; if (plugin.getConfig().isCreateNoteReasons()) { matches = StringUtils.substringsBetween(reason, "(", ")"); } if (matches != null) notes = Arrays.asList(matches); for (int i = start; i < args.length; i++) { if (!args[i].startsWith("#")) continue; String key = args[i].replace("#", ""); String replace = plugin.getReasonsConfig().getReason(key); if (replace != null) reason = reason.replace("#" + key, replace); else if(plugin.getConfig().isBlockInvalidReasons()) invalidReason = true; } for (String note : notes) { reason = reason.replace("(" + note + ")", ""); } reason = reason.trim(); return new Reason(reason, notes); }

Target:
public Reason getReason(int start) { String reason = StringUtils.join(args, " ", start, args.length); List<String> notes = new ArrayList<>(); String[] matches = null; if (plugin.getConfig().isCreateNoteReasons()) { matches = StringUtils.substringsBetween(reason, "(", ")"); } if (matches != null) notes = Arrays.asList(matches); for (int i = start; i < args.length; i++) { if (!args[i].startsWith("#")) continue; String key = args[i].replace("#", ""); String replace = plugin.getReasonsConfig().getReason(key); if (replace != null) reason = reason.replace("#" + key, replace); if (replace != null) { reason = reason.replace("#" + key, replace); } else if(plugin.getConfig().isBlockInvalidReasons()) { invalidReason = true; } } for (String note : notes) { reason = reason.replace("(" + note + ")", ""); } reason = reason.trim(); return new Reason(reason, notes); }
Source:
public void shouldSuccessfully_authorise3ds() throws Exception { app.getDatabaseTestHelper().enable3dsForGatewayAccount(Long.parseLong(accountId)); String chargeId = createNewChargeWith(AUTHORISATION_3DS_REQUIRED, RandomIdGenerator.newId()); Map<String, String> payload = ImmutableMap.of("auth_3d_result", "AUTHORISED"); givenSetup() .body(new ObjectMapper().writeValueAsString(payload)) .post(authorise3dsChargeUrlFor(chargeId)) .then() .statusCode(200); assertFrontendChargeStatusIs(chargeId, AUTHORISATION_SUCCESS.getValue()); }

Target:
public void shouldSuccessfully_authorise3ds() throws Exception { app.getDatabaseTestHelper().enable3dsForGatewayAccount(Long.parseLong(accountId)); String chargeId = createNewChargeWith(AUTHORISATION_3DS_REQUIRED, RandomIdGenerator.newId()); Map<String, String> payload = ImmutableMap.of("auth_3ds_result", AUTHORISED.name()); givenSetup() .body(new ObjectMapper().writeValueAsString(payload)) .post(authorise3dsChargeUrlFor(chargeId)) .then() .statusCode(200); assertFrontendChargeStatusIs(chargeId, AUTHORISATION_SUCCESS.getValue()); }
Source:
private void init() { initializationTime = System.currentTimeMillis(); String entityId = this.statsdPort == 0 ? "none" : null; NonBlockingStatsDClientBuilder builder = new NonBlockingStatsDClientBuilder() .enableTelemetry(false) .hostname(this.statsdHost) .port(this.statsdPort) .queueSize(Integer.MAX_VALUE) .errorHandler(new LoggingErrorHandler()) .entityID(entityId); if (this.statsdPort == 0) { builder.maxPacketSizeBytes(8192); } statsDClient = builder.build(); }

Target:
private void init() { initializationTime = System.currentTimeMillis(); String entityId = this.statsdPort == 0 ? "none" : null; NonBlockingStatsDClientBuilder builder = new NonBlockingStatsDClientBuilder() .enableTelemetry(false) .hostname(this.statsdHost) .port(this.statsdPort) .errorHandler(new LoggingErrorHandler()) .entityID(entityId); if (this.statsdPort == 0) { builder.maxPacketSizeBytes(8192); } statsDClient = builder.build(); }
Source:
protected Pair<Map<String, String>, Map<String, String>> convertAndSeparateParameters(WikiParameters params) { Map<String, String> resourceParameters; Map<String, String> genericParameters; if (params.getSize() > 0) { resourceParameters = new LinkedHashMap<String, String>(); genericParameters = new LinkedHashMap<String, String>(); for (WikiParameter wikiParameter : params.toList()) { String key = wikiParameter.getKey(); if ((DocumentResourceReference.ANCHOR).equals(key) || (DocumentResourceReference.QUERY_STRING).equals(key)) { resourceParameters.put(key, wikiParameter.getValue()); } else { genericParameters.put(key, wikiParameter.getValue()); } } } else { resourceParameters = Listener.EMPTY_PARAMETERS; genericParameters = Listener.EMPTY_PARAMETERS; } return new ImmutablePair<Map<String, String>, Map<String, String>>(resourceParameters, genericParameters); }

Target:
protected Pair<Map<String, String>, Map<String, String>> convertAndSeparateParameters(WikiParameters params) { Map<String, String> resourceParameters; Map<String, String> genericParameters; if (params.getSize() > 0) { resourceParameters = new LinkedHashMap<String, String>(); genericParameters = new LinkedHashMap<String, String>(); for (WikiParameter wikiParameter : params.toList()) { String key = wikiParameter.getKey(); if (DocumentResourceReference.ANCHOR.equals(key) || DocumentResourceReference.QUERY_STRING).equals(key)) { resourceParameters.put(key, wikiParameter.getValue()); } else { genericParameters.put(key, wikiParameter.getValue()); } } } else { resourceParameters = Listener.EMPTY_PARAMETERS; genericParameters = Listener.EMPTY_PARAMETERS; } return new ImmutablePair<Map<String, String>, Map<String, String>>(resourceParameters, genericParameters); }