auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private ISYBindingConfig parseConfig(final Item item, final String bindingConfig) { ISYNodeType type; String controller = null; String address = null; ISYControl command = null; if (item instanceof GroupItem) { type = ISYNodeType.GROUP; } else if (item instanceof ContactItem) { type = ISYNodeType.CONTACT; } else if (item instanceof NumberItem) { type = ISYNodeType.NUMBER; } else if (item instanceof StringItem) { type = ISYNodeType.STRING; } else if (item instanceof DimmerItem) { type = ISYNodeType.DIMMER; } else if (item instanceof DateTimeItem) { type = ISYNodeType.HEARTBEAT; } else { type = ISYNodeType.SWITCH; } String[] arr = bindingConfig.split(","); for (String str : arr) { String[] pair = str.split("="); String key = pair[0]; String value = pair[1]; switch (key) { case "ctrl": controller = value.replace('.', ' '); break; case "addr": address = value.replace('.', ' '); break; case "type": if ("thermostat".equalsIgnoreCase(value)) { type = ISYNodeType.THERMOSTAT; } if ("lock".equalsIgnoreCase(value)) { type = ISYNodeType.LOCK; } if ("heartbeat".equalsIgnoreCase(value)) { type = ISYNodeType.HEARTBEAT; } break; case "cmd": try { command = ISYControl.valueOf(value.toUpperCase()); } catch (IllegalArgumentException ie) { this.logger.warn("Unsupported cmd {}", value); command = ISYControl.UNDEFINED; } break; } } if (address == null) { address = controller; } return new ISYBindingConfig(item, type, controller, address, command); }

Target:
private ISYBindingConfig parseConfig(final Item item, final String bindingConfig) throws BindingConfigParseException { ISYNodeType type; String controller = null; String address = null; ISYControl command = null; if (item instanceof GroupItem) { type = ISYNodeType.GROUP; } else if (item instanceof ContactItem) { type = ISYNodeType.CONTACT; } else if (item instanceof NumberItem) { type = ISYNodeType.NUMBER; } else if (item instanceof StringItem) { type = ISYNodeType.STRING; } else if (item instanceof DimmerItem) { type = ISYNodeType.DIMMER; } else if (item instanceof DateTimeItem) { type = ISYNodeType.HEARTBEAT; } else { type = ISYNodeType.SWITCH; } String[] arr = bindingConfig.split(","); for (String str : arr) { String[] pair = str.split("="); String key = pair[0]; String value = pair[1]; switch (key) { case "ctrl": controller = value.replace('.', ' '); break; case "addr": address = value.replace('.', ' '); break; case "type": if ("thermostat".equalsIgnoreCase(value)) { type = ISYNodeType.THERMOSTAT; } if ("lock".equalsIgnoreCase(value)) { type = ISYNodeType.LOCK; } if ("heartbeat".equalsIgnoreCase(value)) { type = ISYNodeType.HEARTBEAT; } break; case "cmd": try { command = ISYControl.valueOf(value.toUpperCase()); } catch (IllegalArgumentException ie) { throw new BindingConfigParseException("Unsupported cmd " + value.toString()); } break; } } if (address == null) { address = controller; } return new ISYBindingConfig(item, type, controller, address, command); }
Source:
private void onResult() { if (script != null && comments != null) { if (comments.getHistory().size() > 1) { historyTable.display(comments.getHistory()); historyPanel.setVisible(true); } else { historyPanel.setVisible(false); } if (contentTable instanceof SideBySideTable && script.getEdits().isEmpty() && !script.getPatchHeader().isEmpty()) { contentTable.removeFromParent(); contentTable = new UnifiedDiffTable(); contentTable.fileList = fileList; contentPanel.add(contentTable); History.newItem(Link.toPatchUnified(patchKey), false); } contentTable.display(patchKey, idSideA, idSideB, script); contentTable.display(comments); contentTable.finishDisplay(); showPatch(!script.getEdits().isEmpty()); script = null; comments = null; if (!isCurrentView()) { display(); } } }

Target:
private void onResult() { if (script != null && comments != null) { if (comments.getHistory().size() > 1) { historyTable.display(comments.getHistory()); historyPanel.setVisible(true); } else { historyPanel.setVisible(false); } boolean hasDifferences = !script.getEdits().isEmpty() && !script.getPatchHeader().isEmpty(); boolean modeChange = script.getEdits().isEmpty() && !script.getPatchHeader().isEmpty(); if (contentTable instanceof SideBySideTable && modeChange) { contentTable.removeFromParent(); contentTable = new UnifiedDiffTable(); contentTable.fileList = fileList; contentPanel.add(contentTable); History.newItem(Link.toPatchUnified(patchKey), false); } if (hasDifferences) { contentTable.display(patchKey, idSideA, idSideB, script); contentTable.display(comments); contentTable.finishDisplay(); } showPatch(hasDifferences); script = null; comments = null; if (!isCurrentView()) { display(); } } }
Source:
public static boolean runCipherToolScriptAndCheckStatus(String carbonHome, String[] cmdArray) throws IOException { boolean foundTheMessage = false; BufferedReader br = null; Process process = null; try { log.info("Running the ciphertool.sh .."); File commandDir = new File(carbonHome + "/bin"); ProcessBuilder processBuilder = new ProcessBuilder(cmdArray); processBuilder.directory(commandDir); process = processBuilder.start(); br = new BufferedReader(new InputStreamReader(process.getInputStream(), "UTF-8")); String line; while ((line = br.readLine()) != null) { log.info(line); if (line.contains("Encryption is done Successfully")) { foundTheMessage = true; } } return foundTheMessage; } catch (IOException ex) { log.error("Error when reading the InputStream when running shell script ", ex); throw new IOException("Error when reading the InputStream when running shell script ", ex); } finally { if (br != null) { br.close(); } if (process != null) { process.destroy(); } } }

