auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private boolean validateId( String fieldName, ModelProblemCollector problems, Severity severity, Version version, String id, String sourceHint, InputLocationTracker tracker ) { if ( !validateStringNotEmpty( fieldName, problems, severity, version, id, sourceHint, tracker ) ) { return false; } else { if ( !org.apache.commons.lang3.StringUtils.containsOnly( id, ID_CHARS ) ) { addViolation( problems, severity, version, fieldName, sourceHint, "with value '" + id + "' does not match a valid id pattern.", tracker ); return false; } return true; } }

Target:
private boolean validateId( String fieldName, ModelProblemCollector problems, Severity severity, Version version, String id, String sourceHint, InputLocationTracker tracker ) { if ( !validateStringNotEmpty( fieldName, problems, severity, version, id, sourceHint, tracker ) ) { return false; } else { if ( !isValidId( id ) ) { addViolation( problems, severity, version, fieldName, sourceHint, "with value '" + id + "' does not match a valid id pattern.", tracker ); return false; } return true; } }
Source:
private HashMap<UUID, Object> readMapFromJson() throws FileNotFoundException { Type mapType = new TypeToken<HashMap<UUID, Object>>() {}.getType(); return new Gson().fromJson(new FileReader(deviceVariablesFile), mapType); }

Target:
public HashMap<UUID, Object> readMapFromJson() { try { Type mapType = new TypeToken<HashMap<UUID, Object>>() {}.getType(); return new Gson().fromJson(new FileReader(deviceVariablesFile), mapType); } catch (FileNotFoundException e) { if (deviceVariablesFile.exists()) { Log.e(TAG, "Device Variable File corrupted!"); deviceVariablesFile.delete(); } return null; } }
Source:
public void shouldUnStagePartialChangeInCompareEditor() throws Exception { resetRepositoryToCreateInitialTag(); changeFilesInProject(); launchSynchronization(HEAD, HEAD, true); setGitChangeSetPresentationModel(); getCompareEditorForFileInGitChangeSet(FILE1, true).bot(); Display.getDefault().syncExec(new Runnable() { public void run() { CommonUtils.runCommand("org.eclipse.compare.copyRightToLeft", null); } }); bot.activeEditor().save(); FileRepository repo = lookupRepository(repositoryFile); Status status = new Git(repo).status().call(); assertThat(status.getModified().size(), is(1)); assertThat(status.getModified().iterator().next(), is(PROJ1 + "/" + FOLDER + "/" + FILE2)); }

Target:
public void shouldUnStagePartialChangeInCompareEditor() throws Exception { resetRepositoryToCreateInitialTag(); changeFilesInProject(); launchSynchronization(HEAD, HEAD, true); setGitChangeSetPresentationModel(); getCompareEditorForFileInGitChangeSet(FILE1, true).bot(); Display.getDefault().syncExec(new Runnable() { public void run() { CommonUtils.runCommand("org.eclipse.compare.copyRightToLeft", null); } }); bot.activeEditor().save(); FileRepository repo = lookupRepository(repositoryFile); Status status = new Git(repo).status().call(); assertThat(Long.valueOf(status.getModified().size()), is(Long.valueOf(1))); assertThat(status.getModified().iterator().next(), is(PROJ1 + "/" + FOLDER + "/" + FILE2)); }
Source:
public void registerProtofiles(@Parameter(name = "fileNames", description = "names of the protofiles") String[] names, @Parameter(name = "fileContents", description = "content of the files") String[] contents) throws Exception { if (names.length != contents.length) throw new MBeanException(new IllegalArgumentException("invalid parameter sizes")); for (int i = 0; i < names.length; i++) { clusterRegistry.put(REGISTRY_SCOPE, names[i], contents[i]); } compile(); }

Target:
public void registerProtofiles(@Parameter(name = "fileNames", description = "names of the protofiles") String[] names, @Parameter(name = "fileContents", description = "content of the files") String[] contents) throws Exception { if (names.length != contents.length) throw new MBeanException(new IllegalArgumentException("invalid parameter sizes")); FileDescriptorSource fileDescriptorSource = getFileDescriptorSource(); for (int i = 0; i < names.length; i++) { fileDescriptorSource.addProtoFile(names[i], contents[i]); } clusterRegistry.put(REGISTRY_SCOPE, REGISTRY_KEY, fileDescriptorSource); }
Source:
void tick() { final Object[] observers = this.observers; if (observers == null) { return; } if (counter.getAndIncrement() == 0) { final int length = observers.length; final Observer<? super R> child = this.child; final AtomicLong requested = this.requested; do { while (true) { final Object[] vs = new Object[length]; boolean allHaveValues = true; for (int i = 0; i < length; i++) { RxRingBuffer buffer = ((InnerSubscriber) observers[i]).items; Object n = buffer.peek(); if (n == null) { allHaveValues = false; continue; } if (buffer.isCompleted(n)) { child.onCompleted(); childSubscription.unsubscribe(); return; } else { vs[i] = buffer.getValue(n); } } if (requested.get() > 0 && allHaveValues) { try { child.onNext(zipFunction.call(vs)); requested.decrementAndGet(); emitted++; } catch (Throwable e) { Exceptions.throwOrReport(e, child, vs); return; } for (Object obj : observers) { RxRingBuffer buffer = ((InnerSubscriber) obj).items; buffer.poll(); if (buffer.isCompleted(buffer.peek())) { child.onCompleted(); childSubscription.unsubscribe(); return; } } if (emitted > THRESHOLD) { for (Object obj : observers) { ((InnerSubscriber) obj).requestMore(emitted); } emitted = 0; } } else { break; } } } while (counter.decrementAndGet() > 0); } }

Target:
void tick() { final Object[] observers = this.observers; if (observers == null) { return; } if (getAndIncrement() == 0) { final int length = observers.length; final Observer<? super R> child = this.child; final AtomicLong requested = this.requested; do { while (true) { final Object[] vs = new Object[length]; boolean allHaveValues = true; for (int i = 0; i < length; i++) { RxRingBuffer buffer = ((InnerSubscriber) observers[i]).items; Object n = buffer.peek(); if (n == null) { allHaveValues = false; continue; } if (buffer.isCompleted(n)) { child.onCompleted(); childSubscription.unsubscribe(); return; } else { vs[i] = buffer.getValue(n); } } if (requested.get() > 0 && allHaveValues) { try { child.onNext(zipFunction.call(vs)); requested.decrementAndGet(); emitted++; } catch (Throwable e) { Exceptions.throwOrReport(e, child, vs); return; } for (Object obj : observers) { RxRingBuffer buffer = ((InnerSubscriber) obj).items; buffer.poll(); if (buffer.isCompleted(buffer.peek())) { child.onCompleted(); childSubscription.unsubscribe(); return; } } if (emitted > THRESHOLD) { for (Object obj : observers) { ((InnerSubscriber) obj).requestMore(emitted); } emitted = 0; } } else { break; } } } while (decrementAndGet() > 0); } }
Source:
public void doWork() throws Exception { try ( Connection cx = maxwellConnectionPool.getConnection() ) { cx.setAutoCommit(false); try { if (getLock(cx)) { compact(cx); } } finally { releaseLock(cx); } } }

