auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static List<ColumnModel> expandFromAggregation(List<ColumnAggregation> aggregations){ List<ColumnModel> results = new LinkedList<>(); for(ColumnAggregation aggregation: aggregations) { String[] typeSplit = aggregation.getColumnTypeConcat().split(","); for(String typeString: typeSplit) { ColumnModel model = new ColumnModel(); model.setName(aggregation.getColumnName()); ColumnType type = AnnotationType.valueOf(typeString).getColumnType(); if(aggregation.getListSize() > 1){ try { type = ColumnTypeListMappings.forNonListType(type).getListType(); } catch (IllegalArgumentException e){ } } model.setColumnType(type); if(ColumnType.STRING == type || ColumnType.STRING_LIST==type) { model.setMaximumSize(aggregation.getMaxStringElementSize()); } results.add(model); } } return results; }

Target:
public static List<ColumnModel> expandFromAggregation(List<ColumnAggregation> aggregations){ List<ColumnModel> results = new LinkedList<>(); for(ColumnAggregation aggregation: aggregations) { String[] typeSplit = aggregation.getColumnTypeConcat().split(","); for(String typeString: typeSplit) { ColumnModel model = new ColumnModel(); model.setName(aggregation.getColumnName()); ColumnType type = AnnotationType.valueOf(typeString).getColumnType(); if(aggregation.getMaxListSize() > 1){ try { type = ColumnTypeListMappings.listType(type); } catch (IllegalArgumentException e){ } } model.setColumnType(type); if(ColumnType.STRING == type || ColumnType.STRING_LIST==type) { model.setMaximumSize(aggregation.getMaxStringElementSize()); } results.add(model); } } return results; }
Source:
public void testSplitMultiValuedCellsTextCase() throws Exception { AbstractOperation op = new MultiValuedCellSplitOperation( "Value", "Key", "(?<=[a-z]|[a-z][\\s])(?=[A-Z])", true); Process process = op.createProcess(project, new Properties()); process.performImmediate(); int keyCol = project.columnModel.getColumnByName("Key").getCellIndex(); int valueCol = project.columnModel.getColumnByName("Value").getCellIndex(); Assert.assertEquals(project.rows.get(0).getCellValue(keyCol), "Record_1"); Assert.assertEquals(project.rows.get(0).getCellValue(valueCol), "one:two;three four;five"); Assert.assertEquals(project.rows.get(1).getCellValue(keyCol), null); Assert.assertEquals(project.rows.get(1).getCellValue(valueCol), "Six "); Assert.assertEquals(project.rows.get(2).getCellValue(keyCol), null); Assert.assertEquals(project.rows.get(2).getCellValue(valueCol), "Seven"); Assert.assertEquals(project.rows.get(3).getCellValue(keyCol), null); Assert.assertEquals(project.rows.get(3).getCellValue(valueCol), "Eight;nine91011twelve thirteen 14Fifteen"); }

Target:
public void testSplitMultiValuedCellsTextCase() throws Exception { AbstractOperation op = new MultiValuedCellSplitOperation( "Value", "Key", "(?<=\\p{Lower}|[\\p{Lower}][\\s])(?=\\p{Upper})", true); Process process = op.createProcess(project, new Properties()); process.performImmediate(); int keyCol = project.columnModel.getColumnByName("Key").getCellIndex(); int valueCol = project.columnModel.getColumnByName("Value").getCellIndex(); Assert.assertEquals(project.rows.get(0).getCellValue(keyCol), "Record_1"); Assert.assertEquals(project.rows.get(0).getCellValue(valueCol), "one:two;three four;five"); Assert.assertEquals(project.rows.get(1).getCellValue(keyCol), null); Assert.assertEquals(project.rows.get(1).getCellValue(valueCol), "Six "); Assert.assertEquals(project.rows.get(2).getCellValue(keyCol), null); Assert.assertEquals(project.rows.get(2).getCellValue(valueCol), "Sevè"); Assert.assertEquals(project.rows.get(3).getCellValue(keyCol), null); Assert.assertEquals(project.rows.get(3).getCellValue(valueCol), "Ëight;niné91011twelve thirteen 14Àifteen"); }
Source:
protected void checkForm(String prefix, String title, String description, boolean checkAllMetadata, boolean isEdit) { LayoutElement form = new LayoutElement(driver, prefix); try { Assert.assertEquals(title, form.getWidget("nxw_title").getValue(isEdit)); } catch (NoSuchElementException e) { throw e; } if (description != null) { Assert.assertEquals(description, form.getWidget("nxw_description").getValue(isEdit)); } if (checkAllMetadata) { Assert.assertEquals("test string", form.getWidget("nxw_simpleString").getValue(isEdit)); Assert.assertEquals("Oct 11, 2012", form.getWidget("nxw_simpleDate", DateWidgetElement.class).getValue(isEdit)); FileWidgetElement file = form.getWidget("nxw_simpleBlob", FileWidgetElement.class); String filename = file.getFilename(isEdit); Assert.assertTrue(filename != null); Assert.assertTrue(filename.startsWith("Studio test")); Assert.assertTrue(filename.endsWith(".txt")); JSListWidgetElement list = form.getWidget("nxw_multiString", JSListWidgetElement.class); String subId = "nxw_sub0"; Assert.assertEquals("hihi", list.getSubWidget(subId, 0, false).getValue(isEdit)); Assert.assertEquals("hoho", list.getSubWidget(subId, 1, false).getValue(isEdit)); } }

Target:
protected void checkForm(String prefix, String title, String description, boolean checkAllMetadata, boolean isEdit) { LayoutElement form = new LayoutElement(driver, prefix); Assert.assertEquals(title, form.getWidget("nxw_title").getValue(isEdit)); if (description != null) { Assert.assertEquals(description, form.getWidget("nxw_description").getValue(isEdit)); } if (checkAllMetadata) { Assert.assertEquals("test string", form.getWidget("nxw_simpleString").getValue(isEdit)); Assert.assertEquals("Oct 11, 2012", form.getWidget("nxw_simpleDate", DateWidgetElement.class).getValue(isEdit)); FileWidgetElement file = form.getWidget("nxw_simpleBlob", FileWidgetElement.class); String filename = file.getFilename(isEdit); Assert.assertTrue(filename != null); Assert.assertTrue(filename.startsWith("Studio test")); Assert.assertTrue(filename.endsWith(".txt")); JSListWidgetElement list = form.getWidget("nxw_multiString", JSListWidgetElement.class); String subId = "nxw_sub0"; Assert.assertEquals("hihi", list.getSubWidget(subId, 0, false).getValue(isEdit)); Assert.assertEquals("hoho", list.getSubWidget(subId, 1, false).getValue(isEdit)); } }
Source:
public DistributedRemoteSubscriptionStorage(@Named("jgroups.config.file") String confFile) throws Exception { try { JChannel channel = new JChannel(confFile); this.lockService = new LockService(channel); channel.connect(CHANNEL_NAME); subscriptions = new ReplicatedHashMap<>(channel); subscriptions.start(5000); } catch (Exception e) { LOG.error("Unable to create distributed event subscriptions map.", e); throw e; } }