Target:
public static boolean runCipherToolScriptAndCheckStatus(String carbonHome, String[] cmdArray) throws PasswordEncryptionIntegrationTestException { boolean foundTheMessage = false; BufferedReader br = null; Process process = null; try { log.info("Running the ciphertool.sh .."); File commandDir = new File(carbonHome + "/bin"); ProcessBuilder processBuilder = new ProcessBuilder(cmdArray); processBuilder.directory(commandDir); process = processBuilder.start(); br = new BufferedReader(new InputStreamReader(process.getInputStream(), "UTF-8")); String line; while ((line = br.readLine()) != null) { log.info(line); if (line.contains("Encryption is done Successfully")) { foundTheMessage = true; } } return foundTheMessage; } catch (IOException ex) { log.error("Error when reading the InputStream when running shell script ", ex); throw new PasswordEncryptionIntegrationTestException("Error when reading the InputStream when running shell script ", ex); } finally { if (br != null) { try { br.close(); } catch (IOException e) { log.warn("error while closing the buffered reader"); } } if (process != null) { process.destroy(); } } }
Source:
public void startVisit(final Patient patient, @Nullable final StartVisitResponseListenerCallback callbackListener) { final Visit visit = new Visit(); visit.setStartDatetime(DateUtils.convertTime(System.currentTimeMillis(), DateUtils.OPEN_MRS_REQUEST_FORMAT)); visit.setPatient(patient); LocationDAO.findLocationByName(OpenMRS.getInstance().getLocation()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(location -> { visit.setLocation(location); }); visit.setVisitType(new VisitType(null, OpenMRS.getInstance().getVisitTypeUUID())); Call<Visit> call = restApi.startVisit(visit); call.enqueue(new Callback<Visit>() { @Override public void onResponse(Call<Visit> call, Response<Visit> response) { if (response.isSuccessful()) { Visit newVisit = response.body(); visitDAO.saveOrUpdate(newVisit, patient.getId()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(id -> { if(callbackListener != null) { callbackListener.onStartVisitResponse(id); } }); } else { if(callbackListener != null) { callbackListener.onErrorResponse(response.message()); } } } @Override public void onFailure(Call<Visit> call, Throwable t) { if(callbackListener != null) { callbackListener.onErrorResponse(t.getMessage()); } } }); }

Target:
public void startVisit(final Patient patient, @Nullable final StartVisitResponseListenerCallback callbackListener) { final Visit visit = new Visit(); visit.setStartDatetime(DateUtils.convertTime(System.currentTimeMillis(), DateUtils.OPEN_MRS_REQUEST_FORMAT)); visit.setPatient(patient); visit.setLocation(locationDAO.findLocationByName(OpenMRS.getInstance().getLocation())); visit.setVisitType(new VisitType(null, OpenMRS.getInstance().getVisitTypeUUID())); Call<Visit> call = restApi.startVisit(visit); call.enqueue(new Callback<Visit>() { @Override public void onResponse(Call<Visit> call, Response<Visit> response) { if (response.isSuccessful()) { Visit newVisit = response.body(); visitDAO.saveOrUpdate(newVisit, patient.getId()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(id -> { if(callbackListener != null) { callbackListener.onStartVisitResponse(id); } }); } else { if(callbackListener != null) { callbackListener.onErrorResponse(response.message()); } } } @Override public void onFailure(Call<Visit> call, Throwable t) { if(callbackListener != null) { callbackListener.onErrorResponse(t.getMessage()); } } }); }
Source:
public List<Biome.SpawnListEntry> getSpawns(List<Biome.SpawnListEntry> defaults, World world, EnumCreatureType creatureType, BlockPos pos) { for (MapGenStructure structure : structureMap.values()) { if (structure instanceof ISpawningStructure && structure.isInsideStructure(pos)) { return ((ISpawningStructure) structure).getSpawns(Collections.unmodifiableList(defaults), world, creatureType, pos); } } return defaults; }

Target:
public List<Biome.SpawnListEntry> getSpawns(List<Biome.SpawnListEntry> defaults, World world, EnumCreatureType creatureType, BlockPos pos) { for (MapGenStructure structure : structureMap.values()) { if (structure instanceof ISpawningStructure && structure.isPositionInStructure(world,pos)) { return ((ISpawningStructure) structure).getSpawns(Collections.unmodifiableList(defaults), world, creatureType, pos); } } return defaults; }
Source:
public ReplicaList normalizeByRange() { if (Iterables.all(this, Replica::isFull)) { ReplicaList normalized = new ReplicaList(size()); for (Replica replica: this) { normalized.addAll(replica.normalizeByRange()); } return normalized; } else { throw new UnsupportedOperationException("transient replicas are currently unsupported"); } }

Target:
public ReplicaList normalizeByRange() { if (Iterables.all(this, Replica::isFull)) { ReplicaList normalized = new ReplicaList(size()); for (Replica replica: this) { replica.addNormalizeByRange(normalized); } return normalized; } else { throw new UnsupportedOperationException("transient replicas are currently unsupported"); } }
Source:
public Optional<User> getBlockNotifier(BlockPos pos) { final int intKey = blockPosToInt(pos); final PlayerTracker intTracker = this.trackedIntBlockPositions.get(intKey); if (intTracker != null) { final int notifierIndex = intTracker.notifierIndex; return getValidatedUser(intKey, notifierIndex); } else { final short shortKey = blockPosToShort(pos); final PlayerTracker shortTracker = this.trackedShortBlockPositions.get(shortKey); if (shortTracker != null) { final int notifierIndex = shortTracker.notifierIndex; return getValidatedUser(shortKey, notifierIndex); } } return Optional.empty(); }

Target:
public Optional<User> getBlockNotifier(BlockPos pos) { final int intKey = blockPosToInt(pos); final PlayerTracker intTracker = this.trackedIntBlockPositions.get(intKey); if (intTracker != null) { return getValidatedUser(intKey, intTracker.notifierIndex); } else { final short shortKey = blockPosToShort(pos); final PlayerTracker shortTracker = this.trackedShortBlockPositions.get(shortKey); if (shortTracker != null) { return getValidatedUser(shortKey, shortTracker.notifierIndex); } } return Optional.empty(); }
Source:
public void loadReadme(boolean refresh) { Consumer consumer = result -> { Log.d("TEST-RE", "readme flatMap called"); setContentShown(true); TextView readmeView = (TextView) mContentView.findViewById(R.id.readme); View progress = mContentView.findViewById(R.id.pb_readme); if (result != null) mImageGetter.encode(getContext(), mRepository.getId(), String.valueOf(result)); if (result != null) { readmeView.setMovementMethod(UiUtils.CHECKING_LINK_METHOD); mImageGetter.bind(readmeView, String.valueOf(result), mRepository.getId()); } else { readmeView.setText(R.string.repo_no_readme); readmeView.setTypeface(Typeface.DEFAULT, Typeface.ITALIC); } readmeView.setVisibility(View.VISIBLE); progress.setVisibility(View.GONE); }; RepositoryService.loadReadme(getActivity(), mRepository.getOwner().getLogin(), mRepository.getName(), StringUtils.isBlank(mRef) ? mRepository.getDefaultBranch() : mRef, refresh) .subscribe(consumer, e -> {}); }

Target:
public void loadReadme(boolean refresh) { RepositoryService.loadReadme( (BaseActivity) getActivity(), mRepository.getOwner().getLogin(), mRepository.getName(), StringUtils.isBlank(mRef) ? mRepository.getDefaultBranch() : mRef, refresh ).doOnNext(result -> { setContentShown(true); TextView readmeView = (TextView) mContentView.findViewById(R.id.readme); View progress = mContentView.findViewById(R.id.pb_readme); if (result != null) mImageGetter.encode(getContext(), mRepository.getId(), String.valueOf(result)); if (result != null) { readmeView.setMovementMethod(UiUtils.CHECKING_LINK_METHOD); mImageGetter.bind(readmeView, String.valueOf(result), mRepository.getId()); } else { readmeView.setText(R.string.repo_no_readme); readmeView.setTypeface(Typeface.DEFAULT, Typeface.ITALIC); } readmeView.setVisibility(View.VISIBLE); progress.setVisibility(View.GONE); }).subscribe(consumer -> {}, error -> {}); }
Source:
public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + (backupsEnabled == null ? 0 : backupsEnabled.hashCode()); result = prime * result + (privateNetworking == null ? 0 : privateNetworking.hashCode()); result = prime * result + (shouldAutoCreateKeyPair ? 1231 : 1237); result = prime * result + (sshKeyIds == null ? 0 : sshKeyIds.hashCode()); return result; }

Target:
public int hashCode() { return Objects.hashCode(super.hashCode(), backupsEnabled, privateNetworking, autoCreateKeyPair, sshKeyIds); }
Source:
private HostVO getNuageVspHost(long physicalNetworkId) { HostVO nuageVspHost; List<NuageVspDeviceVO> nuageVspDevices = _nuageVspDao.listByPhysicalNetwork(physicalNetworkId); if (nuageVspDevices != null && (!nuageVspDevices.isEmpty())) { NuageVspDeviceVO config = nuageVspDevices.iterator().next(); nuageVspHost = _hostDao.findById(config.getHostId()); _hostDao.loadDetails(nuageVspHost); } else { throw new CloudRuntimeException("Nuage VSD is not configured on physical network " + physicalNetworkId); } return nuageVspHost; }

Target:
private HostVO getNuageVspHost(long physicalNetworkId) { HostVO nuageVspHost; List<NuageVspDeviceVO> nuageVspDevices = _nuageVspDao.listByPhysicalNetwork(physicalNetworkId); if (nuageVspDevices != null && (!nuageVspDevices.isEmpty())) { NuageVspDeviceVO config = nuageVspDevices.iterator().next(); nuageVspHost = _hostDao.findById(config.getHostId()); _hostDao.loadDetails(nuageVspHost); } else { throw new CloudRuntimeException("There is no Nuage VSP device configured on physical network " + physicalNetworkId); } return nuageVspHost; }
Source:
private Type deriveTargetType(SendSignalAction node) { Type targetPinType = null; if (node.getOnPort() != null) { targetPinType = node.getOnPort().getClass_(); } else { if (node.getTarget() != null) { Type currentTargetPinType = node.getTarget().getType(); if (currentTargetPinType instanceof Class && canReceive((Class)currentTargetPinType, node.getSignal())) { targetPinType = currentTargetPinType; } } if(targetPinType == null){ InputPin currentTargetPin = node.getTarget(); if (currentTargetPin == null) { node.setTarget(UMLFactory.eINSTANCE.createInputPin()); } UMLContentProvider provider = new UMLContentProvider(node.getTarget(), UMLPackage.eINSTANCE.getTypedElement_Type()); TreeSelectorDialog dialog = new TreeSelectorDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell()); dialog.setTitle("Select type"); dialog.setDescription("Select type for target input pin"); dialog.setContentProvider(provider); dialog.setLabelProvider(new UMLLabelProvider()); int userResponse = dialog.open(); if (userResponse == Window.OK) { Object[] result = dialog.getResult(); if (result != null && result.length > 0 && result[0] instanceof Type) { targetPinType = (Type) result[0]; } } node.setTarget(currentTargetPin); } } return targetPinType; }

Target:
private Type deriveTargetType(SendSignalAction node) { Type targetPinType = null; if (node.getOnPort() != null) { targetPinType = node.getOnPort().getClass_(); } else { if (node.getTarget() != null) { Type currentTargetPinType = node.getTarget().getType(); if (currentTargetPinType instanceof Class && canReceive((Class) currentTargetPinType, node.getSignal())) { targetPinType = currentTargetPinType; } } if (targetPinType == null && Display.getCurrent() !=null) { InputPin currentTargetPin = node.getTarget(); if (currentTargetPin == null) { node.setTarget(UMLFactory.eINSTANCE.createInputPin()); } UMLContentProvider provider = new UMLContentProvider(node.getTarget(), UMLPackage.eINSTANCE.getTypedElement_Type()); TreeSelectorDialog dialog = new TreeSelectorDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell()); dialog.setTitle("Select type"); dialog.setDescription("Select type for target input pin"); dialog.setContentProvider(provider); dialog.setLabelProvider(new UMLLabelProvider()); int userResponse = dialog.open(); if (userResponse == Window.OK) { Object[] result = dialog.getResult(); if (result != null && result.length > 0 && result[0] instanceof Type) { targetPinType = (Type) result[0]; } } node.setTarget(currentTargetPin); } } return targetPinType; }
Source:
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { switch (localName) { case COLOR_SETTINGS_TAG: colorSettings = new ArrayList<>(); break; case COLOR_SETTING_TAG: fg = null; bg = null; tickColor = null; filter = null; break; case FG_TAG: fg = getRGBfromAttributes(attributes); break; case BG_TAG: bg = getRGBfromAttributes(attributes); break; case TICK_TAG: tickColor = getRGBfromAttributes(attributes); break; default: if (filterContentHandler != null) { filterContentHandler.startElement(uri, localName, qName, attributes); } break; case FILTER_TAG: filterContentHandler = new TmfFilterContentHandler(); break; } }