Target:
public void doWork() throws Exception { try ( Connection cx = maxwellConnectionPool.getConnection() ) { cx.setAutoCommit(false); try { if (getLock(cx)) { compact(cx); } } finally { cx.setAutoCommit(true); releaseLock(cx); } } }
Source:
private boolean clearAll(CommandSender sender, Player player, Material material, int data, int maxCount, ResourceBundle resourceBundle) { int count = countAllItems(player.getInventory(), material, data, maxCount); if (maxCount == 0) { new LocalizedStringImpl("clear.count", resourceBundle).send( sender, player.getName(), count); return true; } if (count == 0) { new LocalizedStringImpl("clear.empty", resourceBundle).send( sender, player.getName()); return false; } if (material == null) { player.getInventory().clear(); } else { int remaining = maxCount; for (ItemStack stack : player.getInventory().getContents()) { if (stack.getType() == material && (data == -1 || data == stack.getData() .getData())) { if (maxCount == -1) { player.getInventory().remove(stack); } else { int oldAmount = stack.getAmount(); int removed = Math.min(oldAmount, remaining); stack.setAmount(oldAmount - removed); remaining -= removed; } } if (remaining == 0) { break; } } } new LocalizedStringImpl("clear.done", resourceBundle).send( sender, player.getName(), count); return true; }

Target:
private boolean clearAll(CommandSender sender, Player player, Material material, int data, int maxCount, ResourceBundle resourceBundle) { int count = countAllItems(player.getInventory(), material, data, maxCount); if (maxCount == 0) { new LocalizedStringImpl("clear.count", resourceBundle).send( sender, player.getName(), count); return true; } if (count == 0) { new LocalizedStringImpl("clear.empty", resourceBundle).send( sender, player.getName()); return false; } if (material == null) { player.getInventory().clear(); } else { int remaining = maxCount; for (ItemStack stack : player.getInventory().getContents()) { if (stack.getType() == material && (data == -1 || data == stack.getData() .getData())) { if (maxCount == -1) { player.getInventory().remove(stack); } else { int oldAmount = stack.getAmount(); int removed = Math.min(oldAmount, remaining); stack.setAmount(oldAmount - removed); remaining -= removed; } } if (remaining == 0) { break; } } } if (count == 1) { new LocalizedStringImpl("clear.done.singular", resourceBundle).send( sender, player.getName()); } else { new LocalizedStringImpl("clear.done", resourceBundle).send( sender, player.getName(), count); } return true; }
Source:
protected void executeCommand() { Cluster cluster = getCluster(); boolean initSucceeded = true; clusterCpuFlagsManager.updateClusterCpuFlags(); initHostKdumpDetectionStatus(); getVds().setPowerManagementControlledByPolicy(true); vdsDynamicDao.updateVdsDynamicPowerManagementPolicyFlag( getVds().getId(), getVds().isPowerManagementControlledByPolicy()); if (getVds().getHighlyAvailableIsConfigured()) { haMaintenanceFailed = !hostedEngineHelper.updateHaLocalMaintenanceMode(getVds(), false); } if (cluster.supportsTrustedService()) { initSucceeded = initTrustedService(); } if (initSucceeded && cluster.supportsVirtService()) { initSucceeded = initVirtResources(); } if (initSucceeded && cluster.supportsGlusterService()) { initSucceeded = glusterCommandHelper.initGlusterHost(getVds()); } setSucceeded(initSucceeded); if (getSucceeded()) { addCustomValue("HostStatus", getVds().getStatus().toString()); auditLogDirector.log(this, AuditLogType.VDS_DETECTED); } }

Target:
protected void executeCommand() { Cluster cluster = getCluster(); boolean initSucceeded = true; vdsDynamicDao.updateCpuFlags(getVds().getId(), getVds().getCpuFlags()); clusterCpuFlagsManager.updateClusterCpuFlags(getCluster()); initHostKdumpDetectionStatus(); getVds().setPowerManagementControlledByPolicy(true); vdsDynamicDao.updateVdsDynamicPowerManagementPolicyFlag( getVds().getId(), getVds().isPowerManagementControlledByPolicy()); if (getVds().getHighlyAvailableIsConfigured()) { haMaintenanceFailed = !hostedEngineHelper.updateHaLocalMaintenanceMode(getVds(), false); } if (cluster.supportsTrustedService()) { initSucceeded = initTrustedService(); } if (initSucceeded && cluster.supportsVirtService()) { initSucceeded = initVirtResources(); } if (initSucceeded && cluster.supportsGlusterService()) { initSucceeded = glusterCommandHelper.initGlusterHost(getVds()); } setSucceeded(initSucceeded); if (getSucceeded()) { addCustomValue("HostStatus", getVds().getStatus().toString()); auditLogDirector.log(this, AuditLogType.VDS_DETECTED); } }
Source:
private void updateActionAvailability() { GlusterVolumeEntity volumeEntity = getEntity(); boolean allowRemove = true; boolean allowReplace = true; boolean allowAdvanced = true; boolean allowAdd = true; if (volumeEntity == null || getSelectedItems() == null || getSelectedItems().size() == 0) { allowRemove = false; allowReplace = false; allowAdvanced = false; allowAdd = false; } else { GlusterAsyncTask volumeTask = volumeEntity.getAsyncTask(); if (volumeTask != null && (volumeTask.getStatus() == JobExecutionStatus.STARTED || volumeTask.getType() == GlusterTaskType.REMOVE_BRICK && volumeTask.getStatus() == JobExecutionStatus.FINISHED)) { allowRemove = false; } else if (volumeEntity.getVolumeType() == GlusterVolumeType.STRIPE || getSelectedItems().size() == volumeEntity.getBricks().size()) { allowRemove = false; } else if (volumeEntity.getVolumeType() == GlusterVolumeType.REPLICATE && (volumeEntity.getBricks().size() == VolumeListModel.REPLICATE_COUNT_DEFAULT || getSelectedItems().size() > 1)) { allowRemove = false; } else if (volumeEntity.getVolumeType() == GlusterVolumeType.DISPERSE) { allowRemove = false; allowAdd = false; } if (getSelectedItems().size() == 1) { allowReplace = true; allowAdvanced = volumeEntity.isOnline() && getSelectedItems().get(0).isOnline(); } else { allowReplace = false; allowAdvanced = false; } } getRemoveBricksCommand().setIsExecutionAllowed(allowRemove); getReplaceBrickCommand().setIsExecutionAllowed(allowReplace); getBrickAdvancedDetailsCommand().setIsExecutionAllowed(allowAdvanced); getAddBricksCommand().setIsExecutionAllowed(allowAdd); }