Target:
public DistributedRemoteSubscriptionStorage(@Named("jgroups.config.file") String confFile) throws Exception { try { JChannel channel = new JChannel(confFile); this.lockService = new LockService(channel); channel.connect(CHANNEL_NAME); subscriptions = new ReplicatedHashMap<>(channel); subscriptions.setBlockingUpdates(true); subscriptions.start(5000); } catch (Exception e) { LOG.error("Unable to create distributed event subscriptions map.", e); throw e; } }
Source:
public AbstractPackageRegistry(SecurityConfig securityConfig) { super(); if (securityConfig != null) { this.securityConfig = securityConfig; } else { this.securityConfig = new SecurityConfig(null, null); } }

Target:
public AbstractPackageRegistry(SecurityConfig securityConfig) { if (securityConfig != null) { this.securityConfig = securityConfig; } else { this.securityConfig = new SecurityConfig(null, null); } }
Source:
public static DataSource azureTableStorage( String name, String storageConnectionString, String tableName, String query, String description, DataDeletionDetectionPolicy deletionDetectionPolicy) { if (StringUtils.isEmpty(name)) { throw new IllegalArgumentException("name cannot be null or empty"); } if (StringUtils.isEmpty(tableName)) { throw new IllegalArgumentException("tableName cannot be null or empty"); } if (StringUtils.isEmpty(storageConnectionString)) { throw new IllegalArgumentException("storageConnectionString cannot be null or empty"); } return new DataSource() .setName(name) .setType(DataSourceType.AZURE_TABLE) .setCredentials(new DataSourceCredentials() .setConnectionString(storageConnectionString)) .setContainer(new DataContainer() .setName(tableName) .setQuery(query)) .setDescription(description) .setDataDeletionDetectionPolicy(deletionDetectionPolicy); }

Target:
public static DataSource azureTableStorage( String name, String storageConnectionString, String tableName, String query, String description, DataDeletionDetectionPolicy deletionDetectionPolicy) { if (CoreUtils.isNullOrEmpty(name)) { throw new IllegalArgumentException("name cannot be null or empty"); } if (CoreUtils.isNullOrEmpty(tableName)) { throw new IllegalArgumentException("tableName cannot be null or empty"); } if (CoreUtils.isNullOrEmpty(storageConnectionString)) { throw new IllegalArgumentException("storageConnectionString cannot be null or empty"); } return new DataSource() .setName(name) .setType(DataSourceType.AZURE_TABLE) .setCredentials(new DataSourceCredentials() .setConnectionString(storageConnectionString)) .setContainer(new DataContainer() .setName(tableName) .setQuery(query)) .setDescription(description) .setDataDeletionDetectionPolicy(deletionDetectionPolicy); }
Source:
Map<String, String> getTableNameTagFor(TableReference tableRef) { String tableName = tableRef.getTablename(); if (!isSafeToLog.apply(tableRef)) { tableName = "unsafeTableRef_" + obfuscate(tableRef); } return ImmutableMap.of("tableName", tableName); }

Target:
Map<String, String> getTableNameTagFor(TableReference tableRef) { String tableName = tableRef.getTablename(); if (!isSafeToLog.apply(tableRef)) { tableName = "unsafeTable_" + obfuscate(tableRef); } return ImmutableMap.of("tableName", tableName); }
Source:
public static Map<String, String> decodeHeaders(ByteBuf buffer) { int numHeaders = buffer.readUnsignedShort(); Map<String, String> headers = new HashMap<>(numHeaders); for (int i = 0; i < numHeaders; i++) { String key = CodecUtils.decodeString(buffer); String value = CodecUtils.decodeString(buffer); headers.put(key, value); } return headers; }

Target:
public static Map<String, String> decodeHeaders(ByteBuf buffer) { int numHeaders = buffer.readUnsignedShort(); Map<String, String> headers = Maps.newHashMapWithExpectedSize(numHeaders); for (int i = 0; i < numHeaders; i++) { String key = CodecUtils.decodeString(buffer); String value = CodecUtils.decodeString(buffer); headers.put(key, value); } return headers; }
Source:
private void createTiledElevationSource() { ArcGISTiledElevationSource tiledElevationSource = new ArcGISTiledElevationSource( Environment.getExternalStorageDirectory() + getString(R.string.local_tile_package_location)); tiledElevationSource.addLoadStatusChangedListener(loadStatusChangedEvent -> { if (loadStatusChangedEvent.getNewLoadStatus() == LoadStatus.LOADED) { mSceneView.getScene().getBaseSurface().getElevationSources().add(tiledElevationSource); } else if (loadStatusChangedEvent.getNewLoadStatus() == LoadStatus.FAILED_TO_LOAD) { logToUser(getString(R.string.error_tiled_elevation_source_load_failure_message)); } }); tiledElevationSource.loadAsync(); }

Target:
private void createTiledElevationSource() { ArcGISTiledElevationSource tiledElevationSource = new ArcGISTiledElevationSource( Environment.getExternalStorageDirectory() + getString(R.string.local_tile_package_location)); tiledElevationSource.addLoadStatusChangedListener(loadStatusChangedEvent -> { if (loadStatusChangedEvent.getNewLoadStatus() == LoadStatus.LOADED) { mSceneView.getScene().getBaseSurface().getElevationSources().add(tiledElevationSource); } else if (loadStatusChangedEvent.getNewLoadStatus() == LoadStatus.FAILED_TO_LOAD) { logErrorToUser(getString(R.string.error_tiled_elevation_source_load_failure_message)); } }); tiledElevationSource.loadAsync(); }
Source:
private PrimitiveLongIterator partitionedOperation( Function<ReadOnlyFulltext,PrimitiveLongIterator> readerFunction ) { return PrimitiveLongCollections.concat( indexReaders.parallelStream().map( readerFunction::apply ).collect( Collectors.toList() ) ); }