Target:
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { switch (localName) { case COLOR_SETTINGS_TAG: colorSettings = new ArrayList<>(); break; case COLOR_SETTING_TAG: fg = null; bg = null; tickColor = null; filter = null; break; case FG_TAG: fg = getRGBfromAttributes(attributes); break; case BG_TAG: bg = getRGBfromAttributes(attributes); break; case TICK_TAG: tickColor = getRGBfromAttributes(attributes); break; case FILTER_TAG: filterContentHandler = new TmfFilterContentHandler(); break; default: if (filterContentHandler != null) { filterContentHandler.startElement(uri, localName, qName, attributes); } } }
Source:
public void invalidateOutputContent() { Optional<String> text = block.getOutputAnchor().getStringType(); if (text.isPresent()) { rightArgument.setText(text.get()); } }

Target:
public void invalidateOutputContent() { Optional<String> text = block.getOutputAnchor().getStringType(); text.ifPresent(a -> rightArgument.setText(a)); }
Source:
public void testSslNoClientAuthenticationJks() { SslConfiguration serverConfig = SslConfiguration.builder() .trustStorePath(TestConstants.CA_TRUST_STORE_PATH) .keyStorePath(TestConstants.SERVER_KEY_STORE_JKS_PATH) .keyStorePassword(TestConstants.SERVER_KEY_STORE_JKS_PASSWORD) .build(); SslConfiguration clientConfig = SslConfiguration.builder() .trustStorePath(TestConstants.CA_TRUST_STORE_PATH) .build(); runSslConnectionTest(serverConfig, clientConfig, false); }