Target:
private void updateActionAvailability() { GlusterVolumeEntity volumeEntity = getEntity(); boolean allowRemove = true; boolean allowReplace = true; boolean allowAdvanced = true; boolean allowAdd = true; if (volumeEntity == null || getSelectedItems() == null || getSelectedItems().size() == 0) { allowRemove = false; allowReplace = false; allowAdvanced = false; allowAdd = false; } else { GlusterAsyncTask volumeTask = volumeEntity.getAsyncTask(); if (volumeTask != null && (volumeTask.getStatus() == JobExecutionStatus.STARTED || volumeTask.getType() == GlusterTaskType.REMOVE_BRICK && volumeTask.getStatus() == JobExecutionStatus.FINISHED)) { allowRemove = false; } else if (volumeEntity.getVolumeType() == GlusterVolumeType.STRIPE || getSelectedItems().size() == volumeEntity.getBricks().size()) { allowRemove = false; } else if (volumeEntity.getVolumeType() == GlusterVolumeType.REPLICATE && (volumeEntity.getBricks().size() == VolumeListModel.REPLICATE_COUNT_DEFAULT || getSelectedItems().size() > 1)) { allowRemove = false; } else if (volumeEntity.getVolumeType().isDispersedType()) { allowRemove = false; allowAdd = false; } if (getSelectedItems().size() == 1) { allowReplace = true; allowAdvanced = volumeEntity.isOnline() && getSelectedItems().get(0).isOnline(); } else { allowReplace = false; allowAdvanced = false; } } getRemoveBricksCommand().setIsExecutionAllowed(allowRemove); getReplaceBrickCommand().setIsExecutionAllowed(allowReplace); getBrickAdvancedDetailsCommand().setIsExecutionAllowed(allowAdvanced); getAddBricksCommand().setIsExecutionAllowed(allowAdd); }
Source:
public static <T> void assertCorrectPropertyPaths(Set<ConstraintViolation<T>> violations, String... propertyPaths) { List<String> propertyPathsOfViolations = new ArrayList<String>(); for ( ConstraintViolation<?> violation : violations ) { propertyPathsOfViolations.add( violation.getPropertyPath().toString() ); } assertEquals( propertyPathsOfViolations.size(), propertyPaths.length, "Wrong number of property paths." ); for ( String propertyPath : propertyPaths ) { if ( !propertyPathsOfViolations.contains( propertyPath ) ) { fail( propertyPath + " is not in the list of path instances contained in the actual constraint violations: " + propertyPathsOfViolations ); } } }

Target:
public static <T> void assertCorrectPropertyPaths(Set<ConstraintViolation<T>> violations, String... propertyPaths) { List<Path> propertyPathsOfViolations = new ArrayList<Path>(); for ( ConstraintViolation<?> violation : violations ) { propertyPathsOfViolations.add( violation.getPropertyPath() ); } assertEquals( propertyPathsOfViolations.size(), propertyPaths.length, "Wrong number of property paths." ); for ( String propertyPath : propertyPaths ) { Path expectedPath = PathImpl.createPathFromString( propertyPath ); boolean containsPath = false; for ( Path actualPath : propertyPathsOfViolations ) { if ( assertEqualPaths( expectedPath, actualPath ) ) { containsPath = true; break; } } if ( !containsPath ) { fail( expectedPath + " is not in the list of path instances contained in the actual constraint violations: " + propertyPathsOfViolations ); } } }
Source:
private String getCheckerVersion() { String version = null; Properties p = new Properties(); String RLS_FILE = "/docs/developer/release/release.properties"; p.putAll(getProperties(getClass(), RLS_FILE)); String startTag = p.getProperty("checkers.ver.0"); String endTag = p.getProperty("checkers.ver.1"); String XML_FILE = "/docs/examples/MavenExample/pom.xml"; try { InputStream in = getClass().getResourceAsStream(XML_FILE); BufferedReader reader = new BufferedReader(new InputStreamReader(in)); String line = null; while ((line = reader.readLine()) != null && version == null) { if (line.split(startTag).length > 1) { version = line.split(startTag)[1].split(endTag)[0]; } } } catch (IOException e) { System.out.println("IOException while reading version information: " + e.getMessage()); } return version; }

Target:
private String getCheckerVersion() { Properties gitProperties = getProperties(getClass(), "/git.properties"); String version = gitProperties.getProperty("git.build.version"); if (version != null) { return version; } throw new BugInCF("Could not find the version in git.properties"); }
Source:
protected List getFieldOrder() { return Arrays.asList(new String[] { "dwStructSize", "lpszSourceUrlName", "lpszLocalFileName", "CacheEntryType", "dwUseCount", "dwHitRate", "dwSizeLow", "dwSizeHigh", "LastModifiedTime", "ExpireTime", "LastAccessTime", "LastSyncTime", "lpHeaderInfo", "dwHeaderInfoSize", "lpszFileExtension", "u", "additional" }); }

Target:
protected List getFieldOrder() { return Arrays.asList("dwStructSize", "lpszSourceUrlName", "lpszLocalFileName", "CacheEntryType", "dwUseCount", "dwHitRate", "dwSizeLow", "dwSizeHigh", "LastModifiedTime", "ExpireTime", "LastAccessTime", "LastSyncTime", "lpHeaderInfo", "dwHeaderInfoSize", "lpszFileExtension", "u", "additional"); }
Source:
public ConfigMemorySize getMemorySize(String path) { BigInteger size; try { size = BigInteger.valueOf(getLong(path)); } catch (ConfigException.WrongType e) { ConfigValue v = find(path, ConfigValueType.STRING); size = parseBytesAsBigInteger((String) v.unwrapped(), v.origin(), path); } return ConfigMemorySize.ofBytes(size); }