Target:
private PrimitiveLongIterator partitionedOperation( Function<ReadOnlyFulltext,PrimitiveLongIterator> readerFunction ) { return PrimitiveLongCollections.concat( indexReaders.parallelStream().map( readerFunction ).collect( Collectors.toList() ) ); }
Source:
public void testChecksumPlugin() throws IOException { final ChecksumPlugin plugin = new ChecksumPlugin(); final Jar jar = new Jar("jar", new File("testresources/componentsEntry/source.jar")); final Processor p = new Processor(); plugin.setReporter(p); final ChecksumDTO dto = (ChecksumDTO) plugin.extract(jar, Locale.forLanguageTag("und")); assertNotNull(dto.md5); assertNotNull(dto.sha1); assertNotNull(dto.sha256); assertTrue(p.isOk()); }

Target:
public void testChecksumPlugin() throws IOException { final ChecksumPlugin plugin = new ChecksumPlugin(); try (final Jar jar = new Jar("jar", new File("testresources/componentsEntry/source.jar")); Processor p = new Processor()) { plugin.setReporter(p); final ChecksumDTO dto = (ChecksumDTO) plugin.extract(jar, Locale.forLanguageTag("und")); assertNotNull(dto.md5); assertNotNull(dto.sha1); assertNotNull(dto.sha256); assertTrue(p.isOk()); } }
Source:
protected void doSingleFileUpdate(String indexId, String siteName, ContentStoreService contentStoreService, Context context, String path, boolean delete, UpdateDetail updateDetail, UpdateStatus updateStatus, Map<String, String> metadata) { if (delete) { doDelete(indexId, siteName, path, updateStatus); } else { Content binaryContent = contentStoreService.getContent(context, path); if (binaryContent != null && binaryContent.getLength() > 0) { if (binaryContent.getLength() > maxFileSize) { logger.info("Skipping large binary file @ {}", path); } else { doUpdateContent(indexId, siteName, path, binaryContent, updateDetail, updateStatus, metadata); } } } }

Target:
protected void doSingleFileUpdate(String indexId, String siteName, ContentStoreService contentStoreService, Context context, String path, boolean delete, UpdateDetail updateDetail, UpdateStatus updateStatus, Map<String, String> metadata) { if (delete) { doDelete(indexId, siteName, path, updateStatus); } else { Content binaryContent = contentStoreService.getContent(context, path); if (binaryContent != null && binaryContent.getLength() > 0) { if (binaryContent.getLength() > maxFileSize) { logger.warn("Skipping large binary file @ {}", path); } else { doUpdateContent(indexId, siteName, path, binaryContent, updateDetail, updateStatus, metadata); } } } }
Source:
private static String createDateSortStringForAffiliations(org.orcid.jaxb.model.v3.dev1.common.FuzzyDate startDate, org.orcid.jaxb.model.v3.dev1.common.FuzzyDate endDate, org.orcid.jaxb.model.v3.dev1.common.CreatedDate createdDate) { String dateSortString = ""; if(startDate == null && endDate == null) { XMLGregorianCalendar date = createdDate.getValue(); dateSortString = "Z-" + date.getYear() + "-" + date.getMonth() + "-" + date.getDay(); } else { if(endDate == null) { dateSortString = "Y-"; dateSortString += startDate.getYear() == null ? "NaN" : startDate.getYear().getValue(); if (!PojoUtil.isEmpty(startDate.getMonth())) dateSortString += "-" + startDate.getMonth().getValue(); if (!PojoUtil.isEmpty(startDate.getDay())) dateSortString += "-" + startDate.getDay().getValue(); } else { dateSortString = "X-"; dateSortString += endDate.getYear() == null ? "NaN" : endDate.getYear().getValue(); if (!PojoUtil.isEmpty(endDate.getMonth())) dateSortString += "-" + endDate.getMonth().getValue(); if (!PojoUtil.isEmpty(endDate.getDay())) dateSortString += "-" + endDate.getDay().getValue(); if(startDate != null) { dateSortString += startDate.getYear() == null ? "-NaN" : "-" + startDate.getYear().getValue(); if (!PojoUtil.isEmpty(startDate.getMonth())) dateSortString += "-" + startDate.getMonth().getValue(); if (!PojoUtil.isEmpty(startDate.getDay())) dateSortString += "-" + startDate.getDay().getValue(); } } } return dateSortString; }

Target:
private static String createDateSortStringForAffiliations(org.orcid.jaxb.model.v3.dev1.common.FuzzyDate startDate, org.orcid.jaxb.model.v3.dev1.common.FuzzyDate endDate, org.orcid.jaxb.model.v3.dev1.common.CreatedDate createdDate) { String dateSortString = ""; if (startDate == null && endDate == null) { XMLGregorianCalendar date = createdDate.getValue(); dateSortString = "Z-" + date.getYear() + "-" + date.getMonth() + "-" + date.getDay(); } else { if (endDate == null) { dateSortString = "Y-"; dateSortString += startDate.getYear() == null ? "NaN" : startDate.getYear().getValue(); if (!PojoUtil.isEmpty(startDate.getMonth())) { dateSortString += "-" + startDate.getMonth().getValue(); } else { dateSortString += "-00"; } if (!PojoUtil.isEmpty(startDate.getDay())) { dateSortString += "-" + startDate.getDay().getValue(); } else { dateSortString += "-00"; } } else { dateSortString = "X-"; dateSortString += endDate.getYear() == null ? "NaN" : endDate.getYear().getValue(); if (!PojoUtil.isEmpty(endDate.getMonth())) { dateSortString += "-" + endDate.getMonth().getValue(); } else { dateSortString += "-00"; } if (!PojoUtil.isEmpty(endDate.getDay())) { dateSortString += "-" + endDate.getDay().getValue(); } else { dateSortString += "-00"; } if (startDate != null) { dateSortString += startDate.getYear() == null ? "-NaN" : "-" + startDate.getYear().getValue(); if (!PojoUtil.isEmpty(startDate.getMonth())) { dateSortString += "-" + startDate.getMonth().getValue(); } else { dateSortString += "-00"; } if (!PojoUtil.isEmpty(startDate.getDay())) { dateSortString += "-" + startDate.getDay().getValue(); } else { dateSortString += "-00"; } } } } return dateSortString; }
Source:
private void cyclePreview(int newPosition) { PreviewPreferences previewPreferences = Globals.prefs.getPreviewPreferences() .getBuilder() .withPreviewCyclePosition(newPosition) .build(); updateLayout(previewPreferences); }

