auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public ModelExplorerView(IMultiDiagramEditor part) { if (part == null) { throw new IllegalArgumentException(Messages.ModelExplorerView_ExceptionAPartSouldBeProvided); } init(part); IReloadableEditor.Adapter.getAdapter(part).addEditorReloadListener(new EditorReloadAdapter() { @Override public void editorAboutToReload(EditorReloadEvent event) { event.putContext(new ModelExplorerTreeViewerContext(getCommonViewer())); deactivate(); } @Override public void editorReloaded(EditorReloadEvent event) { init(event.getEditor()); activate(); initCommonViewer(getCommonViewer()); ((TreeViewerContext<?>) event.getContext()).restore(getCommonViewer()); } }); }

Target:
public ModelExplorerView(IMultiDiagramEditor part) { if (part == null) { throw new IllegalArgumentException("A part should be provided."); } init(part); IReloadableEditor.Adapter.getAdapter(part).addEditorReloadListener(new EditorReloadAdapter() { @Override public void editorAboutToReload(EditorReloadEvent event) { event.putContext(new ModelExplorerTreeViewerContext(getCommonViewer())); deactivate(); } @Override public void editorReloaded(EditorReloadEvent event) { init(event.getEditor()); activate(); initCommonViewer(getCommonViewer()); ((TreeViewerContext<?>) event.getContext()).restore(getCommonViewer()); } }); }
Source:
String brewJava() { StringBuilder builder = new StringBuilder(); builder.append(" builder.append("package ").append(classPackage).append(";\n\n"); builder.append("import android.view.View;\n"); builder.append("import butterknife.ButterKnife.Finder;\n\n"); builder.append("public class ").append(className); if (parentInjector != null) { builder.append(" extends ").append(parentInjector); } else { builder.append(" implements butterknife.Injector<") .append(targetClass) .append(">"); } builder.append(" {\n"); emitInject(builder); builder.append('\n'); emitReset(builder); builder.append("}\n"); return builder.toString(); }

Target:
String brewJava() { StringBuilder builder = new StringBuilder(); builder.append(" builder.append("package ").append(classPackage).append(";\n\n"); builder.append("import android.view.View;\n"); builder.append("import butterknife.ButterKnife.Finder;\n\n"); builder.append("public class ").append(className); builder.append("<T extends ").append(targetClass).append(">"); if (parentInjector != null) { builder.append(" extends ").append(parentInjector).append("<T>"); } else { builder.append(" implements butterknife.ButterKnife.Injector<T>"); } builder.append(" {\n"); emitInject(builder); builder.append('\n'); emitReset(builder); builder.append("}\n"); return builder.toString(); }
Source:
private void refreshVolumeCapacity(GlusterVolumeEntity volume, GlusterVolumeAdvancedDetails volumeAdvancedDetails) { Long confirmedFreeSize = calculateConfirmedVolumeCapacity(volume); if (volume.getAdvancedDetails().getCapacityInfo() == null) { volumeDao.addVolumeCapacityInfo(volumeAdvancedDetails.getCapacityInfo()); } else { volumeAdvancedDetails.getCapacityInfo().setConfirmedFreeSize(confirmedFreeSize); volumeDao.updateVolumeCapacityInfo(volumeAdvancedDetails.getCapacityInfo()); } if (confirmedFreeSize != null) { storageDomainStaticDao.getAllForStoragePool(clusterDao.get(volume.getClusterId()).getStoragePoolId()) .stream() .map(StorageDomainStatic::getId) .filter(sd -> storageServerConnectionDao.getAllForDomain(sd) .stream() .anyMatch(c -> volume.getId().equals(c.getGlusterVolumeId()))) .map(i -> storageDomainDynamicDao.get(i)) .forEach(d -> { d.setConfirmedAvailableDiskSize((int) (confirmedFreeSize / (1024 * 1024 * 1024))); storageDomainDynamicDao.updateConfirmedSize(d); }); } }

Target:
private void refreshVolumeCapacity(GlusterVolumeEntity volume, GlusterVolumeAdvancedDetails volumeAdvancedDetails) { Long confirmedFreeSize = calculateConfirmedVolumeCapacity(volume); if (volume.getAdvancedDetails().getCapacityInfo() == null) { volumeDao.addVolumeCapacityInfo(volumeAdvancedDetails.getCapacityInfo()); } else { volumeAdvancedDetails.getCapacityInfo().setConfirmedFreeSize(confirmedFreeSize); volumeDao.updateVolumeCapacityInfo(volumeAdvancedDetails.getCapacityInfo()); } if (confirmedFreeSize != null) { storageDomainStaticDao.getAllForStoragePool(clusterDao.get(volume.getClusterId()).getStoragePoolId()) .stream() .map(StorageDomainStatic::getId) .filter(sd -> storageServerConnectionDao.getAllForDomain(sd) .stream() .anyMatch(c -> volume.getId().equals(c.getGlusterVolumeId()))) .map(i -> storageDomainDynamicDao.get(i)) .forEach(d -> { d.setConfirmedAvailableDiskSize((int) (confirmedFreeSize / SizeConverter.BYTES_IN_GB)); storageDomainDynamicDao.updateConfirmedSize(d); }); } }
Source:
public void deleteNetworkToPublicRouter(ClaudiaData claudiaData, NetworkInstance netInstance, String region) throws InfrastructureException { log.info("Delete Interfact from net " + netInstance.getNetworkName() + " to public router in region " + region); List<Port> ports = listPortsFromNetwork(claudiaData, region, netInstance.getInterfaceNetId()); if (ports.size() > 0) { String msm = "Error to delete the interface from public router " + netInstance.getNetworkName() + " to the public router : They are still used ports"; log.warn(msm); return; } try { openStackUtil.deleteInterfaceToPublicRouter(claudiaData.getUser(), netInstance, region); } catch (OpenStackException e) { String msm = "Error to delete the network " + netInstance.getNetworkName() + " to the public router :" + e.getMessage(); log.error(msm); throw new InfrastructureException(msm, e); } }

Target:
public void deleteNetworkToPublicRouter(ClaudiaData claudiaData, NetworkInstance netInstance, String region) throws InfrastructureException { log.info("Delete Interfact from net " + netInstance.getNetworkName() + " to public router in region " + region); List<Port> ports = listPortsFromNetwork(claudiaData, region, netInstance.getInterfaceNetId()); if (ports.size() > 0) { String mns = "Error to delete the interface from public router " + netInstance.getNetworkName() + " to the public router : They are still used ports"; log.warn(mns); return; } try { openStackUtil.deleteInterfaceToPublicRouter(claudiaData.getUser(), netInstance, region); } catch (OpenStackException e) { String msm = "Error to delete the network " + netInstance.getNetworkName() + " to the public router :" + e.getMessage(); log.error(msm); throw new InfrastructureException(msm, e); } }
Source:
protected void processWatchEvent(WatchEvent<?> event, Kind<?> kind, Path path) { if (kind == ENTRY_CREATE || kind == ENTRY_MODIFY) { try { File f = path.toFile(); if (!f.isHidden()) { processConfigFile(f); } } catch (IOException e) { logger.warn("Could not process config file '{}': {}", path, e); } } else if (kind == ENTRY_DELETE) { File configFile = path.toFile(); if (configFile.isHidden() || configFile.isDirectory() || !configFile.getName().endsWith(".cfg")) { return; } exclusivcePIDMap.setFileRemoved(configFile.getAbsolutePath()); processOrphanExclusivePIDs(); storeCurrentExclusivePIDList(); } }

Target:
protected void processWatchEvent(WatchEvent<?> event, Kind<?> kind, Path path) { if (kind == ENTRY_CREATE || kind == ENTRY_MODIFY) { try { File f = path.toFile(); if (!f.isHidden()) { processConfigFile(f); } } catch (IOException e) { logger.warn("Could not process config file '{}': {}", path, e); } } else if (kind == ENTRY_DELETE) { File configFile = path.toFile(); if (configFile.isHidden() || configFile.isDirectory() || !configFile.getName().endsWith(".cfg")) { return; } exclusivePIDMap.setFileRemoved(configFile.getAbsolutePath()); processOrphanExclusivePIDs(); } storeCurrentExclusivePIDList(); }
Source:
public EngineBackupLog getLastSuccessfulEngineBackup(String dbName) { List<EngineBackupLog> logs = multipleResults(entityManager.createNamedQuery("EngineBackupLog.getLatest", EngineBackupLog.class).setParameter("dbName", dbName)); if (logs != null && logs.size() > 0) { return logs.get(0); } else { return null; } }

Target:
public EngineBackupLog getLastSuccessfulEngineBackup(String dbName) { List<EngineBackupLog> logs = multipleResults(entityManager.createNamedQuery("EngineBackupLog.getLatest", EngineBackupLog.class).setParameter("dbName", dbName)); if (logs.isEmpty()) { return null; } else { return logs.get(0); } }
Source:
private void fetchLiveInstanceData(boolean force) throws AmazonClientException { return fetchLiveInstanceData(force, 25); }

Target:
private void fetchLiveInstanceData(boolean force) throws AmazonClientException { fetchLiveInstanceData(force, 25); }
Source:
public void testByteValues() throws Exception { List<Byte> byteValues = ImmutableList.of(1, 3, 5, 7, 11, 13, 17) .stream() .map(Integer::byteValue) .collect(toList()); List<Map<Integer, TupleDomainFilter>> filters = ImmutableList.of( ImmutableMap.of(0, BigintRange.of(1, 17, false)), ImmutableMap.of(0, IS_NULL)); tester.testRoundTrip(TINYINT, byteValues, ImmutableList.of(ImmutableMap.of(0, BigintValues.of(new long[] {1, 17}, false)))); tester.testRoundTripTypes(ImmutableList.of(TINYINT, TINYINT), ImmutableList.of(byteValues, reverse(byteValues)), filters); }

Target:
public void testByteValues() throws Exception { List<Byte> byteValues = ImmutableList.of(1, 3, 5, 7, 11, 13, 17) .stream() .map(Integer::byteValue) .collect(toList()); tester.testRoundTrip(TINYINT, byteValues, ImmutableList.of( ImmutableMap.of(0, BigintValues.of(new long[] {1, 17}, false)), ImmutableMap.of(0, IS_NULL))); List<Map<Integer, TupleDomainFilter>> filters = ImmutableList.of( ImmutableMap.of(0, BigintRange.of(1, 17, false)), ImmutableMap.of(0, IS_NULL), ImmutableMap.of(1, IS_NULL), ImmutableMap.of( 0, BigintRange.of(11, 15, false), 1, BigintRange.of(11, Long.MAX_VALUE, false))); tester.testRoundTripTypes(ImmutableList.of(TINYINT, TINYINT), ImmutableList.of(byteValues, reverse(byteValues)), filters); }
Source:
public void tearDown() { ledgerEntriesImpl.close(); try { ledgerEntriesImpl.getEntry(entryId); fail("should fail getEntry after close"); } catch (NullPointerException e) { } try { ledgerEntriesImpl.iterator(); fail("should fail iterator after close"); } catch (NullPointerException e) { } try { ledgerEntriesImpl.retainIterator(); fail("should fail retainIterator after close"); } catch (NullPointerException e) { } }

Target:
public void tearDown() { ledgerEntriesImpl.close(); bufs.forEach(byteBuf -> assertEquals(0, byteBuf.refCnt())); try { ledgerEntriesImpl.getEntry(entryId); fail("should fail getEntry after close"); } catch (NullPointerException e) { } try { ledgerEntriesImpl.iterator(); fail("should fail iterator after close"); } catch (NullPointerException e) { } }
Source:
public Object visit(PropertyIsLike filter, Object data) { Map.Entry<String, String> pair = filterAsKeyValuePair(filter.getExpression(), filter.getLiteral()); if (pair != null) { LOGGER.trace("Found key-value predicate {}, looking for metacard tags", pair); saveTag(pair.getKey(), pair.getValue()); return super.visit(filter, data); } LOGGER.trace( "Filter could not be converted to key-value pair so could not be referring to metacard tags", filter); reportNonTagEncountered(); return super.visit(filter, data); }

Target:
public Object visit(PropertyIsLike filter, Object data) { final Map.Entry<String, String> pair = filterAsKeyValuePair(filter.getExpression(), filter.getLiteral()); if (pair != null) { LOGGER.trace("Found key-value predicate {}, looking for metacard tags", pair); saveTag(pair.getKey(), pair.getValue()); } else { LOGGER.trace( "Filter could not be converted to key-value pair thus is not referring to metacard tags", filter); reportNonTagEncountered(); } return super.visit(filter, data); }
Source:
public void dropSegment(final DataSegment segment) throws SegmentLoadingException { final String dataSource = segment.getDataSource(); dataSources.compute( dataSource, (k, v) -> { final DataSourceState dataSourceState = v == null ? new DataSourceState() : v; final VersionedIntervalTimeline<String, ReferenceCountingSegment> loadedIntervals = dataSourceState.getTimeline(); if (loadedIntervals == null) { log.info("Told to delete a queryable for a dataSource[%s] that doesn't exist.", dataSource); return null; } final PartitionChunk<ReferenceCountingSegment> removed = loadedIntervals.remove( segment.getInterval(), segment.getVersion(), segment.getShardSpec().createChunk(null) ); final ReferenceCountingSegment oldQueryable = (removed == null) ? null : removed.getObject(); if (oldQueryable != null) { dataSourceState.removeSegment(segment); try { log.info("Attempting to close segment %s", segment.getIdentifier()); oldQueryable.close(); } catch (IOException e) { log.makeAlert(e, "Exception closing segment") .addData("dataSource", dataSource) .addData("segmentId", segment.getIdentifier()) .emit(); } } else { log.info( "Told to delete a queryable on dataSource[%s] for interval[%s] and version [%s] that I don't have.", dataSource, segment.getInterval(), segment.getVersion() ); } return dataSourceState; } ); segmentLoader.cleanup(segment); }

Target:
public void dropSegment(final DataSegment segment) throws SegmentLoadingException { final String dataSource = segment.getDataSource(); dataSources.compute( dataSource, (dataSourceName, dataSourceState) -> { if (dataSourceState == null) { log.info("Told to delete a queryable for a dataSource[%s] that doesn't exist.", dataSourceName); } else { final VersionedIntervalTimeline<String, ReferenceCountingSegment> loadedIntervals = dataSourceState.getTimeline(); final PartitionChunk<ReferenceCountingSegment> removed = loadedIntervals.remove( segment.getInterval(), segment.getVersion(), segment.getShardSpec().createChunk(null) ); final ReferenceCountingSegment oldQueryable = (removed == null) ? null : removed.getObject(); if (oldQueryable != null) { dataSourceState.removeSegment(segment); try { log.info("Attempting to close segment %s", segment.getIdentifier()); oldQueryable.close(); } catch (IOException e) { log.makeAlert(e, "Exception closing segment") .addData("dataSource", dataSourceName) .addData("segmentId", segment.getIdentifier()) .emit(); } } else { log.info( "Told to delete a queryable on dataSource[%s] for interval[%s] and version [%s] that I don't have.", dataSourceName, segment.getInterval(), segment.getVersion() ); } } return dataSourceState == null || dataSourceState.isEmpty() ? null : dataSourceState; } ); segmentLoader.cleanup(segment); }
Source:
void store() { NbPreferences.forModule(LaTeXSettingsPanel.class).put("latexPath", jTextField1.getText()); int autoCompleteDelay = DEFAULT_AUTOCOMPLETE_DELAY_MS; try{ autoCompleteDelay = Integer.parseInt(jFormattedTextField1.getText()); }catch(NumberFormatException ex){ autoCompleteDelay = DEFAULT_AUTOCOMPLETE_DELAY_MS; } NbPreferences.forModule(LaTeXSettingsPanel.class).putInt(LaTeXSettingsPanel.KEY_AUTOCOMPLETE_DELAY, autoCompleteDelay); }

Target:
void store() { ApplicationSettings.INSTANCE.setLatexPath( jTextField1.getText() ); int autoCompleteDelay = Integer.parseInt(jFormattedTextField1.getText()); ApplicationSettings.INSTANCE.setAutoCompleteDelay(autoCompleteDelay); ApplicationSettings.INSTANCE.save(); }
Source:
public GetBlobOperation(String datacenterName, ConnectionPool connectionPool, ExecutorService requesterPool, OperationContext oc, BlobId blobId, long operationTimeoutMs, ClusterMap clusterMap) throws CoordinatorException { super(datacenterName, connectionPool, requesterPool, oc, blobId, operationTimeoutMs, clusterMap, MessageFormatFlags.Blob); logger.trace( "GetBlob: Datacenter name " + datacenterName + " Connection pool " + connectionPool + ", requester pool " + ( requesterPool != null) + ", Operation context " + oc + ", blobId " + blobId + ", timeout " + operationTimeoutMs + ", clustermap " + (clusterMap != null)); this.blobOutput = null; }

Target:
public GetBlobOperation(String datacenterName, ConnectionPool connectionPool, ExecutorService requesterPool, OperationContext oc, BlobId blobId, long operationTimeoutMs, ClusterMap clusterMap) throws CoordinatorException { super(datacenterName, connectionPool, requesterPool, oc, blobId, operationTimeoutMs, clusterMap, MessageFormatFlags.Blob); logger.trace("GetBlob: Datacenter name " + datacenterName + " Connection pool " + (connectionPool != null) + ", requester pool " + (requesterPool != null) + ", Operation context " + oc + ", blobId " + blobId + ", timeout " + operationTimeoutMs + ", clustermap " + (clusterMap != null)); this.blobOutput = null; }
Source:
public List<ItemStack> getDisplayRecipes() { List<ItemStack> display = new ArrayList<>(); for (String matName : materialSpeeds.keySet()) { Material mat = Material.getMaterial(matName); if (mat == null) continue; display.add(new CustomItem(mat, "&bCan Climb This Block")); } return display; }

Target:
public List<ItemStack> getDisplayRecipes() { List<ItemStack> display = new ArrayList<>(); for (Material mat : materialSpeeds.keySet()) { display.add(new ItemStack(mat)); } return display; }
Source:
private LoadingStub makeStub(Object parentElement) { LoadingStub stub = stubs.get(parentElement); if (stub == null) { stub= new LoadingStub(); stubs.put(parentElement, stub); } return stub; }

Target:
private LoadingStub makeStub(Object parentElement) { synchronized (stubs) { LoadingStub stub = stubs.get(parentElement); if (stub == null) { stub = new LoadingStub(); stubs.put(parentElement, stub); } return stub; } }
Source:
public void Vectors_add() { Vector2D a = new Vector2D( 1, 2 ); Vector2D b = new Vector2D( 3, 4 ); assertThat( a.add( b ), equalToVector2D( new Vector2D( 4, 6 ) ) ); }

Target:
public void Vectors_add() { Vector2D a = new Vector2D( 1, 2 ); Vector2D b = new Vector2D( 3, 4 ); assertThat( a.add( b ), equalTo( new Vector2D( 4, 6 ) ) ); }
Source:
public void close() { for ( StoreType type : StoreType.values() ) { if ( type.isRecordStore() && !type.isLimitedIdStore() ) { ((Resource)idGenerator( type )).close(); } } }

Target:
public void close() { for ( StoreType type : StoreType.values() ) { IdSequence generator = idGenerator( type ); if ( generator instanceof RenewableBatchIdSequence ) { ((RenewableBatchIdSequence)generator).close(); } } }
Source:
public AttachmentStreamFactory(KeyProvider keyProvider) { EncryptionKey key = keyProvider.getEncryptionKey(); if (key != null) { this.key = key.getKey(); } else { this.key = null; } }

Target:
public AttachmentStreamFactory(KeyProvider keyProvider) { if (keyProvider.getEncryptionKey() != null) { this.key = keyProvider.getEncryptionKey().getKey(); } else { this.key = null; } }
Source:
private static ArrayList<UnspentOutput> getSortedCoins( ArrayList<UnspentOutput> unspentOutputs) { ArrayList<UnspentOutput> sortedCoins = new ArrayList<>(); Collections.sort(unspentOutputs, new UnspentOutputAmountComparatorAsc()); for(UnspentOutput coin : unspentOutputs) { if (!coin.isReplayable()) { sortedCoins.add(coin); break; } } Collections.sort(unspentOutputs, new UnspentOutputAmountComparatorDesc()); for(UnspentOutput coin : unspentOutputs) { if (!sortedCoins.contains(coin) && coin.isReplayable()) { sortedCoins.add(coin); break; } } for(UnspentOutput coin : unspentOutputs) { if (!sortedCoins.contains(coin) && !coin.isReplayable()) { sortedCoins.add(coin); break; } } return sortedCoins; }

Target:
private static ArrayList<UnspentOutput> getSortedCoins( ArrayList<UnspentOutput> unspentOutputs) { ArrayList<UnspentOutput> sortedCoins = new ArrayList<>(); Collections.sort(unspentOutputs, new UnspentOutputAmountComparatorAsc()); for(UnspentOutput coin : unspentOutputs) { if (!coin.isReplayable()) { sortedCoins.add(coin); break; } } Collections.reverse(unspentOutputs); for(UnspentOutput coin : unspentOutputs) { if (!sortedCoins.contains(coin) && coin.isReplayable()) { sortedCoins.add(coin); break; } } for(UnspentOutput coin : unspentOutputs) { if (!sortedCoins.contains(coin) && !coin.isReplayable()) { sortedCoins.add(coin); break; } } return sortedCoins; }
Source:
public int compare(Viewer viewer, Object e1, Object e2) { int rc = 0; if (direction == DESCENDING) { rc = super.compare(viewer, labelProvider.getText(e1), labelProvider.getText(e2)); } else { rc = super.compare(viewer, labelProvider.getText(e2), labelProvider.getText(e1)); } return rc; }

Target:
public int compare(Viewer viewer, Object e1, Object e2) { int rc = 0; String firstCell = labelProvider.getText(e1).toLowerCase(); String secondCell = labelProvider.getText(e2).toLowerCase(); if (direction == DESCENDING) { rc = secondCell.compareTo(firstCell); } else { rc = firstCell.compareTo(secondCell); } return rc; }
Source:
public void close() throws IOException { try { if (mClient.get().isShutdown()) { return; } mStream.close(); try { mStream.waitForComplete(5 * Constants.SECOND_MS); } catch (Throwable e) { } } finally { mMarshaller.close(); mClient.close(); } }

Target:
public void close() throws IOException { try { if (mClient.get().isShutdown()) { return; } mStream.close(); try { if (mCloseWaitMs > 0) { mStream.waitForComplete(mCloseWaitMs); } } catch (Throwable e) { } } finally { mMarshaller.close(); mClient.close(); } }
Source:
public void populateSettingsMap(Plugin plugin, PluginInfo pluginInfo) { final ConfigurationPropertyBuilder builder = new ConfigurationPropertyBuilder(); for (String settingsKey : plugin.getAllConfigurationKeys()) { final PluginConfiguration configuration = pluginInfo.getPluginSettings().getConfiguration(settingsKey); if (configuration != null) { settingsMap.add(builder.create(settingsKey, plugin.getConfigurationValue(settingsKey), null, configuration.isSecure())); } } }

Target:
public void populateSettingsMap(Plugin plugin, PluginInfo pluginInfo) { final ConfigurationPropertyBuilder builder = new ConfigurationPropertyBuilder(); for (String settingsKey : plugin.getAllConfigurationKeys()) { final PluginConfiguration configuration = pluginInfo.getPluginSettings().getConfiguration(settingsKey); if (configuration != null) { settingsMap.add(builder.create(settingsKey, plugin.getConfigurationValue(settingsKey), null, configuration.isSecure())); } else { settingsMap.add(builder.create(settingsKey, plugin.getConfigurationValue(settingsKey), null, false)); } } }
Source:
public String open(int id, String referringView) { try { this.referringView = referringView; Helper.getRequestParameter("referringView"); this.process = ServiceManager.getProcessService().getById(id); this.currentChildren.addAll(process.getChildren()); this.user = ServiceManager.getUserService().getCurrentUser(); ruleset = openRuleset(process.getRuleset()); openMetsFile(); init(); openProcesses.put(Integer.valueOf(id), user); } catch (IOException | DAOException e) { Helper.setErrorMessage(e.getLocalizedMessage(), logger, e); return referringView; } return PAGE_METADATA_EDITOR; }

Target:
public String open(int id, String referringView) { try { this.referringView = referringView; Helper.getRequestParameter("referringView"); this.process = ServiceManager.getProcessService().getById(id); this.currentChildren.addAll(process.getChildren()); this.user = ServiceManager.getUserService().getCurrentUser(); ruleset = openRuleset(process.getRuleset()); openMetsFile(); init(); openProcesses.put(id, user); } catch (IOException | DAOException e) { Helper.setErrorMessage(e.getLocalizedMessage(), logger, e); return referringView; } return PAGE_METADATA_EDITOR; }
Source:
public StartpointManager(MetadataStore metadataStore) { Preconditions.checkNotNull(metadataStore, "MetadataStore cannot be null"); this.metadataStore = metadataStore; this.readWriteStore = new NamespaceAwareCoordinatorStreamStore(metadataStore, NAMESPACE); this.fanOutStore = new NamespaceAwareCoordinatorStreamStore(metadataStore, NAMESPACE_FAN_OUT); LOG.info("Lifecycle of metadata store: is managed externally", metadataStore.getClass().getCanonicalName()); LOG.info("Startpoints are written to namespace: and fanned out to namespace: in the metadata store", NAMESPACE, NAMESPACE_FAN_OUT); }

Target:
public StartpointManager(MetadataStore metadataStore) { Preconditions.checkNotNull(metadataStore, "MetadataStore cannot be null"); this.readWriteStore = new NamespaceAwareCoordinatorStreamStore(metadataStore, NAMESPACE); this.fanOutStore = new NamespaceAwareCoordinatorStreamStore(metadataStore, NAMESPACE_FAN_OUT); LOG.info("Startpoints are written to namespace: and fanned out to namespace: in the metadata store of type: {}", NAMESPACE, NAMESPACE_FAN_OUT, metadataStore.getClass().getCanonicalName()); }
Source:
public void updated(Map<String, Object> properties) { KuraGPIOPin pin = this.myservice.getPinByTerminal(6); this.options = new LedOptions(properties); try { pin.open(); } catch (KuraGPIODeviceException | KuraUnavailableDeviceException | IOException e) { e.printStackTrace(); } if (this.options.isEnableLed()) { try { pin.setValue(true); TimeUnit.SECONDS.sleep(1); } catch (KuraUnavailableDeviceException | IOException | KuraClosedDeviceException e) { s_logger.error("Exception GPIOService ", e); } catch (InterruptedException e) { e.printStackTrace(); } } else { try { pin.setValue(false); TimeUnit.SECONDS.sleep(1); pin.close(); } catch (KuraUnavailableDeviceException | KuraClosedDeviceException | IOException e) { s_logger.error("Exception GPIOService ", e); } catch (InterruptedException e) { e.printStackTrace(); } } }

Target:
public void updated(Map<String, Object> properties) { this.options = new LedOptions(properties); close(); pin = this.myservice.getPinByTerminal(this.options.isConfigPin()); if (pin == null) { return; } open(); setValue(this.options.isEnableLed()); }
Source:
protected void verifySafeObject(final AnyObjectId id, final int type, final byte[] data) { try { super.verifySafeObject(id, type, data); } catch (CorruptObjectException e) { CorruptObject o = new CorruptObject(id.toObjectId(), type, e.getErrorType()); corruptObjects.add(o); } }

Target:
protected void verifySafeObject(final AnyObjectId id, final int type, final byte[] data) { try { super.verifySafeObject(id, type, data); } catch (CorruptObjectException e) { corruptObjects.add( new CorruptObject(id.toObjectId(), type, e.getErrorType())); } }
Source:
public PushSetupAlarm execute(final LnClientConnection conn, final DlmsDevice device, final Void useless) throws IOException, TimeoutException, ProtocolAdapterException { LOGGER.info("Retrieving Push Setup Alarm"); final List<GetResult> getResultList = this.dlmsHelperService.getWithList(conn, device, ATTRIBUTE_ADDRESSES); checkResultList(getResultList, ATTRIBUTE_ADDRESSES); final PushSetupAlarm.Builder pushSetupAlarmBuilder = new PushSetupAlarm.Builder(); pushSetupAlarmBuilder.logicalName(new CosemObisCode(OBIS_CODE.bytes())); pushSetupAlarmBuilder.pushObjectList(this.dlmsHelperService.readListOfObjectDefinition( getResultList.get(INDEX_PUSH_OBJECT_LIST), "Push Object List")); pushSetupAlarmBuilder.sendDestinationAndMethod(this.dlmsHelperService.readSendDestinationAndMethod( getResultList.get(INDEX_SEND_DESTINATION_AND_METHOD), "Send Destination And Method")); pushSetupAlarmBuilder.communicationWindow(this.dlmsHelperService.readListOfWindowElement( getResultList.get(INDEX_COMMUNICATION_WINDOW), "Communication Window")); pushSetupAlarmBuilder.randomisationStartInterval(this.dlmsHelperService.readLongNotNull( getResultList.get(INDEX_RANDOMISATION_START_INTERVAL), "Randomisation Start Interval").intValue()); pushSetupAlarmBuilder.numberOfRetries(this.dlmsHelperService.readLongNotNull( getResultList.get(INDEX_NUMBER_OF_RETRIES), "Number of Retries").intValue()); pushSetupAlarmBuilder.repetitionDelay(this.dlmsHelperService.readLongNotNull( getResultList.get(INDEX_REPETITION_DELAY), "Repetition Delay").intValue()); return pushSetupAlarmBuilder.build(); }

Target:
public PushSetupAlarm execute(final LnClientConnection conn, final DlmsDevice device, final Void useless) throws ProtocolAdapterException { LOGGER.info("Retrieving Push Setup Alarm"); final List<GetResult> getResultList = this.dlmsHelperService.getWithList(conn, device, ATTRIBUTE_ADDRESSES); GetPushSetupCommandExecutor.checkResultList(getResultList, ATTRIBUTE_ADDRESSES); final PushSetupAlarm.Builder pushSetupAlarmBuilder = new PushSetupAlarm.Builder(); pushSetupAlarmBuilder.logicalName(new CosemObisCode(OBIS_CODE.bytes())); pushSetupAlarmBuilder.pushObjectList(this.dlmsHelperService.readListOfObjectDefinition( getResultList.get(INDEX_PUSH_OBJECT_LIST), "Push Object List")); pushSetupAlarmBuilder.sendDestinationAndMethod(this.dlmsHelperService.readSendDestinationAndMethod( getResultList.get(INDEX_SEND_DESTINATION_AND_METHOD), "Send Destination And Method")); pushSetupAlarmBuilder.communicationWindow(this.dlmsHelperService.readListOfWindowElement( getResultList.get(INDEX_COMMUNICATION_WINDOW), "Communication Window")); pushSetupAlarmBuilder.randomisationStartInterval(this.dlmsHelperService.readLongNotNull( getResultList.get(INDEX_RANDOMISATION_START_INTERVAL), "Randomisation Start Interval").intValue()); pushSetupAlarmBuilder.numberOfRetries(this.dlmsHelperService.readLongNotNull( getResultList.get(INDEX_NUMBER_OF_RETRIES), "Number of Retries").intValue()); pushSetupAlarmBuilder.repetitionDelay(this.dlmsHelperService.readLongNotNull( getResultList.get(INDEX_REPETITION_DELAY), "Repetition Delay").intValue()); return pushSetupAlarmBuilder.build(); }
Source:
public String getBuildStartedMessage(AbstractBuild build) { if (thisOverrides("getBuildsStartedMessage", Run.class)) { return getBuildStartedMessage((Run)build); } return null; }

Target:
public String getBuildStartedMessage(AbstractBuild build) { if (thisOverrides("getBuildStartedMessage", Run.class)) { return getBuildStartedMessage((Run)build); } return null; }
Source:
public void respondsToChangesInSingleQueryLimitBatchParameter() { AtomicReference<CassandraCellLoadingConfig> config = new AtomicReference<>(LOADING_CONFIG); CellLoadingBatcher reloadingBatcher = new CellLoadingBatcher(config::get, rebatchingCallback); reloadingBatcher.partitionIntoBatches(rowRange(SINGLE_QUERY_LIMIT, 0), ADDRESS, TABLE_REFERENCE); config.set(ImmutableCassandraCellLoadingConfig.builder() .crossColumnLoadBatchLimit(CROSS_COLUMN_LIMIT) .singleQueryLoadBatchLimit(2 * SINGLE_QUERY_LIMIT) .build()); List<List<Cell>> largerBatches = reloadingBatcher.partitionIntoBatches( rowRange(2 * SINGLE_QUERY_LIMIT, 0), ADDRESS, TABLE_REFERENCE); assertBatchContentsMatch(largerBatches, rowRange(2 * SINGLE_QUERY_LIMIT, 0)); verify(rebatchingCallback, never()).consume(any(), any(), anyInt()); }

Target:
public void respondsToChangesInSingleQueryLimitBatchParameter() { AtomicReference<CassandraCellLoadingConfig> config = new AtomicReference<>(LOADING_CONFIG); CellLoadingBatcher reloadingBatcher = new CellLoadingBatcher(config::get, rebatchingCallback); updateConfig(config, CROSS_COLUMN_LIMIT, 2 * SINGLE_QUERY_LIMIT); List<List<Cell>> largerBatches = reloadingBatcher.partitionIntoBatches( rowRange(2 * SINGLE_QUERY_LIMIT, 0), ADDRESS, TABLE_REFERENCE); assertBatchContentsMatch(largerBatches, rowRange(2 * SINGLE_QUERY_LIMIT, 0)); verify(rebatchingCallback, never()).consume(any(), any(), anyInt()); }
Source:
private boolean applyFilters(Instance instance) { if (this.unconditionalFilters.size() == 0 && this.typeFilters.size() == 0 && this.excludedTypes.size() == 0) return true; return (this.unconditionalFilters.size() == 0 ? false : applyUnconditionalFilter(instance)) || (this.typeFilters.size() == 0 ? false : applyTypedFilter(instance)) || (this.excludedTypes.size() == 0 ? false : applyExcludeFilters(instance)); }

Target:
private boolean applyFilters(Instance instance) { if (this.unconditionalFilters.size() == 0 && this.typeFilters.size() == 0 && this.excludedTypes.size() == 0) return true; if (applyExcludeFilters(instance)) return false; if (this.unconditionalFilters.size() == 0 && this.typeFilters.size() == 0) return true; return applyTypedFilter(instance) || applyUnconditionalFilter(instance); }
Source:
private Mono<Void> handleFireAndForget(Payload payload) { if (payload.refCnt() <= 0) { return Mono.error(new IllegalReferenceCountException()); } if (isDisposed()) { payload.release(); final Throwable t = terminationError; return Mono.error(t); } if (!PayloadValidationUtils.isValid(this.mtu, payload)) { payload.release(); return Mono.error(new IllegalArgumentException(INVALID_PAYLOAD_ERROR_MESSAGE)); } final AtomicBoolean once = new AtomicBoolean(); return Mono.<Void>defer( () -> { if (once.getAndSet(true)) { return Mono.error( new IllegalStateException("FireAndForgetMono allows only a single subscriber")); } if (isDisposed()) { payload.release(); final Throwable t = terminationError; return Mono.error(t); } RequesterLeaseHandler lh = leaseHandler; if (!lh.useLease()) { return Mono.error(lh.leaseError()); } final int streamId = streamIdSupplier.nextStreamId(receivers); final ByteBuf requestFrame = RequestFireAndForgetFrameCodec.encodeReleasingPayload( allocator, streamId, payload); sendProcessor.onNext(requestFrame); return Mono.empty(); }) .subscribeOn(serialScheduler); }

Target:
private Mono<Void> handleFireAndForget(Payload payload) { if (payload.refCnt() <= 0) { return Mono.error(new IllegalReferenceCountException()); } if (isDisposed()) { payload.release(); final Throwable t = terminationError; return Mono.error(t); } if (!PayloadValidationUtils.isValid(this.mtu, payload)) { payload.release(); return Mono.error(new IllegalArgumentException(INVALID_PAYLOAD_ERROR_MESSAGE)); } final AtomicBoolean once = new AtomicBoolean(); return Mono.<Void>defer( () -> { if (once.getAndSet(true)) { return Mono.error( new IllegalStateException("FireAndForgetMono allows only a single subscriber")); } if (isDisposed()) { payload.release(); final Throwable t = terminationError; return Mono.error(t); } RequesterLeaseHandler lh = leaseHandler; if (!lh.useLease()) { payload.release(); return Mono.error(lh.leaseError()); } final int streamId = streamIdSupplier.nextStreamId(receivers); final ByteBuf requestFrame = RequestFireAndForgetFrameCodec.encodeReleasingPayload( allocator, streamId, payload); sendProcessor.onNext(requestFrame); return Mono.empty(); }) .subscribeOn(serialScheduler); }
Source:
public RelyingPartyRegistration build() { return new RelyingPartyRegistration( registrationId, assertionConsumerServiceUrlTemplate, new ProviderDetails( providerDetailsBuilder.entityId, providerDetailsBuilder.webSsoUrl, providerDetailsBuilder.signAuthNRequest, providerDetailsBuilder.binding ), credentials, localEntityIdTemplate ); }

Target:
public RelyingPartyRegistration build() { return new RelyingPartyRegistration( this.registrationId, this.assertionConsumerServiceUrlTemplate, this.providerDetails.build(), this.credentials, this.localEntityIdTemplate ); }
Source:
public static List<CloneSourceProvider> getCloneSourceProvider() { List<CloneSourceProvider> cloneSourceProvider = new ArrayList<CloneSourceProvider>(); IExtensionRegistry registry = Platform.getExtensionRegistry(); IConfigurationElement[] config = registry .getConfigurationElementsFor(CLONE_SOURCE_PROVIDER_ID); if (config.length > 0) { addCloneSourceProvider(cloneSourceProvider, config, 0); } return cloneSourceProvider; }

Target:
public static List<CloneSourceProvider> getCloneSourceProvider() { List<CloneSourceProvider> cloneSourceProvider = new ArrayList<CloneSourceProvider>(); IExtensionRegistry registry = Platform.getExtensionRegistry(); IConfigurationElement[] config = registry .getConfigurationElementsFor(CLONE_SOURCE_PROVIDER_ID); if (config.length > 0) addCloneSourceProvider(cloneSourceProvider, config, 0); return cloneSourceProvider; }
Source:
public boolean update(Change change) throws IOException { try { return new ChangeUpdateTask(schemaFactory, change).call(); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw MAPPER.apply(e); } }

Target:
public boolean update(Change change) throws IOException { try { return new ChangeUpdateTask(schemaFactory, change).call(); } catch (Exception e) { Throwables.propagateIfPossible(e); throw MAPPER.apply(e); } }
Source:
protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); switch(requestCode) { case BARCODE_CAPTURE: if (resultCode == RESULT_OK) { String scanResult = data.getStringExtra("SCAN_RESULT"); try { Pair<String, String[]> activatedPrivileges = new PrivilegesUtility(GlobalConstants.TRUSTED_SOURCE_PUBLIC_KEY). processPrivilegePayloadForActivatedPrivileges(scanResult); for(String p : activatedPrivileges.second) { if (!GlobalPrivilegesManager.allGlobalPrivilegesList.contains(p)) { Log.d(TAG, "Request to activate unknown privilege: " + p); } else { GlobalPrivilegesManager.enablePrivilege(p, activatedPrivileges.first); } } refreshUI(); } catch (PrivilegesUtility.UnrecognizedPayloadVersionException e) { e.printStackTrace(); privilegeClaimTooNew(); } catch (PrivilegesUtility.PrivilagePayloadException e) { e.printStackTrace(); privilegeClaimFailed(); } } } }

Target:
protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); switch (requestCode) { case BARCODE_CAPTURE: if (resultCode == RESULT_OK) { String scanResult = data.getStringExtra("SCAN_RESULT"); try { Pair<String, String[]> activatedPrivileges = new PrivilegesUtility(GlobalConstants.TRUSTED_SOURCE_PUBLIC_KEY). processPrivilegePayloadForActivatedPrivileges(scanResult); for (String p : activatedPrivileges.second) { if (!GlobalPrivilegesManager.allGlobalPrivilegesList.contains(p)) { Log.d(TAG, "Request to activate unknown privilege: " + p); } else { GlobalPrivilegesManager.enablePrivilege(p, activatedPrivileges.first); } } refreshUI(); } catch (PrivilegesUtility.UnrecognizedPayloadVersionException e) { e.printStackTrace(); privilegePayloadVersionTooNew(); } catch (PrivilegesUtility.PrivilagePayloadException e) { e.printStackTrace(); privilegeClaimFailed(); } } } }
Source:
public void triggerAdHocFragment(String caseId, String stageId, String fragmentName, Object data) throws CaseNotFoundException { authorizationManager.checkAuthorization(caseId); ProcessInstanceDesc pi = verifyCaseIdExists(caseId); triggerAdHocFragment(pi.getId(), stageId, fragmentName, data); }