Target:
public ConfigMemorySize getMemorySize(String path) { return ConfigMemorySize.ofBytes(getBytesBigInteger(path)); }
Source:
private Collection<Long> toList(TLongList values) { List<Long> result = Lists.newArrayListWithExpectedSize(values.size()); for (int i = 0; i < values.size(); i++) { result.add(values.get(i)); } return result; }

Target:
private Collection<Long> toList(TLongList values) { List<Long> result = Lists.newArrayListWithExpectedSize(values.size()); values.forEach(result::add); return result; }
Source:
public DiskProfile importVolume(Type type, String name, DiskOffering offering, Long size, Long minIops, Long maxIops, VirtualMachine vm, VirtualMachineTemplate template, Account owner, Long deviceId, Long poolId, String path, String chainInfo) { if (size == null) { size = offering.getDiskSize(); } else { size = (size * 1024 * 1024 * 1024); } minIops = minIops != null ? minIops : offering.getMinIops(); maxIops = maxIops != null ? maxIops : offering.getMaxIops(); VolumeVO vol = new VolumeVO(type, name, vm.getDataCenterId(), owner.getDomainId(), owner.getId(), offering.getId(), offering.getProvisioningType(), size, minIops, maxIops, null); if (vm != null) { vol.setInstanceId(vm.getId()); } if (deviceId != null) { vol.setDeviceId(deviceId); } else if (type.equals(Type.ROOT)) { vol.setDeviceId(0l); } else { vol.setDeviceId(1l); } if (template != null) { if (template.getFormat() == ImageFormat.ISO) { vol.setIsoId(template.getId()); } else if (template.getTemplateType().equals(Storage.TemplateType.DATADISK)) { vol.setTemplateId(template.getId()); } if (type == Type.ROOT) { vol.setTemplateId(template.getId()); } } if (vm.getType() == VirtualMachine.Type.User) { UserVmVO userVm = _userVmDao.findById(vm.getId()); vol.setDisplayVolume(userVm.isDisplayVm()); } vol.setFormat(getSupportedImageFormatForCluster(vm.getHypervisorType())); vol.setPoolId(poolId); vol.setPath(path); vol.setChainInfo(chainInfo); vol.setState(Volume.State.Ready); vol = _volsDao.persist(vol); return toDiskProfile(vol, offering); }

Target:
public DiskProfile importVolume(Type type, String name, DiskOffering offering, Long size, Long minIops, Long maxIops, VirtualMachine vm, VirtualMachineTemplate template, Account owner, Long deviceId, Long poolId, String path, String chainInfo) { if (size == null) { size = offering.getDiskSize(); } else { size = (size * 1024 * 1024 * 1024); } minIops = minIops != null ? minIops : offering.getMinIops(); maxIops = maxIops != null ? maxIops : offering.getMaxIops(); VolumeVO vol = new VolumeVO(type, name, vm.getDataCenterId(), owner.getDomainId(), owner.getId(), offering.getId(), offering.getProvisioningType(), size, minIops, maxIops, null); if (vm != null) { vol.setInstanceId(vm.getId()); } if (deviceId != null) { vol.setDeviceId(deviceId); } else if (type.equals(Type.ROOT)) { vol.setDeviceId(0l); } else { vol.setDeviceId(1l); } if (template != null) { if (ImageFormat.ISO.equals(template.getFormat())) { vol.setIsoId(template.getId()); } else if (Storage.TemplateType.DATADISK.equals(template.getTemplateType())) { vol.setTemplateId(template.getId()); } if (type == Type.ROOT) { vol.setTemplateId(template.getId()); } } if (VirtualMachine.Type.User.equals(vm.getType())) { UserVmVO userVm = _userVmDao.findById(vm.getId()); vol.setDisplayVolume(userVm.isDisplayVm()); } vol.setFormat(getSupportedImageFormatForCluster(vm.getHypervisorType())); vol.setPoolId(poolId); vol.setPath(path); vol.setChainInfo(chainInfo); vol.setState(Volume.State.Ready); vol = _volsDao.persist(vol); return toDiskProfile(vol, offering); }
Source:
protected List<CandidateCellForSweeping> computeNext() { if (endOfResults) { return endOfData(); } else { try (ConnectionSupplier conns = new ConnectionSupplier(connectionPool); ClosableIterator<AgnosticLightResultRow> iter = selectNextPage(conns)) { List<CandidateCellForSweeping> results = new ArrayList<>(); boolean noResults = true; cellTsPairsExaminedCurrentBatch = 0; while (iter.hasNext()) { noResults = false; AgnosticLightResultRow sqlRow = iter.next(); byte[] rowName = sqlRow.getBytes("row_name"); byte[] colName = sqlRow.getBytes("col_name"); if (!Arrays.equals(currentRowName, rowName) || !Arrays.equals(currentColName, colName)) { getCurrentCandidate().ifPresent(results::add); currentCellTimestamps.clear(); currentRowName = rowName; currentColName = colName; } Object[] timestamps = (Object[]) sqlRow.getArray("timestamps"); for (Object ts : timestamps) { currentCellTimestamps.add((Long) ts); } cellTsPairsExaminedCurrentBatch = sqlRow.getLong("cell_ts_number"); if (request.shouldCheckIfLatestValueIsEmpty()) { currentIsLatestValueEmpty = sqlRow.getBoolean("latest_val_empty"); } } if (noResults) { getCurrentCandidate().ifPresent(results::add); endOfResults = true; } else { computeNextStartPosition(); } cellTsPairsExaminedTotal += cellTsPairsExaminedCurrentBatch; return results; } } }

Target:
protected List<CandidateCellForSweeping> computeNext() { if (endOfResults) { return endOfData(); } else { try (ConnectionSupplier conns = new ConnectionSupplier(connectionPool); ClosableIterator<AgnosticLightResultRow> iter = selectNextPage(conns)) { List<CandidateCellForSweeping> results = new ArrayList<>(); boolean noResults = true; cellTsPairsExaminedCurrentBatch = 0; while (iter.hasNext()) { noResults = false; AgnosticLightResultRow sqlRow = iter.next(); byte[] rowName = sqlRow.getBytes("row_name"); byte[] colName = sqlRow.getBytes("col_name"); if (!isCurrentCell(rowName, colName)) { getCurrentCandidate().ifPresent(results::add); currentCellTimestamps.clear(); currentRowName = rowName; currentColName = colName; } Object[] timestamps = (Object[]) sqlRow.getArray("timestamps"); for (Object ts : timestamps) { currentCellTimestamps.add((Long) ts); } cellTsPairsExaminedCurrentBatch = sqlRow.getLong("max_row_number"); if (request.shouldCheckIfLatestValueIsEmpty()) { currentIsLatestValueEmpty = sqlRow.getBoolean("latest_val_empty"); } } if (noResults || cellTsPairsExaminedCurrentBatch < sqlRowLimit) { getCurrentCandidate().ifPresent(results::add); endOfResults = true; } else { computeNextStartPosition(); } cellTsPairsExaminedTotal += cellTsPairsExaminedCurrentBatch; return results; } } }
Source:
private Promise<Boolean> validatePropertyIsNotEmpty(final List<Property> listProperty, final String errorMessage) { boolean isEmpty = false; for (Property property : listProperty) { if (property.getName() == null || property.getName().trim().isEmpty()) { isEmpty = true; } if (property.getValue() == null || property.getValue().trim().isEmpty()) { isEmpty = true; } } boolean finalIsEmpty = isEmpty; return promises.create((resolve, reject) -> { if (finalIsEmpty) { reject.onInvoke(errorMessage); } else { resolve.onInvoke(true); } }); }