Target:
private void cyclePreview(int newPosition) { PreviewPreferences previewPreferences = preferences.getPreviewPreferences() .getBuilder() .withPreviewCyclePosition(newPosition) .build(); updateLayout(previewPreferences); }
Source:
@Test public void onlyScaleDownOriginalSmaller() throws Exception { Bitmap source = Bitmap.createBitmap(50, 50, ARGB_8888); Request data = new Request.Builder(URI_1).resize(100, 100).onlyScaleDown().build(); Bitmap result = transformResult(data, source, 0); ShadowBitmap shadowBitmap = shadowOf(result); assertThat(shadowBitmap.getCreatedFromBitmap()).isNull(); assertThat(shadowBitmap.getCreatedFromBitmap()).isNotSameAs(source); }

Target:
@Test public void onlyScaleDownOriginalSmaller() throws Exception { Bitmap source = Bitmap.createBitmap(50, 50, ARGB_8888); Request data = new Request.Builder(URI_1).resize(100, 100).onlyScaleDown().build(); Bitmap result = transformResult(data, source, 0); assertThat(result).isSameAs(source); ShadowBitmap shadowBitmap = shadowOf(result); assertThat(shadowBitmap.getCreatedFromBitmap()).isNull(); assertThat(shadowBitmap.getCreatedFromBitmap()).isNotSameAs(source); }
Source:
public boolean deleteDevice(@NotNull String deviceId) { DeviceDeleteRequest deviceDeleteRequest = new DeviceDeleteRequest(findById(deviceId)); Request request = Request.newBuilder() .withBody(deviceDeleteRequest) .build(); CompletableFuture<String> future = new CompletableFuture<>(); Consumer<Response> responseConsumer = response -> { Action resAction = response.getBody().getAction(); if (resAction.equals(Action.DEVICE_DELETE_RESPONSE)) { future.complete(response.getBody().getAction().name()); } else { logger.warn("Unknown action received from backend {}", resAction); } }; rpcClient.call(request, responseConsumer); return deviceDao.deleteById(deviceId) != 0; }

Target:
public boolean deleteDevice(@NotNull String deviceId) { DeviceVO deviceVO = deviceDao.findById(deviceId); if (deviceVO == null) { logger.error("Device with ID not found", deviceId); return false; } DeviceDeleteRequest deviceDeleteRequest = new DeviceDeleteRequest(deviceId); Request request = Request.newBuilder() .withBody(deviceDeleteRequest) .build(); CompletableFuture<String> future = new CompletableFuture<>(); Consumer<Response> responseConsumer = response -> { Action resAction = response.getBody().getAction(); if (resAction.equals(Action.DEVICE_DELETE_RESPONSE)) { future.complete(response.getBody().getAction().name()); } else { logger.warn("Unknown action received from backend {}", resAction); } }; rpcClient.call(request, responseConsumer); return deviceDao.deleteById(deviceId) != 0; }
Source:
public void onPartitionBecomeInactiveFromStandby(String partitionName) { PartitionStateChangeListener storageManagerListener = partitionStateChangeListeners.get(StateModelListenerType.StorageManagerListener); if (storageManagerListener != null) { storageManagerListener.onPartitionBecomeInactiveFromStandby(partitionName); } PartitionStateChangeListener replicationManagerListener = partitionStateChangeListeners.get(StateModelListenerType.ReplicationManagerListener); if (replicationManagerListener != null) { replicationManagerListener.onPartitionBecomeInactiveFromStandby(partitionName); try { replicaSyncUpManager.waitDeactivationCompleted(partitionName); } catch (InterruptedException e) { logger.error("Deactivation was interrupted on partition {}", partitionName); throw new StateTransitionException("Deactivation failed or was interrupted", StateTransitionException.TransitionErrorCode.DeactivationFailure); } catch (StateTransitionException e) { logger.error("Deactivation didn't complete on partition {}", partitionName, e); throw e; } } }

Target:
public void onPartitionBecomeInactiveFromStandby(String partitionName) { PartitionStateChangeListener storageManagerListener = partitionStateChangeListeners.get(StateModelListenerType.StorageManagerListener); if (storageManagerListener != null) { storageManagerListener.onPartitionBecomeInactiveFromStandby(partitionName); } PartitionStateChangeListener replicationManagerListener = partitionStateChangeListeners.get(StateModelListenerType.ReplicationManagerListener); if (replicationManagerListener != null) { replicationManagerListener.onPartitionBecomeInactiveFromStandby(partitionName); try { replicaSyncUpManager.waitDeactivationCompleted(partitionName); } catch (InterruptedException e) { logger.error("Deactivation was interrupted on partition {}", partitionName); throw new StateTransitionException("Deactivation failed or was interrupted", DeactivationFailure); } catch (StateTransitionException e) { logger.error("Deactivation didn't complete on partition {}", partitionName, e); throw e; } } }
Source:
public static int getContentLength(String message) { String[] messageLines = message.split("\n"); int lenght = 0; int i = 0; while (i < messageLines.length - 1) { String currentLine = messageLines[++i]; while (currentLine.length() > 0) { currentLine = messageLines[++i]; } i++; StringBuilder content = new StringBuilder(); String endLine = null; for (int k = i; k < messageLines.length; k++, i++) { String line = messageLines[k]; if (line.contains(END_OF_MESSAGE)) { int idx = line.indexOf(END_OF_MESSAGE); content.append(line.substring(0, idx)); endLine = line.substring(idx + 1, line.length()); break; } else { content.append(line); } } lenght += content.length(); if (!isEmpty(endLine)) { messageLines[i] = endLine; } else { i++; } } return lenght; }

Target:
public static int getContentLength(String message) { String[] messageLines = message.split("\n"); int length = 0; int i = 0; while (i < messageLines.length - 1) { String currentLine = messageLines[++i]; while (currentLine.length() > 0) { currentLine = messageLines[++i]; } i++; StringBuilder content = new StringBuilder(); String endLine = null; for (int k = i; k < messageLines.length; k++, i++) { String line = messageLines[k]; if (line.contains(END_OF_MESSAGE)) { int idx = line.indexOf(END_OF_MESSAGE); content.append(line.substring(0, idx)); endLine = line.substring(idx + 1, line.length()); break; } else { content.append(line); } } length += content.length(); if (!isEmpty(endLine)) { messageLines[i] = endLine; } else { i++; } } return length; }
Source:
public String toString(){ for (Entity entity : entities){ if (!entity.isPassable()) return entity.toString(); } for (Entity entity : entities){ return entity.toString(); } return " "; }