Target:
public void triggerAdHocFragment(String caseId, String stageId, String fragmentName, Object data) throws CaseNotFoundException { ProcessInstanceDesc pi = verifyCaseIdExists(caseId); triggerAdHocFragment(pi.getId(), stageId, fragmentName, data); }
Source:
private void processJoinMessage(final Message message, final JoinMessage joinMessage) { String joinedMember = channel.getName(message.getSrc()); if (joinedMember != null) { int loadFactor = joinMessage.getLoadFactor(); Predicate<CommandMessage<?>> commandFilter = joinMessage.messageFilter(); SimpleMember<Address> member = new SimpleMember<>(joinedMember, message.getSrc(), false, null); members.put(member.endpoint(), member); consistentHash.updateAndGet(ch -> ch.with(member, loadFactor, commandFilter)); if (logger.isInfoEnabled() && !message.getSrc().equals(channel.getAddress())) { logger.info("{} joined with load factor: {}", joinedMember, loadFactor); } if (logger.isDebugEnabled()) { logger.debug("Got a network of members: {}", members.values()); } } else { logger.warn("Received join message from '{}', but a connection with the sender has been lost.", message.getSrc().toString()); } }

Target:
private void processJoinMessage(final Message message, final JoinMessage joinMessage) { String joinedMember = channel.getName(message.getSrc()); if (joinedMember != null) { int loadFactor = joinMessage.getLoadFactor(); Predicate<CommandMessage<?>> commandFilter = joinMessage.messageFilter(); SimpleMember<Address> member = new SimpleMember<>(joinedMember, message.getSrc(), NON_LOCAL_MEMBER, null); members.put(member.endpoint(), member); consistentHash.updateAndGet(ch -> ch.with(member, loadFactor, commandFilter)); if (logger.isInfoEnabled() && !message.getSrc().equals(channel.getAddress())) { logger.info("{} joined with load factor: {}", joinedMember, loadFactor); } if (logger.isDebugEnabled()) { logger.debug("Got a network of members: {}", members.values()); } } else { logger.warn("Received join message from '{}', but a connection with the sender has been lost.", message.getSrc().toString()); } }
Source:
private void retrieveTenantsConfiguration(PlatformAPI platformAPI) throws IOException { Map<Long, Map<String, byte[]>> clientPlatformConfigurations = platformAPI.getClientTenantConfigurations(); for (Map.Entry<Long, Map<String, byte[]>> longMapEntry : clientPlatformConfigurations.entrySet()) { ConfigurationFilesManager.getInstance().setTenantConfigurations(longMapEntry.getValue(), longMapEntry.getKey()); } }