Target:
Promise<Boolean> validatePropertyIsNotEmpty(final List<Property> listProperty, final String errorMessage) { return promises.create((resolve, reject) -> { if (isEmpty(listProperty)) { reject.onInvoke(errorMessage); } else { resolve.onInvoke(true); } }); }
Source:
private void initializeMap() { WebSourceTileLayer tileSource = new WebSourceTileLayer( "openstreetmap", MAP_TILE_SOURCE + "{z}/{x}/{y}.png", true ); mapView.setDiskCacheEnabled(true); mapView.setTileSource(tileSource); mapView.setZoom(MAP_DEFAULT_ZOOM); mapView.setUserLocationEnabled(true); mapView.setUserLocationTrackingMode(UserLocationOverlay.TrackingMode.FOLLOW_BEARING); mapView.getUserLocationOverlay().runOnFirstFix(new Runnable() { @Override public void run() { currentLocation = mapView.getUserLocationOverlay().getLastFix(); makeUseOfNewLocation(currentLocation); fetchNearbyPages(); } }); mapView.setMapViewListener(new MapViewListener() { @Override public void onShowMarker(MapView mapView, Marker marker) { } @Override public void onHideMarker(MapView mapView, Marker marker) { } @Override public void onTapMarker(MapView mapView, Marker marker) { highlightMarker(marker); int index = adapter.getPosition((NearbyPage) marker.getRelatedObject()); if (index == -1) { return; } nearbyList.setSelection(index); } @Override public void onLongPressMarker(MapView mapView, Marker marker) { } @Override public void onTapMap(MapView mapView, ILatLng iLatLng) { } @Override public void onLongPressMap(MapView mapView, ILatLng iLatLng) { } }); mapView.addListener(new MapListener() { @Override public void onScroll(ScrollEvent scrollEvent) { fetchNearbyPages(); } @Override public void onZoom(ZoomEvent zoomEvent) { fetchNearbyPages(); } @Override public void onRotate(RotateEvent rotateEvent) { } }); }

Target:
private void initializeMap() { WebSourceTileLayer tileSource = new WebSourceTileLayer( "openstreetmap", getString(R.string.map_tile_source_url), true ); mapView.setDiskCacheEnabled(true); mapView.setTileSource(tileSource); mapView.setZoom(getResources().getInteger(R.integer.map_default_zoom)); mapView.setUserLocationEnabled(true); mapView.setUserLocationTrackingMode(UserLocationOverlay.TrackingMode.FOLLOW_BEARING); mapView.getUserLocationOverlay().runOnFirstFix(new Runnable() { @Override public void run() { currentLocation = mapView.getUserLocationOverlay().getLastFix(); makeUseOfNewLocation(currentLocation); fetchNearbyPages(); } }); mapView.setMapViewListener(new DefaultMapViewListener() { @Override public void onTapMarker(MapView mapView, Marker marker) { highlightMarker(marker); int index = adapter.getPosition((NearbyPage) marker.getRelatedObject()); if (index == -1) { return; } nearbyList.setSelection(index); } }); mapView.addListener(new MapListener() { @Override public void onScroll(ScrollEvent scrollEvent) { fetchNearbyPages(); } @Override public void onZoom(ZoomEvent zoomEvent) { fetchNearbyPages(); } @Override public void onRotate(RotateEvent rotateEvent) { } }); }
Source:
public void testQueryClassExistence() { List<VdcQueryType> missingQueries = new ArrayList<>(); for (VdcQueryType vqt : VdcQueryType.values()) { if (vqt != VdcQueryType.Unknown) { if (CommandsFactory.getQueryClass(vqt.name()) == null) { missingQueries.add(vqt); } } } assertTrue("VdcQueryType contains the following values that does not correspond to an existing query class: " + missingQueries, missingQueries.isEmpty()); }

Target:
public void testQueryClassExistence() { List<VdcQueryType> missingQueries = new LinkedList<>(); for (VdcQueryType vqt : VdcQueryType.values()) { if (vqt != VdcQueryType.Unknown) { if (CommandsFactory.getQueryClass(vqt.name()) == null) { missingQueries.add(vqt); } } } assertTrue("VdcQueryType contains the following values that does not correspond to an existing query class: " + missingQueries, missingQueries.isEmpty()); }
Source:
public ThingUID getThingUID(ServiceInfo service) { if (service != null) { String name = service.getName(); if (Objects.equals(service.getType(), getServiceType()) && (name.matches(GATEWAY_NAME_REGEX_PATTERN))) { return new ThingUID(GATEWAY_TYPE_UID, name.replaceAll("[^A-Za-z0-9_]", "")); } } return null; }

Target:
public ThingUID getThingUID(ServiceInfo service) { if (service != null) { Matcher m = GATEWAY_NAME_REGEX_PATTERN.matcher(service.getName()); if (m.find()) { return new ThingUID(GATEWAY_TYPE_UID, m.group(1).replaceAll("[^A-Za-z0-9_]", "")); } } return null; }
Source:
public PlaceRequest toPlaceRequest(final String placeToken) throws TokenFormatException { if (!placeToken.startsWith("/")) { return toPlaceRequest("/" + placeToken); } int split = placeToken.indexOf('?'); String place = (split != -1) ? placeToken.substring(0, split) : placeToken; String query = (split != -1) ? placeToken.substring(split + 1) : ""; RouteMatcher matcher = new RouteMatcher(place); RouteMatch match = (matcher.allMatches.size() > 0) ? matcher.allMatches.last() : new RouteMatch(place, 0, null); match.parameters = parseQueryString(query, match.parameters); return new PlaceRequest.Builder().withNameToken(match.route).withParams(match.parameters).build(); }