Target:
public String toString(){ if (!isPassable()) return impassableEntity.toString(); return passableEntities.isEmpty() ? EMPTY_SQUARE_SYMBOL : passableEntities.iterator().next().toString(); }
Source:
public void run() { try { if(prjSave == null) { String remoteServices = fConn.getSshSettings().getRemoteServices(); IRemoteServices services = RemoteServices.getRemoteServices(remoteServices); if (services != null) { IRemoteConnectionManager connMgr = services.getConnectionManager(); if (connMgr != null) { fRemoteConnection = connMgr.getConnection(fConn.getSshSettings().getConnectionName()); } } } else { fRemoteConnection = Util.getRemoteConnection(prjSave); } if (fRemoteConnection != null && !fRemoteConnection.isOpen()) { try { fRemoteConnection.open(null); } catch (RemoteConnectionException e) { Activator.log(e); } } if(fRemoteConnection != null && fRemoteConnection.isOpen()) { TerminalPlugin plugin = TerminalPlugin.getDefault(); IPreferenceStore preferenceStore = plugin.getPreferenceStore(); setupHistoryMonitoring(fConn, preferenceStore); try { readDataForever(fConn.getInputStream()); } catch (InterruptedIOException e) { } } } catch (IOException e) { fControl.setState(TerminalState.CLOSED); } finally { try { disconnect(); } finally { fControl.setState(TerminalState.CLOSED); } } }

Target:
public void run() { try { fProject = fConn.getProject(); if (fProject == null) { String remoteServices = fConn.getSshSettings().getRemoteServices(); IRemoteServices services = RemoteServices.getRemoteServices(remoteServices); if (services != null) { IRemoteConnectionManager connMgr = services.getConnectionManager(); if (connMgr != null) { fRemoteConnection = connMgr.getConnection(fConn.getSshSettings().getConnectionName()); } } } else { fRemoteConnection = Util.getRemoteConnection(fProject); } if (fRemoteConnection != null && !fRemoteConnection.isOpen()) { try { fRemoteConnection.open(null); } catch (RemoteConnectionException e) { Activator.log(e); } } if (fRemoteConnection != null && fRemoteConnection.isOpen()) { TerminalPlugin plugin = TerminalPlugin.getDefault(); IPreferenceStore preferenceStore = plugin.getPreferenceStore(); setupHistoryMonitoring(fConn, preferenceStore); try { readDataForever(fConn.getInputStream()); } catch (InterruptedIOException e) { } } } catch (IOException e) { fControl.setState(TerminalState.CLOSED); } finally { try { disconnect(); } finally { fControl.setState(TerminalState.CLOSED); } } }
Source:
public void compute(Iterator<MessageWritable> msgIterator) throws Exception { initVertex(); if (getSuperstep() == 1 && startSeeds.contains(getVertexId())) { markSelfAndBroadcast(); } else if (getSuperstep() <= numOfHops + 1 && msgIterator.hasNext()) { markSelfAndBroadcast(); } voteToHalt(); }

Target:
public void compute(Iterator<MessageWritable> msgIterator) throws Exception { initVertex(); if ((getSuperstep() == 1 && startSeeds.contains(getVertexId())) || (getSuperstep() <= numOfHops + 1 && msgIterator.hasNext())) { markSelfAndBroadcast(); } voteToHalt(); }
Source:
public static KeyPair loadKey(String pemString, String passwd) throws IOException, GeneralSecurityException { return SecurityUtils.loadKeyPairIdentity("key", new ByteArrayInputStream(pemString.getBytes("UTF-8")), FilePasswordProvider.of(passwd)); }

Target:
public static KeyPair loadKey(String pemString, String passwd) throws IOException, GeneralSecurityException { return SecurityUtils.loadKeyPairIdentity("key", new ByteArrayInputStream(pemString.getBytes(UTF_8)), FilePasswordProvider.of(passwd)); }
Source:
public void addMissingMessageIDs(String namespace, Set<String> messageIDs) { Set<String> alreadyPresent = dataService.findAll(L10N_STRING, new QueryImpl<L10nString>().in(MSGID, messageIDs).and().eq(NAMESPACE, namespace), L10nString.class) .map(L10nString::getMessageID) .collect(toCollection(TreeSet::new)); Set<String> toAdd = Sets.difference(messageIDs, alreadyPresent); if (!toAdd.isEmpty()) { Stream<L10nString> entities = toAdd.stream() .map(key -> l10nStringFactory.create() .setMessageID(key) .setNamespace(namespace)); dataService.add(L10N_STRING, entities); LOG.debug("Added message IDs to namespace '{}' : {}.", namespace, messageIDs); } }

Target:
public void addMissingMessageIDs(String namespace, Set<String> messageIDs) { Set<String> alreadyPresent = dataService.findAll(L10N_STRING, new QueryImpl<L10nString>().in(MSGID, messageIDs).and().eq(NAMESPACE, namespace), L10nString.class) .map(L10nString::getMessageID) .collect(toCollection(TreeSet::new)); Set<String> toAdd = Sets.difference(messageIDs, alreadyPresent); if (!toAdd.isEmpty()) { Stream<L10nString> entities = toAdd.stream() .map(key -> l10nStringFactory.create() .setMessageID(key) .setNamespace(namespace)); try { dataService.add(L10N_STRING, entities); LOG.debug("Added message IDs to namespace '{}' : {}.", namespace, messageIDs); } catch (EntityTypePermissionException ex) { LOG.info("No permission to add message IDs to namespace '{}' : {}.", namespace, messageIDs, ex); } } }
Source:
private Optional<VM> chooseNextVmToMigrateFromVMsToHostsAffinity(Cluster cluster, List<AffinityGroup> allAffinityGroups) { List<AffinityGroup> allVMtoHostsAffinityGroups = getAllAffinityGroupsForVMsToHostsAffinity(allAffinityGroups); if (allVMtoHostsAffinityGroups.isEmpty()) { return Optional.empty(); } Map<Guid, VM> vmsMap = getVMsMap(allVMtoHostsAffinityGroups); List<Guid> candidateVMsPositiveEnforcingAffinity = getCandidatesFromVMtoHostsAffinity(allVMtoHostsAffinityGroups, vmsMap, true, true); List<Guid> candidateVMsNegativeEnforcingAffinity = getCandidatesFromVMtoHostsAffinity(allVMtoHostsAffinityGroups, vmsMap, false, true); List<Guid> candidateVMsPositiveNonEnforcingAffinity = getCandidatesFromVMtoHostsAffinity(allVMtoHostsAffinityGroups, vmsMap, true, false); List<Guid> candidateVMsNegativeNonEnforcingAffinity = getCandidatesFromVMtoHostsAffinity(allVMtoHostsAffinityGroups, vmsMap, false, false); List<Guid> candidatesVMs = new ArrayList<>(); candidatesVMs.addAll(candidateVMsPositiveEnforcingAffinity); candidatesVMs.addAll(candidateVMsNegativeEnforcingAffinity); candidatesVMs.addAll(candidateVMsPositiveNonEnforcingAffinity); candidatesVMs.addAll(candidateVMsNegativeNonEnforcingAffinity); if (!candidatesVMs.isEmpty()) { log.info("vm to hosts affinity group violation detected"); } for (Guid id : candidatesVMs) { VM canidateVM = vmsMap.get(id); if (isVmMigrationValid(cluster, canidateVM)) { return Optional.of(canidateVM); } } return Optional.empty(); }