Target:
private void retrieveTenantsConfiguration(PlatformAPI platformAPI) throws IOException { Map<Long, Map<String, byte[]>> clientPlatformConfigurations = platformAPI.getClientTenantConfigurations(); for (Map.Entry<Long, Map<String, byte[]>> tenantConfiguration : clientPlatformConfigurations.entrySet()) { ConfigurationFilesManager.getInstance().setTenantConfigurations(tenantConfiguration.getValue(), tenantConfiguration.getKey()); } }
Source:
private static void whoAmI(boolean canLogOut) { Account account = getUserAccount(); final CurrentUserPopupPanel userPopup = new CurrentUserPopupPanel(account, canLogOut); final String name = FormatUtil.name(account); String[] names = name.split("\\s+", 2); final InlineLabel l = new InlineLabel(names[0] + " ▾"); l.setStyleName(RESOURCES.css().menuBarUserName()); l.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (userPopup.isShowing()) { userPopup.hide(); } else { userPopup.showRelativeTo(l); } } }); userPopup.addAutoHidePartner(l.getElement()); menuRight.add(l); }

Target:
private static void whoAmI(boolean canLogOut) { Account account = getUserAccount(); final CurrentUserPopupPanel userPopup = new CurrentUserPopupPanel(account, canLogOut); final InlineLabel l = new InlineLabel(FormatUtil.name(account) + " ▾"); l.setStyleName(RESOURCES.css().menuBarUserName()); l.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (userPopup.isShowing()) { userPopup.hide(); } else { userPopup.showRelativeTo(l); } } }); userPopup.addAutoHidePartner(l.getElement()); FocusPanel fp = new FocusPanel(l); fp.setStyleName(RESOURCES.css().menuBarUserNameFocusPanel()); fp.addKeyDownHandler(new KeyDownHandler() { @Override public void onKeyDown(KeyDownEvent event) { if(event.getNativeKeyCode() == KeyCodes.KEY_ENTER) { if (userPopup.isShowing()) { userPopup.hide(); } else { userPopup.showRelativeTo(l); } event.preventDefault(); } } }); menuRight.add(fp); }
Source:
public Builder withCreatedAt(Date createdAt) { if (createdAt != null) { accountAttributes.createdAt = createdAt; } return this; }