Target:
public PlaceRequest toPlaceRequest(final String placeToken) throws TokenFormatException { if (!placeToken.startsWith("/")) { return toPlaceRequest("/" + placeToken); } int split = placeToken.indexOf('?'); String place = (split != -1) ? placeToken.substring(0, split) : placeToken; String query = (split != -1) ? placeToken.substring(split + 1) : ""; RouteMatcher matcher = new RouteMatcher(place); RouteMatch match = (matcher.allMatches.size() > 0) ? matcher.allMatches.last() : new RouteMatch(place, 0, null); match.parameters = parseQueryString(query, match.parameters); return new PlaceRequest.Builder().nameToken(match.route).with(match.parameters).build(); }
Source:
private CqlQueryResponse executeCqlQuery(CqlRequest cqlRequest) throws UnsupportedQueryException, SourceUnavailableException, FederationException { QueryRequest request = cqlRequest.createQueryRequest(catalogFramework.getId(), filterBuilder); Stopwatch stopwatch = Stopwatch.createStarted(); List<QueryResponse> responses = Collections.synchronizedList(new ArrayList<>()); QueryFunction queryFunction = (queryRequest) -> { QueryResponse queryResponse = catalogFramework.query(queryRequest); responses.add(queryResponse); return queryResponse; }; List<Result> results = ResultIterable.resultIterable(queryFunction, request, cqlRequest.getCount()) .stream() .collect(Collectors.toList()); for (Result result : results) { Metacard metacard = result.getMetacard(); if (metacard.getAttribute("resource-download-url") != null) { List<Serializable> list = new ArrayList<>(); list.add( SystemBaseUrl.EXTERNAL .constructUrl("search/catalog/internal/catalog/sources/") .concat(metacard.getSourceId() + "/" + metacard.getId()) .concat("?transform=" + metacard.getAttribute("metacard-tags").getValues().get(0))); Attribute attribute = new AttributeImpl("resource-download-url", list); metacard.setAttribute(attribute); } } QueryResponse response = new QueryResponseImpl( request, results, true, responses .stream() .filter(Objects::nonNull) .map(QueryResponse::getHits) .findFirst() .orElse(-1l), responses .stream() .filter(Objects::nonNull) .map(QueryResponse::getProperties) .findFirst() .orElse(Collections.emptyMap())); stopwatch.stop(); return new CqlQueryResponse( cqlRequest.getId(), request, response, cqlRequest.getSource(), stopwatch.elapsed(TimeUnit.MILLISECONDS), cqlRequest.isNormalize(), filterAdapter, actionRegistry); }

Target:
private CqlQueryResponse executeCqlQuery(CqlRequest cqlRequest) throws UnsupportedQueryException, SourceUnavailableException, FederationException { QueryRequest request = cqlRequest.createQueryRequest(catalogFramework.getId(), filterBuilder); Stopwatch stopwatch = Stopwatch.createStarted(); List<QueryResponse> responses = Collections.synchronizedList(new ArrayList<>()); QueryFunction queryFunction = (queryRequest) -> { QueryResponse queryResponse = catalogFramework.query(queryRequest); responses.add(queryResponse); return queryResponse; }; List<Result> results = ResultIterable.resultIterable(queryFunction, request, cqlRequest.getCount()) .stream() .collect(Collectors.toList()); QueryResponse response = new QueryResponseImpl( request, results, true, responses .stream() .filter(Objects::nonNull) .map(QueryResponse::getHits) .findFirst() .orElse(-1l), responses .stream() .filter(Objects::nonNull) .map(QueryResponse::getProperties) .findFirst() .orElse(Collections.emptyMap())); stopwatch.stop(); return new CqlQueryResponse( cqlRequest.getId(), request, response, cqlRequest.getSource(), stopwatch.elapsed(TimeUnit.MILLISECONDS), cqlRequest.isNormalize(), filterAdapter, actionRegistry); }
Source:
public UserSyncFinishedWithErrors(User user) { this.user = user; this.message = formatMessage( "%s synchronization failed.", user); }

Target:
public UserSyncFinishedWithErrors(User user) { this.user = user; this.message = formatMessage( "%s synchronization finished with errors.", user); }
Source:
short setLock(short lockSetVal) { LOG.debug("acquire" + name + (short) (lockSetVal | setMask)); return (short) (lockSetVal | setMask); }

Target:
short setLock(short lockSetVal) { return (short) (lockSetVal | setMask); }
Source:
private VisorBaselineTaskResult remove(List<String> consistentIds) { Map<String, BaselineNode> baseline = currentBaseLine(); if (!baseline.isEmpty()) { for (String consistentId : consistentIds) { BaselineNode node = baseline.remove(consistentId); if (node == null) throw new IllegalStateException("Node not found for consistent ID: " + consistentId); } } return set0(baseline.values()); }

Target:
private VisorBaselineTaskResult remove(List<String> consistentIds) { Map<String, BaselineNode> baseline = currentBaseLine(); if (F.isEmpty(baseline)) return set0(Collections.EMPTY_LIST); for (String consistentId : consistentIds) { BaselineNode node = baseline.remove(consistentId); if (node == null) throw new IllegalStateException("Node not found for consistent ID: " + consistentId); } return set0(baseline.values()); }
Source:
public String save() { Set<ConstraintViolation<KitodoPassword>> passwordViolations = getPasswordViolations(); if(passwordViolations.isEmpty()) { for (ConstraintViolation<KitodoPassword> passwordViolation : passwordViolations) { Helper.setErrorMessage(passwordViolation.getMessage()); } return this.stayOnCurrentPage; } String login = this.userObject.getLogin(); if (!isUserExistingOrLoginValid(login)) { Helper.setErrorMessage("loginNotValid", new Object[] {login }); return this.stayOnCurrentPage; } if (isMissingClient()) { Helper.setErrorMessage("errorMissingClient"); return this.stayOnCurrentPage; } try { if (userService.getAmountOfUsersWithExactlyTheSameLogin(this.userObject.getId(), login) == 0) { if (Objects.nonNull(this.passwordToEncrypt)) { this.userObject.setPassword(passwordEncoder.encrypt(this.passwordToEncrypt)); } userService.saveToDatabase(this.userObject); if (userService.getAuthenticatedUser().getId().equals(this.userObject.getId())) { loginForm.setLoggedUser(this.userObject); } return userListPath; } else { Helper.setErrorMessage("loginInUse"); return this.stayOnCurrentPage; } } catch (DAOException | RuntimeException e) { Helper.setErrorMessage(ERROR_SAVING, new Object[] {ObjectType.USER.getTranslationSingular() }, logger, e); return this.stayOnCurrentPage; } }