Target:
private Optional<VM> chooseNextVmToMigrateFromVMsToHostsAffinity(Cluster cluster, List<AffinityGroup> allAffinityGroups) { List<AffinityGroup> allVmToHostsAffinityGroups = getAllAffinityGroupsForVMsToHostsAffinity(allAffinityGroups); if (allVmToHostsAffinityGroups.isEmpty()) { return Optional.empty(); } Map<Guid, VM> vmsMap = getVMsMap(allVmToHostsAffinityGroups); List<Guid> candidateVMsPositiveEnforcingAffinity = getVmToHostsAffinityGroupCandidates(allVmToHostsAffinityGroups, vmsMap, true, true); List<Guid> candidateVMsNegativeEnforcingAffinity = getVmToHostsAffinityGroupCandidates(allVmToHostsAffinityGroups, vmsMap, false, true); List<Guid> candidateVMsPositiveNonEnforcingAffinity = getVmToHostsAffinityGroupCandidates(allVmToHostsAffinityGroups, vmsMap, true, false); List<Guid> candidateVMsNegativeNonEnforcingAffinity = getVmToHostsAffinityGroupCandidates(allVmToHostsAffinityGroups, vmsMap, false, false); List<Guid> candidateVMs = new ArrayList<>(); candidateVMs.addAll(candidateVMsPositiveEnforcingAffinity); candidateVMs.addAll(candidateVMsNegativeEnforcingAffinity); candidateVMs.addAll(candidateVMsPositiveNonEnforcingAffinity); candidateVMs.addAll(candidateVMsNegativeNonEnforcingAffinity); if (!candidateVMs.isEmpty()) { log.info("vm to hosts affinity group violation detected"); } for (Guid id : candidateVMs) { VM candidateVM = vmsMap.get(id); if (isVmMigrationValid(cluster, candidateVM)) { return Optional.of(candidateVM); } } return Optional.empty(); }
Source:
public void testUpdateDeviceStatsPermission() throws Exception { TrafficStats.setThreadStatsTag(0); TrafficStats.setThreadStatsUid( 0); Socket socket = new Socket("example.com", 80); TrafficStats.tagSocket(socket); final int byteCount = 1024; socket.setTcpNoDelay(true); OutputStream out = socket.getOutputStream(); byte[] buf = new byte[byteCount]; final long uidTxBytesBefore = TrafficStats.getUidTxBytes(Process.myUid()); out.write(buf); out.close(); socket.close(); long uidTxBytesAfter = TrafficStats.getUidTxBytes(Process.myUid()); long uidTxDeltaBytes = uidTxBytesAfter - uidTxBytesBefore; assertTrue("uidtxb: " + uidTxBytesBefore + " -> " + uidTxBytesAfter + " delta=" + uidTxDeltaBytes + " >= " + byteCount, uidTxDeltaBytes >= byteCount); final int UNSUPPORTED = -1; assertEquals(UNSUPPORTED, TrafficStats.getUidRxBytes( 0)); }

Target:
public void testUpdateDeviceStatsPermission() throws Exception { TrafficStats.setThreadStatsTag(0); TrafficStats.setThreadStatsUid( 0); Socket socket = new Socket("example.com", 80); TrafficStats.tagSocket(socket); final int byteCount = 1024; socket.setTcpNoDelay(true); socket.setSoLinger(true, 0); OutputStream out = socket.getOutputStream(); byte[] buf = new byte[byteCount]; final long uidTxBytesBefore = TrafficStats.getUidTxBytes(Process.myUid()); out.write(buf); out.close(); socket.close(); long uidTxBytesAfter = TrafficStats.getUidTxBytes(Process.myUid()); long uidTxDeltaBytes = uidTxBytesAfter - uidTxBytesBefore; assertTrue("uidtxb: " + uidTxBytesBefore + " -> " + uidTxBytesAfter + " delta=" + uidTxDeltaBytes + " >= " + byteCount, uidTxDeltaBytes >= byteCount); }
Source:
public StockSaver(final HibernateSessionProvider sessionProviderForLocal) { super(sessionProviderForLocal); this.studyGermplasmListService = new StudyGermplasmListServiceImpl(sessionProviderForLocal); }

Target:
public StockSaver(final HibernateSessionProvider sessionProviderForLocal) { super(sessionProviderForLocal); }
Source:
public boolean matches(Attribute<?> other) { if (!this.definition.equals(other.definition)) return false; if (!this.definition.isLocal()) return value.equals(other.value); return true; }