Target:
public Builder withCreatedAt(Date createdAt) { accountAttributes.createdAt = createdAt; return this; }
Source:
public static ZoneOffset ofHoursMinutes(int hours, int minutes) { checkArgument(Math.abs(hours) <= 17, "offset hour size must be between -17 and 17 hours inclusive"); checkArgument(Math.abs(minutes) <= 60, "offset minute size must be between -60 and 60 minutes inclusive"); @SuppressWarnings("NumericCastThatLosesPrecision") final int secondsInHours = (int) Durations.toSeconds(Durations.ofHours(hours)) ; final int secondsInMinutes = (int) Durations.toSeconds(Durations.ofMinutes(minutes)) ; final int seconds = secondsInHours + secondsInMinutes; return ZoneOffset.newBuilder() .setAmountSeconds(seconds) .build(); }

Target:
public static ZoneOffset ofHoursMinutes(int hours, int minutes) { final int maxHoursBound = 17; final int maxMinutesBound = 60; checkArgument(Math.abs(hours) <= maxHoursBound, "offset hour size must be between -17 and 17 hours inclusive"); checkArgument(Math.abs(minutes) <= maxMinutesBound, "offset minute size must be between -60 and 60 minutes inclusive"); final int secondsInHours = (int) Durations.toSeconds(Durations.ofHours(hours)); final int secondsInMinutes = (int) Durations.toSeconds(Durations.ofMinutes(minutes)); final int seconds = secondsInHours + secondsInMinutes; return ZoneOffset.newBuilder() .setAmountSeconds(seconds) .build(); }
Source:
private Statement withClassRules(Statement statement) { return RunRules.applyAll(statement, classRules(), getDescription()); }