Target:
public String save() { Set<ConstraintViolation<KitodoPassword>> passwordViolations = getPasswordViolations(); if (!passwordViolations.isEmpty()) { for (ConstraintViolation<KitodoPassword> passwordViolation : passwordViolations) { Helper.setErrorMessage(passwordViolation.getMessage()); } return this.stayOnCurrentPage; } String login = this.userObject.getLogin(); if (!isUserExistingOrLoginValid(login)) { Helper.setErrorMessage("loginNotValid", new Object[] {login }); return this.stayOnCurrentPage; } if (isMissingClient()) { Helper.setErrorMessage("errorMissingClient"); return this.stayOnCurrentPage; } try { if (userService.getAmountOfUsersWithExactlyTheSameLogin(this.userObject.getId(), login) == 0) { if (Objects.nonNull(this.passwordToEncrypt)) { this.userObject.setPassword(passwordEncoder.encrypt(this.passwordToEncrypt)); } userService.saveToDatabase(this.userObject); if (userService.getAuthenticatedUser().getId().equals(this.userObject.getId())) { loginForm.setLoggedUser(this.userObject); } return userListPath; } else { Helper.setErrorMessage("loginInUse"); return this.stayOnCurrentPage; } } catch (DAOException | RuntimeException e) { Helper.setErrorMessage(ERROR_SAVING, new Object[] {ObjectType.USER.getTranslationSingular() }, logger, e); return this.stayOnCurrentPage; } }
Source:
public void testRegisterWithoutOptionalParams() throws Exception { Cluster cluster = getTestCluster(1L); KafkaServiceRegistrar registrar = initializeServiceRegistrar(); Config config = new Config(); config.put(KafkaServiceRegistrar.PARAM_ZOOKEEPER_CONNECT, "zookeeper-1:2181,zookeeper-2:2181,zookeeper-3:2181"); config.put(KafkaServiceRegistrar.PARAM_LISTENERS, "PLAINTEXT://kafka-1:9092"); registrar.register(cluster, config, Collections.emptyList()); Service kafkaService = environmentService.getServiceByName(cluster.getId(), Constants.Kafka.SERVICE_NAME); assertNotNull(kafkaService); Component broker = environmentService.getComponentByName(kafkaService.getId(), ComponentPropertyPattern.KAFKA_BROKER.name()); assertNotNull(broker); Collection<ComponentProcess> brokerProcesses = environmentService.listComponentProcessesInComponent(broker.getId()); assertEquals(1, brokerProcesses.size()); assertTrue(brokerProcesses.stream().anyMatch(p -> p.getHost().equals("kafka-1") && p.getPort().equals(9092) && p.getProtocol().equals("PLAINTEXT"))); ServiceConfiguration serverPropertiesConf = environmentService.getServiceConfigurationByName(kafkaService.getId(), CONFIGURATION_NAME_SERVER_PROPERTIES); assertNotNull(serverPropertiesConf); Map<String, String> serverPropertiesConfMap = serverPropertiesConf.getConfigurationMap(); assertFalse(serverPropertiesConfMap.containsKey(KafkaServiceRegistrar.PARAM_SECURITY_INTER_BROKER_PROTOCOL)); }

Target:
public void testRegisterWithoutOptionalParams() throws Exception { Cluster cluster = getTestCluster(1L); KafkaServiceRegistrar registrar = initializeServiceRegistrar(); Config config = new Config(); config.put(KafkaServiceRegistrar.PARAM_ZOOKEEPER_CONNECT, "zookeeper-1:2181,zookeeper-2:2181,zookeeper-3:2181"); config.put(KafkaServiceRegistrar.PARAM_LISTENERS, "PLAINTEXT://kafka-1:9092"); registrar.register(cluster, config, Collections.emptyList()); Service kafkaService = environmentService.getServiceByName(cluster.getId(), Constants.Kafka.SERVICE_NAME); assertNotNull(kafkaService); Component broker = environmentService.getComponentByName(kafkaService.getId(), ComponentPropertyPattern.KAFKA_BROKER.name()); assertNotNull(broker); Collection<ComponentProcess> brokerProcesses = environmentService.listComponentProcesses(broker.getId()); assertEquals(1, brokerProcesses.size()); assertTrue(brokerProcesses.stream().anyMatch(p -> p.getHost().equals("kafka-1") && p.getPort().equals(9092) && p.getProtocol().equals("PLAINTEXT"))); ServiceConfiguration serverPropertiesConf = environmentService.getServiceConfigurationByName(kafkaService.getId(), CONFIGURATION_NAME_SERVER_PROPERTIES); assertNotNull(serverPropertiesConf); Map<String, String> serverPropertiesConfMap = serverPropertiesConf.getConfigurationMap(); assertFalse(serverPropertiesConfMap.containsKey(KafkaServiceRegistrar.PARAM_SECURITY_INTER_BROKER_PROTOCOL)); }
Source:
public ClientCertificateCredential build() { ValidationUtil.validate(getClass().getSimpleName(), new HashMap<String, Object>() {{ put("clientId", clientId); put("tenantId", tenantId); put("clientCertificate", clientCertificate == null ? clientCertificatePath : clientCertificate); }}); return new ClientCertificateCredential(tenantId, clientId, clientCertificatePath, clientCertificate, clientCertificatePassword, identityClientOptions); }

Target:
public ClientCertificateCredential build() { ValidationUtil.validate(getClass().getSimpleName(), new HashMap<String, Object>() {{ put("clientId", clientId); put("tenantId", tenantId); put("clientCertificate", clientCertificate == null ? clientCertificatePath : clientCertificate); }}); if (clientCertificate != null && clientCertificatePath != null) { throw logger.logExceptionAsWarning(new IllegalArgumentException("Both certificate input stream and " + "certificate path are provided in ClientCertificateCredentialBuilder. Only one of them should " + "be provided.")); } return new ClientCertificateCredential(tenantId, clientId, clientCertificatePath, clientCertificate, clientCertificatePassword, identityClientOptions); }
Source:
protected String relativeDataFileURL(String url, Catalog catalog) { if (catalog == null) { return url; } File baseDirectory = catalog.getResourceLoader().getBaseDirectory(); File f = Resources.find(Resources.fromURL(Files.asResource(baseDirectory), url), true); return f == null ? url : "file:" + Paths.convert(baseDirectory, f); }