Target:
public boolean matches(Attribute<?> other) { if (other == null) return false; if (!this.definition.equals(other.definition)) return false; if (this.definition.isGlobal()) return value.equals(other.value); return true; }
Source:
public void handleHealthStatusResponse(final GetHealthStatusResponseDto getHealthStatusResponseDto, final String deviceIdentification, final String organisationIdentification, final String correlationUid, final String messageType, final ResponseMessageResultType responseMessageResultType, final OsgpException osgpException) { LOGGER.info("handleResponse for MessageType: {}", messageType); ResponseMessageResultType result = ResponseMessageResultType.OK; GetHealthStatusResponse getHealthStatusResponse = null; OsgpException exception = null; try { if (responseMessageResultType == ResponseMessageResultType.NOT_OK || osgpException != null) { LOGGER.error("Device Response not ok.", osgpException); throw osgpException; } this.handleResponseMessageReceived(LOGGER, deviceIdentification); getHealthStatusResponse = this.mapper.map(getHealthStatusResponseDto, GetHealthStatusResponse.class); } catch (final Exception e) { LOGGER.error("Unexpected Exception", e); result = ResponseMessageResultType.NOT_OK; exception = this.ensureOsgpException(e, "Exception occurred while getting Health Status Response Data"); } this.webServiceResponseMessageSender.send(ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(correlationUid).withOrganisationIdentification(organisationIdentification) .withDeviceIdentification(deviceIdentification).withResult(result).withOsgpException(exception) .withDataObject(getHealthStatusResponse).build(), messageType); }

Target:
public void handleHealthStatusResponse(final GetHealthStatusResponseDto getHealthStatusResponseDto, final String deviceIdentification, final String organisationIdentification, final String correlationUid, final String messageType, final ResponseMessageResultType responseMessageResultType, final OsgpException osgpException) { LOGGER.info("handleResponse for MessageType: {}", messageType); ResponseMessageResultType result = ResponseMessageResultType.OK; GetHealthStatusResponse getHealthStatusResponse = null; OsgpException exception = null; try { if (responseMessageResultType == ResponseMessageResultType.NOT_OK || osgpException != null) { LOGGER.error("Device Response not ok.", osgpException); throw osgpException; } this.handleResponseMessageReceived(LOGGER, deviceIdentification); getHealthStatusResponse = this.mapper.map(getHealthStatusResponseDto, GetHealthStatusResponse.class); } catch (final Exception e) { LOGGER.error("Unexpected Exception", e); result = ResponseMessageResultType.NOT_OK; exception = this.ensureOsgpException(e, "Exception occurred while getting Health Status Response Data"); } ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(correlationUid).withOrganisationIdentification(organisationIdentification) .withDeviceIdentification(deviceIdentification).withResult(result).withOsgpException(exception) .withDataObject(getHealthStatusResponse).build(); this.webServiceResponseMessageSender.send(responseMessage, messageType); }
Source:
public Result isUTF16(byte[] buffer, boolean failOnNull) { if (buffer.length < 2) { return Result.newInvalid(); } int beAscii = 0; int beLines = 0; int leAscii = 0; int leLines = 0; for (int i = 0; i < buffer.length / 2; i++) { byte c1 = buffer[i * 2]; byte c2 = buffer[i * 2 + 1]; if (c1 == 0) { if (c2 != 0) { if (c2 == 0x0a || c2 == 0x0d) { beLines++; } beAscii++; } else if (failOnNull) { return Result.newInvalid(); } } else if (c2 == 0) { leAscii++; if (c1 == 0x0a || c1 == 0x0d) { leLines++; } } } float beAsciiPerc = beAscii * 2.0f / (float) buffer.length; float leAsciiPerc = leAscii * 2.0f / (float) buffer.length; if (leLines == 0) { if (beAsciiPerc >= UTF_16_NULL_PASS_THRESHOLD && leAsciiPerc < UTF_16_NULL_FAIL_THRESHOLD) { return Result.newValid(StandardCharsets.UTF_16BE); } if (beLines > 0) { return Result.newValid(StandardCharsets.UTF_16BE); } } else if (beLines > 0) { return Result.newInvalid(); } if (beLines == 0) { if (leAsciiPerc >= UTF_16_NULL_PASS_THRESHOLD && beAsciiPerc < UTF_16_NULL_FAIL_THRESHOLD) { return Result.newValid(StandardCharsets.UTF_16LE); } if (leLines > 0) { return Result.newValid(StandardCharsets.UTF_16LE); } } return new Result(Valid.MAYBE, null); }

Target:
public Result isUTF16(byte[] buffer, boolean failOnNull) { if (buffer.length < 2) { return Result.INVALID; } int beAscii = 0; int beLines = 0; int leAscii = 0; int leLines = 0; for (int i = 0; i < buffer.length / 2; i++) { byte c1 = buffer[i * 2]; byte c2 = buffer[i * 2 + 1]; if (c1 == 0) { if (c2 != 0) { if (c2 == 0x0a || c2 == 0x0d) { beLines++; } beAscii++; } else if (failOnNull) { return Result.INVALID; } } else if (c2 == 0) { leAscii++; if (c1 == 0x0a || c1 == 0x0d) { leLines++; } } } float beAsciiPerc = beAscii * 2.0f / (float) buffer.length; float leAsciiPerc = leAscii * 2.0f / (float) buffer.length; if (leLines == 0) { if (beAsciiPerc >= UTF_16_NULL_PASS_THRESHOLD && leAsciiPerc < UTF_16_NULL_FAIL_THRESHOLD) { return Result.newValid(StandardCharsets.UTF_16BE); } if (beLines > 0) { return Result.newValid(StandardCharsets.UTF_16BE); } } else if (beLines > 0) { return Result.INVALID; } if (beLines == 0) { if (leAsciiPerc >= UTF_16_NULL_PASS_THRESHOLD && beAsciiPerc < UTF_16_NULL_FAIL_THRESHOLD) { return Result.newValid(StandardCharsets.UTF_16LE); } if (leLines > 0) { return Result.newValid(StandardCharsets.UTF_16LE); } } return new Result(Validation.MAYBE, null); }
Source:
public boolean engineIsKeyEntry(String alias) { Attributes attributes = obtainAliasOrCertificateAttributes(alias, null, new String[]{keyAttribute}); Attribute attribute = attributes == null ? null : LdapUtil.getBinaryAttribute(attributes, keyAttribute); if (attribute == null) { log.tracef("Alias [%s] is not key entry", alias); return engineIsCertificateEntry(alias); } try { byte[] bytes = (byte[]) attribute.get(); return bytes != null; } catch (NamingException e) { throw log.ldapKeyStoreFailedToObtainKey(alias, e); } }

Target:
public boolean engineIsKeyEntry(String alias) { Attributes attributes = obtainAliasOrCertificateAttributes(alias, null, new String[]{keyAttribute}); Attribute attribute = attributes == null ? null : LdapUtil.getBinaryAttribute(attributes, keyAttribute); if (attribute == null) { log.tracef("Alias [%s] is not key entry", alias); return false; } try { byte[] bytes = (byte[]) attribute.get(); return bytes != null; } catch (NamingException e) { throw log.ldapKeyStoreFailedToObtainKey(alias, e); } }
Source:
public Chain get(long key) { Lock lock = getLock(key).readLock(); try { lock.lock(); Chain chain = map.get(key); if (chain != null) { return chain; } else { return new HeapChainImpl(); } } finally { lock.unlock(); } }