Target:
public void testSslNoClientAuthenticationJks() { TrustStoreConfiguration serverTrustStoreConfig = TrustStoreConfiguration.of(TestConstants.CA_TRUST_STORE_PATH); KeyStoreConfiguration serverKeyStoreConfig = KeyStoreConfiguration.of( TestConstants.SERVER_KEY_STORE_JKS_PATH, TestConstants.SERVER_KEY_STORE_JKS_PASSWORD); SslConfiguration serverConfig = SslConfiguration.of(serverTrustStoreConfig, serverKeyStoreConfig); TrustStoreConfiguration clientTrustStoreConfig = TrustStoreConfiguration.of(TestConstants.CA_TRUST_STORE_PATH); SslConfiguration clientConfig = SslConfiguration.of(clientTrustStoreConfig); runSslConnectionTest(serverConfig, clientConfig, ClientAuth.NO_CLIENT_AUTH); }
Source:
private LettucePoolingClientConfiguration buildLettuceClientConfiguration() { final LettucePoolingClientConfigurationBuilder builder = LettucePoolingClientConfiguration.builder(); builder.commandTimeout(Duration.ofMillis(readPropertyValue(propertyPrefix + "timeout", int.class, 1000))); if (readPropertyValue(propertyPrefix + "ssl", boolean.class, false)) { builder.useSsl(); } int poolMax = readPropertyValue(propertyPrefix + "pool.max", int.class, 256); GenericObjectPoolConfig poolConfig = new GenericObjectPoolConfig(); poolConfig.setMaxTotal(poolMax); poolConfig.setBlockWhenExhausted(false); builder.poolConfig(poolConfig); return builder.build(); }

Target:
private LettucePoolingClientConfiguration buildLettuceClientConfiguration() { final LettucePoolingClientConfigurationBuilder builder = LettucePoolingClientConfiguration.builder(); int timeout = readPropertyValue(propertyPrefix + "timeout", int.class, DEFAULT_COMMAND_TIMEOUT); if (timeout < 0) { timeout = DEFAULT_COMMAND_TIMEOUT; } builder.commandTimeout(Duration.ofMillis(timeout)); if (readPropertyValue(propertyPrefix + "ssl", boolean.class, false)) { builder.useSsl(); } int poolMax = readPropertyValue(propertyPrefix + "pool.max", int.class, 256); GenericObjectPoolConfig poolConfig = new GenericObjectPoolConfig(); poolConfig.setMaxTotal(poolMax); poolConfig.setBlockWhenExhausted(false); builder.poolConfig(poolConfig); return builder.build(); }
Source:
private void grow(int newCapacity) { if (newCapacity > array.length) { int newLength = (int) Math.min(Math.max(2L * (long) array.length, (long) newCapacity), 2147483639L); array = Arrays.copyOf(array, newLength); } }

Target:
private void grow(int newCapacity) { if (array.length == MAX_ARRAY_SIZE) { throw new IllegalStateException("Array reached maximum size"); } if (newCapacity > array.length) { int newLength = (int) Math.min(Math.max(2L * (long) array.length, (long) newCapacity), MAX_ARRAY_SIZE); array = Arrays.copyOf(array, newLength); } }
Source:
public void insertHeaderWithNullValue() { final Map<String, Object> props = new HashMap<>(); props.put("header", "AAA"); props.put("literal.value", null); xform.configure(props); final SourceRecord record = new SourceRecord(null, null, "test", 0, null, null, null, null, null, null); final SourceRecord transformedRecord = xform.apply(record); Headers expected = new ConnectHeaders().add("AAA", null); assertEquals(1, transformedRecord.headers().size()); assertEquals(expected, transformedRecord.headers()); }

Target:
public void insertHeaderWithNullValue() { final Map<String, Object> props = new HashMap<>(); props.put("header", "AAA"); xform.configure(props); final SourceRecord record = new SourceRecord(null, null, "test", 0, null, null, null, null, null, null); final SourceRecord transformedRecord = xform.apply(record); Headers expected = new ConnectHeaders().add("AAA", null); assertEquals(1, transformedRecord.headers().size()); assertEquals(expected, transformedRecord.headers()); }
Source:
private <T> void addtoResultsWithNullCheck(Set<T> allResults, Collection<? extends T> configObjects) { if (configObjects.contains(null)) { System.err.println("Null found in results."); } else { allResults.addAll(configObjects); } }

Target:
private <T> void addtoResultsWithNullCheck(Set<T> allResults, Collection<? extends T> configObjects) { if (configObjects.contains(null)) { OseeLog.log(AbstractAtsConfigQueryImpl.class, Level.SEVERE, "Null found in results"); } else { allResults.addAll(configObjects); } }
Source:
public final Github github() { return null; }