Target:
protected String relativeDataFileURL(String url, Catalog catalog) { if (catalog == null) { return url; } File baseDirectory = catalog.getResourceLoader().getBaseDirectory(); File f = Files.url(baseDirectory, url); return f == null ? url : "file:" + Paths.convert(baseDirectory, f); }
Source:
List<DataSegment> checkAndGetSegments(TaskToolbox toolbox) throws IOException { final List<DataSegment> usedSegments = toolbox.getTaskActionClient() .submit(new SegmentListUsedAction(dataSource, interval, null)); if (segments != null) { Collections.sort(usedSegments); Collections.sort(segments); if (!usedSegments.equals(segments)) { final List<DataSegment> unknownSegments = segments.stream() .filter(segment -> !usedSegments.contains(segment)) .collect(Collectors.toList()); final List<DataSegment> missingSegments = usedSegments.stream() .filter(segment -> !segments.contains(segment)) .collect(Collectors.toList()); throw new ISE( "Specified segments in the spec are different from the current used segments. " + "There are unused segments[%s] and missing segments[%s] in the spec.", unknownSegments, missingSegments ); } } return usedSegments; }

Target:
List<DataSegment> checkAndGetSegments(TaskToolbox toolbox) throws IOException { final List<DataSegment> usedSegments = toolbox.getTaskActionClient() .submit(new SegmentListUsedAction(dataSource, interval, null)); if (segments != null) { Collections.sort(usedSegments); Collections.sort(segments); if (!usedSegments.equals(segments)) { final List<DataSegment> unknownSegments = segments.stream() .filter(segment -> !usedSegments.contains(segment)) .collect(Collectors.toList()); final List<DataSegment> missingSegments = usedSegments.stream() .filter(segment -> !segments.contains(segment)) .collect(Collectors.toList()); throw new ISE( "Specified segments in the spec are different from the current used segments. " + "There are unknown segments[%s] and missing segments[%s] in the spec.", unknownSegments, missingSegments ); } } return usedSegments; }
Source:
public void run() { while (!stopThread) { List<ProductSummary> productList = null; synchronized (syncObject) { try { productList = getNextProducts(); } catch (Exception e) { LOGGER.log(Level.WARNING, "[" + getName() + "] Exception getting next products", e); } if (productList == null || productList.size() == 0) { try { syncObject.wait(); } catch (InterruptedException ignore) { LOGGER.log(Level.FINE,"[" + getName() + "] was told to stop, or something went wrong"); } continue; } } for(ProductSummary summary : productList) { LOGGER.log(Level.FINEST,"[" + getName() + "] preparing to process product " + summary.getIndexId()); if (stopThread) { break; } try { LOGGER.log(Level.FINEST,"[" + getName() + "] determining if we can process product " + summary.getIndexId()); if (accept(summary.getId())) { LOGGER.log(Level.FINEST,"[" + getName() + "] attempting to process product " + summary.getIndexId()); this.processProduct(summary); } this.setLastIndexId(summary.getIndexId()); } catch (Exception e) { try { this.onProcessException(summary,e); } catch(Exception e2) { break; } } } } }

Target:
public void run() { while (!stopThread) { List<ProductSummary> productList = null; synchronized (syncObject) { try { productList = getNextProducts(); } catch (Exception e) { try { this.onProductGetException(e); } catch (Exception e2) { } } if (productList == null || productList.size() == 0) { try { syncObject.wait(); } catch (InterruptedException ignore) { LOGGER.log(Level.FINE,"[" + getName() + "] was told to stop, or something went wrong"); } continue; } } for(ProductSummary summary : productList) { LOGGER.log(Level.FINEST,"[" + getName() + "] preparing to process product " + summary.getIndexId()); if (stopThread) { break; } try { LOGGER.log(Level.FINEST,"[" + getName() + "] determining if we can process product " + summary.getIndexId()); if (accept(summary.getId())) { LOGGER.log(Level.FINEST,"[" + getName() + "] attempting to process product " + summary.getIndexId()); this.processProduct(summary); } this.setLastIndexId(summary.getIndexId()); } catch (Exception e) { try { this.onProcessException(summary,e); } catch(Exception e2) { break; } } } } }
Source:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } IndexConfig that = (IndexConfig) o; if (!Objects.equals(name, that.name)) { return false; } if (!Objects.equals(type, that.type)) { return false; } if (type == IndexType.BITMAP && !bitmapIndexOptions.equals(that.bitmapIndexOptions)) { return false; } return getAttributes().equals(that.getAttributes()); }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } IndexConfig that = (IndexConfig) o; if (!Objects.equals(name, that.name)) { return false; } if (!Objects.equals(type, that.type)) { return false; } if (!bitmapIndexOptions.equals(that.bitmapIndexOptions)) { return false; } return getAttributes().equals(that.getAttributes()); }
Source:
protected DefaultJoin(DataSet<I1> input1, DataSet<I2> input2, Keys<I1> keys1, Keys<I2> keys2, JoinHint hint) { super(input1, input2, keys1, keys2, new DefaultJoinFunction<I1, I2>(), new TupleTypeInfo<Tuple2<I1, I2>>(input1.getType(), input2.getType()), hint); }

Target:
protected DefaultJoin(DataSet<I1> input1, DataSet<I2> input2, Keys<I1> keys1, Keys<I2> keys2, JoinHint hint) { super(input1, input2, keys1, keys2, (JoinFunction<I1, I2, Tuple2<I1, I2>>) new DefaultJoinFunction<I1, I2>(), new TupleTypeInfo<Tuple2<I1, I2>>(input1.getType(), input2.getType()), hint); }
Source:
private static List<Address> fromJGroupsAddressList(List<org.jgroups.Address> list) { if (list == null || list.isEmpty()) return Collections.emptyList(); List<Address> retval = new ArrayList<>(list.size()); for (org.jgroups.Address a : list) retval.add(fromJGroupsAddress(a)); return Collections.unmodifiableList(retval); }

Target:
private static List<Address> fromJGroupsAddressList(List<org.jgroups.Address> list) { return Collections.unmodifiableList(list.stream() .map(JGroupsAddressCache::fromJGroupsAddress) .collect(Collectors.toList())); }
Source:
private Boolean getUsePublicEndpointAccessGateway(EnvironmentNetworkRequest network) { return Optional.ofNullable(network.getUsePublicEndpointAccessGateway()).orElse(false); }

Target:
private PublicEndpointAccessGateway getUsePublicEndpointAccessGateway(EnvironmentNetworkRequest network) { return Optional.ofNullable(network.getPublicEndpointAccessGateway()).orElse(PublicEndpointAccessGateway.DISABLED); }