Target:
private Statement withClassRules(Statement statement) { List<TestRule> classRules = classRules(); return classRules.isEmpty() ? statement : new RunRules(statement, classRules, getDescription()); }
Source:
default <U> Seq<U> flatMap(Function<? super Tuple2<K, V>, ? extends Iterable<? extends U>> mapper) { Objects.requireNonNull(mapper, "mapper is null"); return Stream.ofAll(iterator()).flatMap(mapper); }

Target:
default <U> Seq<U> flatMap(Function<? super Tuple2<K, V>, ? extends Iterable<? extends U>> mapper) { Objects.requireNonNull(mapper, "mapper is null"); return (Seq<U>) iterator().flatMap(mapper).toStream(); }
Source:
NonBlockingRouter(RouterConfig routerConfig, NonBlockingRouterMetrics routerMetrics, NetworkClientFactory networkClientFactory, NotificationSystem notificationSystem, ClusterMap clusterMap, KeyManagementService kms, CryptoService cryptoService, CryptoJobHandler cryptoJobHandler, Time time) throws IOException { this.routerConfig = routerConfig; this.routerMetrics = routerMetrics; this.networkClientFactory = networkClientFactory; this.notificationSystem = notificationSystem; this.clusterMap = clusterMap; responseHandler = new ResponseHandler(clusterMap); this.kms = kms; this.cryptoService = cryptoService; this.cryptoJobHandler = cryptoJobHandler; if (cryptoJobHandler != null) { cryptoJobHandler.start(); } this.time = time; ocCount = routerConfig.routerScalingUnitCount; ocList = new ArrayList<>(); for (int i = 0; i < ocCount; i++) { ocList.add(new OperationController(Integer.toString(i))); } backgroundDeleter = new BackgroundDeleter(); ocList.add(backgroundDeleter); routerMetrics.initializeNumActiveOperationsMetrics(currentOperationsCount, currentBackgroundOperationsCount); }