Target:
public final Github github() { throw new UnsupportedOperationException(); }
Source:
public Map<String, Set<String>> listPortNames(Archive archive) { try (URLClassLoader moduleClassLoader = new BootClassLoaderFactory(archive, parent).createClassLoader()) { ResourcePatternResolver moduleResourceLoader = new PathMatchingResourcePatternResolver(moduleClassLoader); Set<String> inboundPorts = new HashSet<>(); Set<String> outboundPorts = new HashSet<>(); Map<String, Set<String>> portsMap = new HashMap<>(); Resource[] whitelistLegacyDescriptors = moduleResourceLoader.getResources(WHITELIST_LEGACY_PROPERTIES); Resource[] whitelistDescriptors = moduleResourceLoader.getResources(WHITELIST_PROPERTIES); for (Resource resource : concatArrays(whitelistLegacyDescriptors, whitelistDescriptors)) { Properties properties = new Properties(); properties.load(resource.getInputStream()); inboundPorts.addAll(Arrays.asList(StringUtils .delimitedListToStringArray(properties.getProperty(CONFIGURATION_PROPERTIES_INBOUND_PORTS), ",", " "))); portsMap.put("inbound", inboundPorts); outboundPorts.addAll(Arrays.asList(StringUtils .delimitedListToStringArray(properties.getProperty(CONFIGURATION_PROPERTIES_OUTBOUND_PORTS), ",", " "))); portsMap.put("outbound", outboundPorts); } return portsMap; } catch (Exception e) { throw new RuntimeException("Exception trying to list configuration properties for application " + archive, e); } }

Target:
private Map<String, Set<String>> listPortNames(Archive archive) { try (URLClassLoader moduleClassLoader = new BootClassLoaderFactory(archive, parent).createClassLoader()) { ResourcePatternResolver moduleResourceLoader = new PathMatchingResourcePatternResolver(moduleClassLoader); Set<String> inboundPorts = new HashSet<>(); Set<String> outboundPorts = new HashSet<>(); Map<String, Set<String>> portsMap = new HashMap<>(); Resource[] whitelistLegacyDescriptors = moduleResourceLoader.getResources(WHITELIST_LEGACY_PROPERTIES); Resource[] whitelistDescriptors = moduleResourceLoader.getResources(WHITELIST_PROPERTIES); for (Resource resource : concatArrays(whitelistLegacyDescriptors, whitelistDescriptors)) { Properties properties = new Properties(); properties.load(resource.getInputStream()); inboundPorts.addAll(Arrays.asList(StringUtils .delimitedListToStringArray(properties.getProperty(CONFIGURATION_PROPERTIES_INBOUND_PORTS), ",", " "))); portsMap.put("inbound", inboundPorts); outboundPorts.addAll(Arrays.asList(StringUtils .delimitedListToStringArray(properties.getProperty(CONFIGURATION_PROPERTIES_OUTBOUND_PORTS), ",", " "))); portsMap.put("outbound", outboundPorts); } return portsMap; } catch (Exception e) { throw new AppMetadataResolutionException("Exception trying to list configuration properties for application " + archive, e); } }
Source:
public <T> ReportedConfigurations add(ReportedConfigurationType type, T actual, T expected, boolean inSync) { String actualValue = actual != null ? actual.toString() : "null"; String expectedValue = expected != null ? expected.toString() : "null"; reportedConfigurationList.add(new ReportedConfiguration(type, actualValue, expectedValue, inSync)); return this; }

Target:
public <T> ReportedConfigurations add(ReportedConfigurationType type, T actual, T expected, boolean inSync) { String actualValue = actual == null ? null : actual.toString(); String expectedValue = expected == null ? null : expected.toString(); reportedConfigurationList.add(new ReportedConfiguration(type, actualValue, expectedValue, inSync)); return this; }
Source:
private void saveContributionsToDB(List<Contribution> contributions) { Timber.e("Fetched: "+contributions.size()+" contributions "+" saving to db"); ExecutorUtils.get().submit(() -> repository.save(contributions)); repository.set("last_fetch_timestamp",System.currentTimeMillis()); }

Target:
private void saveContributionsToDB(List<Contribution> contributions) { Timber.e("Fetched: "+contributions.size()+" contributions "+" saving to db"); repository.save(contributions).subscribeOn(ioThreadScheduler).subscribe(); repository.set("last_fetch_timestamp",System.currentTimeMillis()); }
Source:
private Element thr() { return element(BlogConstants.BLOG_REPLY_TO,attribute(BlogNamespace.BLOG_REF.getPrefix(), BlogNamespace.BLOG_REF.getUrl() + entity.getPostUuid())); }

Target:
private Element thr() { return element(BlogConstants.BLOG_REPLY_TO,attribute(BlogConstants.BLOG_REF, BlogConstants.BLOG_REF_VALUE + entity.getPostUuid())); }
Source:
public void setTitle(CharSequence text) { if (title == null) { mLateInit = true; mLateInitTitle = text; return; } title.setText(text); }

Target:
public void setTitle(CharSequence text) { if (text == null) { text = ""; } if (title == null) { return; } title.setText(text); }
Source:
public void onFinishButtonClicked() { selected.put(page, view.getSelectedImport()); OrganizeImports organizeImports = dtoFactory.createDto(OrganizeImports.class); organizeImports.setResourceUri(file.getLocation().toString()); organizeImports.setChoices(new ArrayList<>(selected.values())); clientServerEventService .sendFileTrackingSuspendEvent() .then( successful -> { client .organizeImports(organizeImports) .then( result -> { applyWorkspaceEditAction.applyWorkspaceEdit(result.getWorkspaceEdit()); clientServerEventService.sendFileTrackingResumeEvent(); view.hide(); }) .catchError( error -> { String title = locale.failedToProcessOrganizeImports(); String message = error.getMessage(); notificationManager.notify(title, message, FAIL, FLOAT_MODE); clientServerEventService.sendFileTrackingResumeEvent(); view.hide(); }); }); }

Target:
public void onFinishButtonClicked() { selected.put(page, view.getSelectedImport()); OrganizeImportParams organizeImports = dtoFactory.createDto(OrganizeImportParams.class); organizeImports.setResourceUri(file.getLocation().toString()); organizeImports.setChoices(new ArrayList<>(selected.values())); clientServerEventService .sendFileTrackingSuspendEvent() .then( successful -> { client .organizeImports(organizeImports) .then( result -> { try { applyWorkspaceEditAction.applyWorkspaceEdit(result.getWorkspaceEdit()); } finally { clientServerEventService.sendFileTrackingResumeEvent(); view.hide(); } }) .catchError( error -> { try { String title = locale.failedToProcessOrganizeImports(); String message = error.getMessage(); notificationManager.notify(title, message, FAIL, FLOAT_MODE); } finally { clientServerEventService.sendFileTrackingResumeEvent(); view.hide(); } }); }); }
Source:
public float getProgress() throws IOException, InterruptedException { if (recordReadersCount < 1) { return 1.0f; } return ((float) currentRecordReader.getProgress() / (float) recordReadersCount) + ((float) currentRecordReaderIndex / (float) recordReadersCount); }