Target:
public Chain get(long key) { Lock lock = getLock(key).readLock(); lock.lock(); try { Chain chain = map.get(key); if (chain != null) { return chain; } else { return new HeapChainImpl(); } } finally { lock.unlock(); } }
Source:
public void onItemUse(PlayerInteractEvent.RightClickBlock event) { EntityPlayer player = event.getEntityPlayer(); World world = player.worldObj; if (Game.isClient(world)) return; ItemStack itemStack = event.getItemStack(); if (itemStack != null) { Item item = itemStack.getItem(); if (item != null && CartTools.vanillaCartItemMap.containsKey(item)) { event.setUseItem(Event.Result.DENY); EntityMinecart placedCart = CartTools.placeCart( CartTools.vanillaCartItemMap.get(item), player.getGameProfile(), itemStack, world, event.getPos()); if (placedCart != null && !player.capabilities.isCreativeMode) dec(itemStack); } } }

Target:
public void onItemUse(PlayerInteractEvent.RightClickBlock event) { EntityPlayer player = event.getEntityPlayer(); World world = player.worldObj; if (Game.isClient(world)) return; ItemStack itemStack = event.getItemStack(); if (!isEmpty(itemStack)) { Item item = itemStack.getItem(); if (CartTools.vanillaCartItemMap.containsKey(item)) { event.setUseItem(Event.Result.DENY); EntityMinecart placedCart = CartTools.placeCart( CartTools.vanillaCartItemMap.get(item), player.getGameProfile(), itemStack, world, event.getPos()); if (placedCart != null && !player.capabilities.isCreativeMode) dec(itemStack); } } }
Source:
void testResetReadBufferManager() { synchronized (this) { ArrayList<ReadBuffer> completedBuffers = new ArrayList<>(); for (ReadBuffer buf : completedReadList) { if (buf != null) { completedBuffers.add(buf); } } for (ReadBuffer buf : completedBuffers) { evict(buf); } readAheadQueue.clear(); inProgressList.clear(); completedReadList.clear(); freeList.clear(); buffers = new byte[NUM_BUFFERS][]; for (int i = 0; i < NUM_BUFFERS; i++) { buffers[i] = null; } buffers = null; resetBufferManager(); } }

Target:
void testResetReadBufferManager() { synchronized (this) { ArrayList<ReadBuffer> completedBuffers = new ArrayList<>(); for (ReadBuffer buf : completedReadList) { if (buf != null) { completedBuffers.add(buf); } } for (ReadBuffer buf : completedBuffers) { evict(buf); } readAheadQueue.clear(); inProgressList.clear(); completedReadList.clear(); freeList.clear(); for (int i = 0; i < NUM_BUFFERS; i++) { buffers[i] = null; } buffers = null; resetBufferManager(); } }
Source:
public void registerMBean(Object mbean, ObjectName objectName) throws JMException { try { mbeanServer.registerMBean(mbean, objectName); } catch (final InstanceAlreadyExistsException ex) { if (registrationBehaviour == REGISTRATION_IGNORE_EXISTING) { if (log.isDebugEnabled()) { log.debug("Ignoring existing MBean at [{}]", objectName); } } else if (registrationBehaviour == REGISTRATION_REPLACE_EXISTING) { try { if (log.isDebugEnabled()) { log.debug("Replacing existing MBean at [{}]", objectName); } mbeanServer.unregisterMBean(objectName); mbeanServer.registerMBean(mbean, objectName); } catch (final InstanceNotFoundException ex2) { log.error("Unable to replace existing MBean at [" + objectName + "]", ex2); throw ex; } } else { throw ex; } } }

Target:
public void registerMBean(Object mbean, ObjectName objectName) throws JMException { try { mbeanServer.registerMBean(mbean, objectName); } catch (final InstanceAlreadyExistsException ex) { if (registrationBehaviour == REGISTRATION_IGNORE_EXISTING) { log.debug("Ignoring existing MBean at [{}]", objectName); } else if (registrationBehaviour == REGISTRATION_REPLACE_EXISTING) { try { log.debug("Replacing existing MBean at [{}]", objectName); mbeanServer.unregisterMBean(objectName); mbeanServer.registerMBean(mbean, objectName); } catch (final InstanceNotFoundException ex2) { log.error("Unable to replace existing MBean at [" + objectName + "]", ex2); throw ex; } } else { throw ex; } } }
Source:
private static Options createCommandLineOptions() { Options options = new Options(); options.addOption( builder(HELP_OPTION) .longOpt("help") .desc("Print the usage of the script") .hasArg(false) .build() ); options.addOption( builder(SLEEP_OPTION) .longOpt("sleep") .desc("Sleep a certain time between each solr request") .hasArg(true) .build() ); options.addOption( builder(BATCH_SIZE_OPTION) .longOpt("batch") .desc("The amount of Solr records to be processed per batch (defaults to 100)") .hasArg(true) .build() ); options.addOption( builder(THREADS_OPTION) .longOpt("threads") .desc("The amount of threads used by the script (defaults to 2") .hasArg(true) .build() ); return options; }

Target:
private static Options createCommandLineOptions() { Options options = new Options(); options.addOption( builder(HELP_OPTION) .longOpt("help") .desc("Print the usage of the script") .hasArg(false) .build() ); options.addOption( builder(SLEEP_OPTION) .longOpt("sleep") .desc("Sleep a certain time given in milliseconds between each solr request") .hasArg(true) .build() ); options.addOption( builder(BATCH_SIZE_OPTION) .longOpt("batch") .desc("The amount of Solr records to be processed per batch (defaults to 100)") .hasArg(true) .build() ); options.addOption( builder(THREADS_OPTION) .longOpt("threads") .desc("The amount of threads used by the script (defaults to 2") .hasArg(true) .build() ); return options; }
Source:
public Builder snapshotFilter(Predicate<? super DomainEventData<?>> snapshotFilter) { snapshotFilter(snapshotFilter::test); return this; }

Target:
public Builder snapshotFilter(Predicate<? super DomainEventData<?>> snapshotFilter) { return snapshotFilter(snapshotFilter::test); }