Target:
NonBlockingRouter(RouterConfig routerConfig, NonBlockingRouterMetrics routerMetrics, NetworkClientFactory networkClientFactory, NotificationSystem notificationSystem, ClusterMap clusterMap, KeyManagementService kms, CryptoService cryptoService, CryptoJobHandler cryptoJobHandler, Time time) throws IOException { this.routerConfig = routerConfig; this.routerMetrics = routerMetrics; this.networkClientFactory = networkClientFactory; this.notificationSystem = notificationSystem; this.clusterMap = clusterMap; responseHandler = new ResponseHandler(clusterMap); this.kms = kms; this.cryptoService = cryptoService; this.cryptoJobHandler = cryptoJobHandler; this.time = time; ocCount = routerConfig.routerScalingUnitCount; ocList = new ArrayList<>(); for (int i = 0; i < ocCount; i++) { ocList.add(new OperationController(Integer.toString(i))); } backgroundDeleter = new BackgroundDeleter(); ocList.add(backgroundDeleter); routerMetrics.initializeNumActiveOperationsMetrics(currentOperationsCount, currentBackgroundOperationsCount); }
Source:
public void topic() throws Exception { PushOneCommit.Result r = createChange(); assertEquals("", gApi.changes() .id("p~master~" + r.getChangeId()) .topic()); gApi.changes() .id("p~master~" + r.getChangeId()) .topic("mytopic"); assertEquals("mytopic", gApi.changes() .id("p~master~" + r.getChangeId()) .topic()); gApi.changes() .id("p~master~" + r.getChangeId()) .topic(""); assertEquals("", gApi.changes() .id("p~master~" + r.getChangeId()) .topic()); }

Target:
public void topic() throws Exception { PushOneCommit.Result r = createChange(); assertEquals("", gApi.changes() .id(r.getChangeId()) .topic()); gApi.changes() .id(r.getChangeId()) .topic("mytopic"); assertEquals("mytopic", gApi.changes() .id(r.getChangeId()) .topic()); gApi.changes() .id(r.getChangeId()) .topic(""); assertEquals("", gApi.changes() .id(r.getChangeId()) .topic()); }