Target:
public float getProgress() throws IOException, InterruptedException { if (recordReadersCount < 1) { return 1.0f; } return (currentRecordReader.getProgress() / splitLengths[currentRecordReaderIndex]) + (cumulativeSplitLengths[currentRecordReaderIndex] / totalSplitLengths); }
Source:
public void onFinish(final ISuite suite) { if (!DRY_RUN_ENABLED) { return; } final String[] sortedTests = observedTests.toArray(new String[0]); Arrays.sort(sortedTests); LOG.info("DRY-RUN: Listing ["+ sortedTests.length +"] tests that would have run"); for (final String testNameAndParams : sortedTests) { LOG.info(testNameAndParams); } }

Target:
public void onFinish(final ISuite suite) { if (!DRY_RUN_ENABLED) { return; } if (LOG.isInfoEnabled()) { LOG.info("DRY-RUN: Listing tests that would have run", observedTests.size()); try (Stream<String> stream = observedTests.stream()) { stream.sorted().forEach(LOG::info); } } }
Source:
void onAdd(ClickEvent e) { String hashtag = hashtagTextBox.getText(); while (hashtag.startsWith("#")) { hashtag = hashtag.substring(1); } if (!hashtag.isEmpty()) { addHashtag(hashtag); } }

Target:
void onAdd(ClickEvent e) { String hashtag = hashtagTextBox.getText(); if (!hashtag.isEmpty()) { addHashtag(hashtag); } }
Source:
public void destroy() { executor.shutdown(); try { if (!executor.awaitTermination(SHUTDOWN_TIMEOUT_SECONDS, TimeUnit.SECONDS)) { executor.shutdownNow(); if (!executor.awaitTermination(SHUTDOWN_TIMEOUT_SECONDS, TimeUnit.SECONDS)) { LOGGER.error("Thread pool didn't terminate"); } } } catch (InterruptedException e) { executor.shutdownNow(); Thread.currentThread().interrupt(); } }

Target:
public void destroy() { executor.shutdown(); try { if (!executor.awaitTermination(SHUTDOWN_TIMEOUT_SECONDS, TimeUnit.SECONDS)) { executor.shutdownNow(); if (!executor.awaitTermination(SHUTDOWN_TIMEOUT_SECONDS, TimeUnit.SECONDS)) { LOGGER.error( "Identity node initialization thread didn't terminate. This thread will continue until a system restart."); } } } catch (InterruptedException e) { executor.shutdownNow(); Thread.currentThread().interrupt(); } }
Source:
public String getDefinitionSetId() { return BPMNDefinitionSet.class.getName(); }

Target:
public String getDefinitionSetId() { return BindableAdapterUtils.getDefinitionSetId(BPMNDefinitionSet.class); }
Source:
public void testDefaultName() throws IOException { when(event.getThrowableProxy()).thenReturn(throwableProxy); when(throwableProxy.getThrowable()).thenReturn(new Exception("test error")); provider.writeTo(generator, event); verify(generator).writeStringField(eq(StackHashJsonProvider.FIELD_NAME), anyString()); }

Target:
public void testDefaultName() throws IOException { when(event.getThrowableProxy()).thenReturn(throwableProxy); when(throwableProxy.getThrowable()).thenReturn(new Exception("test error")); provider.writeTo(generator, event); ArgumentCaptor<String> hashCaptor = ArgumentCaptor.forClass(String.class); verify(generator).writeStringField(eq(StackHashJsonProvider.FIELD_NAME), hashCaptor.capture()); Assert.assertTrue("Did not produce an hexadecimal integer: "+hashCaptor.getValue(), HEX_PATTERN.matcher(hashCaptor.getValue()).matches()); }
Source:
public void visit(GranuleDescriptor granuleDescriptor, SimpleFeature sf) { final Geometry bb = JTS.toGeometry((BoundingBox) mosaicBBox); Geometry inclusionGeometry = granuleDescriptor.getFootprint(); boolean intersects = false; if (inclusionGeometry != null) { CoordinateReferenceSystem granuleCRS = granuleDescriptor.getGranuleEnvelope().getCoordinateReferenceSystem(); CoordinateReferenceSystem mosaicCRS = mosaicBBox.getCoordinateReferenceSystem(); try { if(!CRS.equalsIgnoreMetadata(granuleCRS, mosaicCRS)) { MathTransform mt = CRS.findMathTransform(granuleCRS, mosaicCRS); inclusionGeometry = JTS.transform(inclusionGeometry, mt); } } catch (FactoryException | MismatchedDimensionException | TransformException e) { intersects = true; } intersects = inclusionGeometry.intersects(bb); } if (!footprintBehavior.handleFootprints() || inclusionGeometry == null || (footprintBehavior.handleFootprints() && intersects)) { boolean found = false; for (SubmosaicProducer submosaicProducer : granuleCollectors) { if (submosaicProducer.accept(granuleDescriptor)) { granulesNumber++; found = true; break; } } if (!found && getExcessGranuleRemover() == null) { throw new IllegalStateException("Unable to locate a filter for this granule:\n" + granuleDescriptor.toString()); } } else { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine("We rejected for non ROI inclusion the granule " + granuleDescriptor.toString()); } } }

Target:
public void visit(GranuleDescriptor granuleDescriptor, SimpleFeature sf) { final Geometry bb = JTS.toGeometry((BoundingBox) mosaicBBox); Geometry inclusionGeometry = granuleDescriptor.getFootprint(); boolean intersects = false; if (inclusionGeometry != null) { CoordinateReferenceSystem granuleCRS = granuleDescriptor.getGranuleEnvelope().getCoordinateReferenceSystem(); CoordinateReferenceSystem mosaicCRS = mosaicBBox.getCoordinateReferenceSystem(); try { if(!CRS.equalsIgnoreMetadata(granuleCRS, mosaicCRS)) { MathTransform mt = CRS.findMathTransform(granuleCRS, mosaicCRS); inclusionGeometry = JTS.transform(inclusionGeometry, mt); } intersects = inclusionGeometry.intersects(bb); } catch (FactoryException | MismatchedDimensionException | TransformException e) { intersects = true; } } if (!footprintBehavior.handleFootprints() || inclusionGeometry == null || (footprintBehavior.handleFootprints() && intersects)) { boolean found = false; for (SubmosaicProducer submosaicProducer : granuleCollectors) { if (submosaicProducer.accept(granuleDescriptor)) { granulesNumber++; found = true; break; } } if (!found && getExcessGranuleRemover() == null) { throw new IllegalStateException("Unable to locate a filter for this granule:\n" + granuleDescriptor.toString()); } } else { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine("We rejected for non ROI inclusion the granule " + granuleDescriptor.toString()); } } }
Source:
private AuditLogableBase createAuditLog(final VmNic iface) { AuditLogableBase logable = new AuditLogableBase(); logable.setVmId(iface.getVmId()); logable.addCustomValue("MACAddr", iface.getMacAddress()); logable.addCustomValue("IfaceName", iface.getName()); return logable; }

Target:
private AuditLogableBase createAuditLog(final VmNic iface) { AuditLogableBase logable = new AuditLogableBase(); logable.addCustomValue("MACAddr", iface.getMacAddress()); logable.addCustomValue("IfaceName", iface.getName()); return logable; }
Source:
public Translation getTranslation() { return new SpongeTranslation("itemGroup." + this.tabLabel); }

Target:
public Translation getTranslation() { if (this.translation == null) { this.translation = new SpongeTranslation("itemGroup." + this.tabLabel); } return this.translation; }
Source:
private void writeObject(Schema schema, GenericRecord datum) throws Exception { BinaryEncoder encoder = EncoderFactory.get().binaryEncoder(new ByteArrayOutputStream(5), null); GenericDatumWriter<GenericData.Record> writter = new GenericDatumWriter<GenericData.Record>(schema); writter.write(schema, datum, encoder); }

Target:
private void writeObject(Schema schema, GenericRecord datum) throws Exception { BinaryEncoder encoder = EncoderFactory.get().binaryEncoder(new ByteArrayOutputStream(), null); GenericDatumWriter<GenericData.Record> writer = new GenericDatumWriter<GenericData.Record>(schema); writer.write(schema, datum, encoder); }
Source:
public void init() { if (campaign != null) { tvTitle.setText(campaign.getTitle()); tvDescription.setText(campaign.getDescription()); SimpleDateFormat inputDateFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()); SimpleDateFormat outputDateFormat = new SimpleDateFormat("dd MMM", Locale.getDefault()); try { Date startDate = inputDateFormat.parse(campaign.getStartDate()); Date endDate = inputDateFormat.parse(campaign.getEndDate()); tvDates.setText(String.format("%1s - %2s", outputDateFormat.format(startDate), outputDateFormat.format(endDate))); } catch (ParseException e) { e.printStackTrace(); } } }

Target:
public void init() { if (campaign != null) { tvTitle.setText(campaign.getTitle()); tvDescription.setText(campaign.getDescription()); SimpleDateFormat inputDateFormat = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat outputDateFormat = new SimpleDateFormat("dd MMM"); try { Date startDate = inputDateFormat.parse(campaign.getStartDate()); Date endDate = inputDateFormat.parse(campaign.getEndDate()); tvDates.setText(String.format("%1s - %2s", outputDateFormat.format(startDate), outputDateFormat.format(endDate))); } catch (ParseException e) { e.printStackTrace(); } } }
Source:
public static String nameFromCppFilt(String symbol) { try { return (new CPPFilt().getFunction(Objects.requireNonNull(symbol))); } catch (IOException e) { Activator.logError("Error to instantiate the c++filt", e); } return symbol; }

Target:
public static @Nullable String nameFromCppFilt(String symbol) { try { String functionName = new CPPFilt().getFunction(symbol); return functionName != null ? functionName : symbol; } catch (IOException e) { Activator.logError("Error to instantiate the c++filt", e); return symbol; } }
Source:
public void read(int length) { this.read += length; if (this.read > this.limit) { throw new IllegalStateException("Readed more than " + this.limit + " bytes from NBT tag"); } }

Target:
public void read(int length) { this.read += length; if (this.read > this.limit) { throw new IllegalStateException("Read more than " + this.limit + " bytes from NBT tag"); } }
Source:
public JettyIoPool get() { if (pool == null) { JettyIoPoolConfig config = injector.getInstance(keyFromNullable(JettyIoPoolConfig.class, annotation)); pool = new JettyIoPool(name, config); if(injector.getExistingBinding(Key.get(MBeanExporter.class)) != null) { injector.getInstance(MBeanExporter.class) .export(generatedNameOf(QueuedThreadPoolMBean.class) + "_" + name, new QueuedThreadPoolMBean((QueuedThreadPool) get().getExecutor())); } } return pool; }

Target:
public JettyIoPool get() { if (pool == null) { JettyIoPoolConfig config = injector.getInstance(keyFromNullable(JettyIoPoolConfig.class, annotation)); pool = new JettyIoPool(name, config); } return pool; }
Source:
public void onRequestFilled(AdColonyAdView adColonyAdView) { if (_adapter != null) { _adapter.setAdView(adColonyAdView); notifyAdLoaded(); } }

Target:
public void onRequestFilled(AdColonyAdView adColonyAdView) { if (_adapter != null) { _adapter.setAdView(adColonyAdView); _mediationBannerListener.onAdLoaded(_adapter); } }
Source:
public void preRenderProcess(Request request, Response response, RendererEditorState<?> state) { super.preRenderProcess(request,response,state); if (!request.isPartial() && isInited()) EventQueue.queue(new EventQueueElement() { @Override public void fire() { _id=request.getParameter("id"); _setupUI(); } @Override public int getEventPriority() { return 0; } }); }

Target:
public void preRenderProcess(Request request, Response response, RendererEditorState<?> state) { super.preRenderProcess(request,response,state); if (!request.isPartial()) EventQueue.queue(new EventQueueElement() { @Override public void fire() { _slug=request.getParameter("slug"); _setupUI(); } @Override public int getEventPriority() { return 0; } }); }
Source:
public void close() { for (FileObject file : Arrays.asList(this.files)) { monitor.removeFile(file); } executor.shutdownNow(); monitor.stop(); }

Target:
public void close() { forEachCatchRTEs(Stream.of(files), o -> { removeFile(o); log.debug("Removing file from monitoring {}", o); }); executor.shutdownNow(); monitor.stop(); }
Source:
private static List<CopyArtifact> getCopiers(AbstractProject<?,?> project) throws IOException { List<CopyArtifact> copiers = CopyArtifact.getCopiers(project); for (CopyArtifact copier : copiers) { copier.upgradeIfNecessary(project); } return copiers; }

Target:
private static List<CopyArtifact> getCopiers(AbstractProject<?,?> project) throws IOException { List<CopyArtifact> copiers = CopyArtifact.getCopyArtifactsInProject(project); for (CopyArtifact copier : copiers) { copier.upgradeIfNecessary(project); } return copiers; }
Source:
public void testIllegalPackagesAndClassesRegularExpression() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(IllegalImportCheck.class); checkConfig.addAttribute("illegalPkgs", "^java\\.util.*"); checkConfig.addAttribute("illegalClasses", "^com\\.puppycrawl\\.tools\\.checkstyle\\.Checker.*"); checkConfig.addAttribute("regexp", "true"); final String[] expected = { "12:1: " + getCheckMessage(MSG_KEY, "java.util.List"), "13:1: " + getCheckMessage(MSG_KEY, "java.util.List"), "16:1: " + getCheckMessage(MSG_KEY, "java.util.Enumeration"), "17:1: " + getCheckMessage(MSG_KEY, "java.util.Arrays"), "34:1: " + getCheckMessage(MSG_KEY, "java.util.Date"), "35:1: " + getCheckMessage(MSG_KEY, "java.util.Calendar"), "36:1: " + getCheckMessage(MSG_KEY, "java.util.BitSet"), "38:1: " + getCheckMessage(MSG_KEY, "com.puppycrawl.tools.checkstyle.Checker"), "39:1: " + getCheckMessage(MSG_KEY, "com.puppycrawl.tools.checkstyle.CheckerTest"), }; verify(checkConfig, getPath("InputIllegalImport.java"), expected); }

Target:
public void testIllegalPackagesAndClassesRegularExpression() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(IllegalImportCheck.class); checkConfig.addAttribute("illegalPkgs", "java\\.util"); checkConfig.addAttribute("illegalClasses", "^com\\.puppycrawl\\.tools\\.checkstyle\\.Checker.*"); checkConfig.addAttribute("regexp", "true"); final String[] expected = { "12:1: " + getCheckMessage(MSG_KEY, "java.util.List"), "13:1: " + getCheckMessage(MSG_KEY, "java.util.List"), "16:1: " + getCheckMessage(MSG_KEY, "java.util.Enumeration"), "17:1: " + getCheckMessage(MSG_KEY, "java.util.Arrays"), "34:1: " + getCheckMessage(MSG_KEY, "java.util.Date"), "35:1: " + getCheckMessage(MSG_KEY, "java.util.Calendar"), "36:1: " + getCheckMessage(MSG_KEY, "java.util.BitSet"), "38:1: " + getCheckMessage(MSG_KEY, "com.puppycrawl.tools.checkstyle.Checker"), "39:1: " + getCheckMessage(MSG_KEY, "com.puppycrawl.tools.checkstyle.CheckerTest"), }; verify(checkConfig, getPath("InputIllegalImport.java"), expected); }
Source:
public String exportVm(VM vm, FullEntityOvfData fullEntityOvfData, Version version) { updateBootOrderOnDevices(vm.getStaticData(), false); final OvfVmWriter vmWriter; if (vm.isHostedEngine()) { Cluster cluster = clusterDao.get(vm.getClusterId()); String cpuVerb = cluster.getCpuVerb(); String engineXml = null; engineXml = generateEngineXml(vm, cpuVerb, cluster.getEmulatedMachine()); vmWriter = new HostedEngineOvfWriter(vm, fullEntityOvfData, version, cluster.getEmulatedMachine(), cpuVerb, osRepository, engineXml); } else { vmWriter = new OvfVmWriter(vm, fullEntityOvfData, version, osRepository, getMemoryDiskForSnapshots(vm)); } return vmWriter.build().getStringRepresentation(); }

Target:
public String exportVm(VM vm, FullEntityOvfData fullEntityOvfData, Version version) { updateBootOrderOnDevices(vm.getStaticData(), false); final OvfVmWriter vmWriter; if (vm.isHostedEngine()) { Cluster cluster = clusterDao.get(vm.getClusterId()); String cpuVerb = cluster.getCpuVerb(); vmWriter = new HostedEngineOvfWriter(vm, fullEntityOvfData, version, cluster.getEmulatedMachine(), cpuVerb, osRepository, generateEngineXml(vm, cpuVerb, cluster.getEmulatedMachine())); } else { vmWriter = new OvfVmWriter(vm, fullEntityOvfData, version, osRepository, getMemoryDiskForSnapshots(vm)); } return vmWriter.build().getStringRepresentation(); }
Source:
private Future<Boolean> subscribeTransactionStream() { ExecutorService consumer = Executors.newSingleThreadExecutor(); List<CorfuRuntime> consumerRts = new ArrayList<>(); return consumer.submit(() -> { CorfuRuntime consumerRt = CorfuRuntime.fromParameters(CorfuRuntime.CorfuRuntimeParameters .builder() .build()) .parseConfigurationString(standbyEndpoint) .connect(); consumerRts.add(consumerRt); IStreamView txStream = consumerRt.getStreamsView().get(ObjectsView.TRANSACTION_STREAM_ID); int counter = 0; while (!replicationEnded.get()) { List<ILogData> entries = txStream.remaining(); if (!entries.isEmpty()) { log.error("Transaction Log Entry Found. Entries={}", entries); counter++; } } System.out.println("Total Transaction Stream updates, count=" + counter); log.info("Total Tx Stream updates = {}", counter); return counter == 0; }); }

Target:
private Future<Boolean> subscribeTransactionStream() { ExecutorService consumer = Executors.newSingleThreadExecutor(); List<CorfuRuntime> consumerRts = new ArrayList<>(); return consumer.submit(() -> { CorfuRuntime consumerRt = CorfuRuntime.fromParameters(CorfuRuntime.CorfuRuntimeParameters .builder() .build()) .parseConfigurationString(standbyEndpoint) .connect(); consumerRts.add(consumerRt); IStreamView txStream = consumerRt.getStreamsView().get(ObjectsView.TRANSACTION_STREAM_ID); int counter = 0; while (!replicationEnded.get()) { List<ILogData> entries = txStream.remaining(); if (!entries.isEmpty()) { log.error("Transaction Log Entry Found. Entries={}", entries); counter++; } } System.out.println("Total Transaction Stream updates, count=" + counter); log.info("Total Tx Stream updates = {}", counter); return counter == 1; }); }
Source:
public boolean hasCorrectData() { if (firstTechnology != null && secondTechnology != null) { return true; } return false; }

Target:
public boolean hasCorrectData() { return firstTechnology != null && secondTechnology != null; }