auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void setOutputName(IModule module, String name) throws IllegalStateException { verifyWorkingCopy(); DeploymentPreferences prefs = DeploymentPreferencesLoader.loadPreferencesFromServer(getServerOrWC()); DeploymentModulePrefs modPrefs = prefs.getOrCreatePreferences().getOrCreateModulePrefs(module); modPrefs.setProperty(IJBossToolingConstants.LOCAL_DEPLOYMENT_OUTPUT_NAME, name); DeploymentPreferencesLoader.savePreferencesToServerWorkingCopy(getWorkingCopy(), prefs); }

Target:
public void setOutputName(IModule module, String name) throws IllegalStateException { setModuleDeploymentPreference(module, IJBossToolingConstants.LOCAL_DEPLOYMENT_OUTPUT_NAME, name); }
Source:
public ImmutableSetMultimap<String, String> getRefs(Collection<String> entityIds) { UpdateBuilder b = new UpdateBuilder(getRefs); b.bindUris("entityList", entityIds); b.bind("uris.statement", uris.statement()); b.bindUri("prov:wasDerivedFrom", Provenance.WAS_DERIVED_FROM); return rdfClient.resultToMap(rdfClient.query(b.toString()), "entity", "s"); }

Target:
public ImmutableSetMultimap<String, String> getRefs(Collection<String> entityIds) { UpdateBuilder b = new UpdateBuilder(getRefs); b.bindUris("entityList", entityIds); b.bind("uris.statement", uris.statement()); b.bindUri("prov:wasDerivedFrom", Provenance.WAS_DERIVED_FROM); return rdfClient.selectToMap(b.toString(), "entity", "s"); }
Source:
public boolean match(Name name, Name group) { if (patterns.stream().anyMatch(pattern -> group.getUrn().startsWith(pattern))) { return true; } if (match(name)) { return true; } return false; }

Target:
public boolean match(Name name, Name group) { if (patterns.stream().anyMatch(pattern -> group.getUrn().startsWith(pattern))) { return true; } return match(name); }
Source:
private InputStream filterClean(InputStream in, OperationType opType) throws IOException { in = handleAutoCRLF(in, opType); String filterCommand = getCleanFilterCommand(); if (filterCommand != null) { if (Repository.isRegistered(filterCommand)) { LocalFile buffer = new TemporaryBuffer.LocalFile(null); FilterCommand command = Repository.getCommand(filterCommand, repository, in, buffer); while (command.run() != -1) { } return buffer.openInputStream(); } FS fs = repository.getFS(); ProcessBuilder filterProcessBuilder = fs.runInShell(filterCommand, new String[0]); filterProcessBuilder.directory(repository.getWorkTree()); filterProcessBuilder.environment().put(Constants.GIT_DIR_KEY, repository.getDirectory().getAbsolutePath()); ExecutionResult result; try { result = fs.execute(filterProcessBuilder, in); } catch (IOException | InterruptedException e) { throw new IOException(new FilterFailedException(e, filterCommand, getEntryPathString())); } int rc = result.getRc(); if (rc != 0) { throw new IOException(new FilterFailedException(rc, filterCommand, getEntryPathString(), result.getStdout().toByteArray(MAX_EXCEPTION_TEXT_SIZE), RawParseUtils.decode(result.getStderr() .toByteArray(MAX_EXCEPTION_TEXT_SIZE)))); } return result.getStdout().openInputStream(); } return in; }

Target:
private InputStream filterClean(InputStream in, OperationType opType) throws IOException { in = handleAutoCRLF(in, opType); String filterCommand = getCleanFilterCommand(); if (filterCommand != null) { if (Repository.isRegistered(filterCommand)) { LocalFile buffer = new TemporaryBuffer.LocalFile(null); FilterCommand command = Repository.getFilterCommand(filterCommand, repository, in, buffer); while (command.run() != -1) { } return buffer.openInputStream(); } FS fs = repository.getFS(); ProcessBuilder filterProcessBuilder = fs.runInShell(filterCommand, new String[0]); filterProcessBuilder.directory(repository.getWorkTree()); filterProcessBuilder.environment().put(Constants.GIT_DIR_KEY, repository.getDirectory().getAbsolutePath()); ExecutionResult result; try { result = fs.execute(filterProcessBuilder, in); } catch (IOException | InterruptedException e) { throw new IOException(new FilterFailedException(e, filterCommand, getEntryPathString())); } int rc = result.getRc(); if (rc != 0) { throw new IOException(new FilterFailedException(rc, filterCommand, getEntryPathString(), result.getStdout().toByteArray(MAX_EXCEPTION_TEXT_SIZE), RawParseUtils.decode(result.getStderr() .toByteArray(MAX_EXCEPTION_TEXT_SIZE)))); } return result.getStdout().openInputStream(); } return in; }
Source:
public String generateSpecfile() { StringBuilder buffer = new StringBuilder(); generateSiteLibSiteArch(buffer); String packageName = model.getPackageName(); buffer.append("Name: " + packageName.toLowerCase() + "\n"); buffer.append("Version: " + model.getVersion() + "\n"); buffer.append("Release: 1%{?dist}" + "\n"); buffer.append("Summary: " + model.getSummary() + "\n\n"); buffer.append("Group: Development/Libraries\n"); buffer.append("License: " + model.getLicense() + "\n"); buffer.append("URL: " + model.getURL() + "\n"); buffer.append("Source0: #FIXME\n\n"); buffer.append("BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)" + "\n\n"); buffer.append("BuildArch: noarch\n"); generateRequires(buffer); buffer.append("\n%description\n" + model.getDescription() + "\n\n"); generatePython3SubPackage(buffer); generatePrepSection(buffer); generateBuildSection(buffer); generateInstallSection(buffer); generateCleanSection(buffer); generateFilesSections(buffer); generateChangelog(buffer); return buffer.toString(); }

Target:
public String generateSpecfile() { StringBuilder buffer = new StringBuilder(); generateSiteLibSiteArch(buffer); String packageName = model.getPackageName(); buffer.append("Name: " + packageName.toLowerCase() + "\n"); buffer.append("Version: " + model.getVersion() + "\n"); buffer.append("Release: 1%{?dist}" + "\n"); buffer.append("Summary: " + model.getSummary() + "\n\n"); buffer.append("Group: Development/Libraries\n"); buffer.append("License: " + model.getLicense() + "\n"); buffer.append("URL: " + model.getURL() + "\n"); buffer.append("Source0: #FIXME\n\n"); buffer.append("BuildArch: noarch\n"); generateRequires(buffer); buffer.append("\n%description\n" + model.getDescription() + "\n\n"); generatePython3SubPackage(buffer); generatePrepSection(buffer); generateBuildSection(buffer); generateInstallSection(buffer); generateFilesSections(buffer); generateChangelog(buffer); return buffer.toString(); }
Source:
public Iterable<TmfAbstractAnalysisRequirement> getAnalysisRequirements() { return REQUIREMENTS; }

Target:
public Iterable<TmfAbstractAnalysisRequirement> getAnalysisRequirements() { return Collections.emptySet(); }
Source:
public void scan() throws IOException { if (!rowGroupOpen) { openRowGroup(); } beginScan(presentStream, null); QualifyingSet input = inputQualifyingSet; QualifyingSet output = outputQualifyingSet; int end = input.getEnd(); int rowsInRange = end - posInRowGroup; int valuesSize = end; int[] inputPositions = input.getPositions(); if (filter != null) { output.reset(rowsInRange); } if (values == null || values.length < valuesSize) { values = new byte[valuesSize]; } if (dataStream == null) { processAllNulls(); endScan(presentStream); return; } int nextActive = inputPositions[0]; int activeIdx = 0; int toSkip = 0; for (int i = 0; i < rowsInRange; i++) { if (i + posInRowGroup == nextActive) { if (nextActive == truncationRow) { break; } if (presentStream != null && !present[i]) { if (filter == null || filter.testNull()) { if (filter != null) { output.append(i + posInRowGroup, activeIdx); } addNullResult(); } } else { if (toSkip > 0) { dataStream.skip(toSkip); } byte value = dataStream.next(); if (filter != null) { if (filter.testLong(value)) { output.append(i + posInRowGroup, activeIdx); addResult(value); } } else { addResult(value); } } if (++activeIdx == input.getPositionCount()) { toSkip = countPresent(i + 1, end - posInRowGroup); break; } nextActive = inputPositions[activeIdx]; if (outputChannel != -1 && numResults > resultSizeBudget) { truncationRow = inputQualifyingSet.truncateAndReturnTruncationRow(activeIdx); } continue; } else { if (presentStream == null || present[i]) { toSkip++; } } } if (toSkip > 0) { dataStream.skip(toSkip); } endScan(presentStream); }

Target:
public void scan() throws IOException { if (!rowGroupOpen) { openRowGroup(); } beginScan(presentStream, null); QualifyingSet input = inputQualifyingSet; QualifyingSet output = outputQualifyingSet; int end = input.getEnd(); int rowsInRange = end - posInRowGroup; int[] inputPositions = input.getPositions(); if (filter != null) { output.reset(rowsInRange); } ensureValuesCapacity(end, false); if (dataStream == null) { processAllNulls(); endScan(presentStream); return; } int nextActive = inputPositions[0]; int activeIdx = 0; int toSkip = 0; for (int i = 0; i < rowsInRange; i++) { if (i + posInRowGroup == nextActive) { if (nextActive == truncationRow) { break; } if (presentStream != null && !present[i]) { if (filter == null || filter.testNull()) { if (filter != null) { output.append(i + posInRowGroup, activeIdx); } addNullResult(); } } else { if (toSkip > 0) { dataStream.skip(toSkip); } byte value = dataStream.next(); if (filter != null) { if (filter.testLong(value)) { output.append(i + posInRowGroup, activeIdx); addResult(value); } } else { addResult(value); } } if (++activeIdx == input.getPositionCount()) { toSkip = countPresent(i + 1, end - posInRowGroup); break; } nextActive = inputPositions[activeIdx]; if (outputChannelSet && numResults > resultSizeBudget) { truncationRow = inputQualifyingSet.truncateAndReturnTruncationRow(activeIdx); } continue; } else { if (presentStream == null || present[i]) { toSkip++; } } } if (toSkip > 0) { dataStream.skip(toSkip); } endScan(presentStream); }
Source:
public void forceHealthChecks() { for (HealthCheck healthCheck : _badEndPoints.values()) { healthCheck.run(); } }

Target:
void forceHealthChecks() { for (HealthCheck healthCheck : _badEndPoints.values()) { healthCheck.run(); } }
Source:
public Set<APIKey> getKeyMappingsFromApplicationId(int applicationId) throws APIManagementException{ final String query = "SELECT UUID,CONSUMER_KEY,KEY_MANAGER,KEY_TYPE,STATE,APP_INFO FROM AM_APPLICATION_KEY_MAPPING " + "WHERE APPLICATION_ID=?"; Set<APIKey> apiKeyList = new HashSet<>(); try(Connection connection = APIMgtDBUtil.getConnection(); PreparedStatement preparedStatement = connection.prepareStatement(query)){ preparedStatement.setInt(1,applicationId); try(ResultSet resultSet = preparedStatement.executeQuery()){ while (resultSet.next()){ APIKey apiKey = new APIKey() ; apiKey.setMappingId(resultSet.getString("UUID")); apiKey.setConsumerKey(resultSet.getString("CONSUMER_KEY")); apiKey.setKeyManager(resultSet.getString("KEY_MANAGER")); apiKey.setType(resultSet.getString("KEY_TYPE")); apiKey.setState(resultSet.getString("STATE")); try (InputStream appInfo = resultSet.getBinaryStream("APP_INFO")) { if (appInfo != null){ apiKey.setAppMetadata(IOUtils.toString(appInfo)); } } catch (IOException e) { log.error("Error while retrieving metadata", e); } apiKeyList.add(apiKey); } } } catch (SQLException e) { throw new APIManagementException("Error while Retrieving Key Mappings ",e); } return apiKeyList; }

Target:
public Set<APIKey> getKeyMappingsFromApplicationId(int applicationId) throws APIManagementException { Set<APIKey> apiKeyList = new HashSet<>(); try (Connection connection = APIMgtDBUtil.getConnection(); PreparedStatement preparedStatement = connection .prepareStatement(SQLConstants.GET_KEY_MAPPING_INFO_FROM_APP_ID)) { preparedStatement.setInt(1, applicationId); try (ResultSet resultSet = preparedStatement.executeQuery()) { while (resultSet.next()) { APIKey apiKey = new APIKey(); apiKey.setMappingId(resultSet.getString("UUID")); apiKey.setConsumerKey(resultSet.getString("CONSUMER_KEY")); apiKey.setKeyManager(resultSet.getString("KEY_MANAGER")); apiKey.setType(resultSet.getString("KEY_TYPE")); apiKey.setState(resultSet.getString("STATE")); try (InputStream appInfo = resultSet.getBinaryStream("APP_INFO")) { if (appInfo != null) { apiKey.setAppMetaData(IOUtils.toString(appInfo)); } } catch (IOException e) { log.error("Error while retrieving metadata", e); } apiKeyList.add(apiKey); } } } catch (SQLException e) { throw new APIManagementException("Error while Retrieving Key Mappings ", e); } return apiKeyList; }
Source:
public static Launcher create(LauncherConfig config) throws PreconditionViolationException { List<TestEngine> engines = new ArrayList<>(); if (config.isTestEngineAutoRegistrationEnabled()) { new ServiceLoaderTestEngineRegistry().loadTestEngines().forEach(engines::add); } engines.addAll(config.getAdditionalTestEngines()); Launcher launcher = new DefaultLauncher(engines); if (config.isTestExecutionListenerAutoRegistrationEnabled()) { new ServiceLoaderTestExecutionListenerRegistry().loadListeners().forEach( launcher::registerTestExecutionListeners); } config.getAdditionalTestExecutionListeners().forEach(launcher::registerTestExecutionListeners); return launcher; }

Target:
public static Launcher create(LauncherConfig config) throws PreconditionViolationException { Preconditions.notNull(config, "configuration must not be null"); List<TestEngine> engines = new ArrayList<>(); if (config.isTestEngineAutoRegistrationEnabled()) { new ServiceLoaderTestEngineRegistry().loadTestEngines().forEach(engines::add); } engines.addAll(config.getAdditionalTestEngines()); Launcher launcher = new DefaultLauncher(engines); if (config.isTestExecutionListenerAutoRegistrationEnabled()) { new ServiceLoaderTestExecutionListenerRegistry().loadListeners().forEach( launcher::registerTestExecutionListeners); } config.getAdditionalTestExecutionListeners().forEach(launcher::registerTestExecutionListeners); return launcher; }
Source:
public OpenShiftProjectUIModel(IProject project) { super(); resourceModel = new OpenShiftResourceUIModel(project); System.out.println(this.hashCode()); }

Target:
public OpenShiftProjectUIModel(IProject project) { super(); resourceModel = new OpenShiftResourceUIModel(project); }
Source:
public void testLoadMetadataBlock_ErrorHandling() { Response createUser = UtilIT.createRandomUser(); String apiToken = UtilIT.getApiTokenFromResponse(createUser); byte[] updatedContent = null; try { updatedContent = Files.readAllBytes(Paths.get("src/test/resources/tsv/test.tsv")); } catch (IOException e) { logger.warning(e.getMessage()); assertEquals(0,1); } Response response = UtilIT.loadMetadataBlock(apiToken, updatedContent); assertEquals(500, response.getStatusCode()); response.then().assertThat().statusCode(INTERNAL_SERVER_ERROR.getStatusCode()); String body = response.getBody().asString(); String status = JsonPath.from(body).getString("status"); assertEquals("ERROR", status); String message = JsonPath.from(body).getString("message"); assertEquals( "Error parsing metadata block in DATASETFIELD part, line #5: missing 'watermark' cell (#5)", message ); }

Target:
public void testLoadMetadataBlock_ErrorHandling() { Response createUser = UtilIT.createRandomUser(); String apiToken = UtilIT.getApiTokenFromResponse(createUser); byte[] updatedContent = null; try { updatedContent = Files.readAllBytes(Paths.get("src/test/resources/tsv/test.tsv")); } catch (IOException e) { logger.warning(e.getMessage()); assertEquals(0,1); } Response response = UtilIT.loadMetadataBlock(apiToken, updatedContent); assertEquals(500, response.getStatusCode()); response.then().assertThat().statusCode(INTERNAL_SERVER_ERROR.getStatusCode()); String body = response.getBody().asString(); String status = JsonPath.from(body).getString("status"); assertEquals("ERROR", status); String message = JsonPath.from(body).getString("message"); assertEquals( "Error parsing metadata block in DATASETFIELD part, line #5: missing 'watermark' column (#5)", message ); }
Source:
public void stateChanged(Item item, State oldState, State newState) { setState(function.calculate(members)); setGroupState(new GroupType(item.getName(),GroupChange.CHANGED)); }

Target:
public void stateChanged(Item item, State oldState, State newState) { }
Source:
public void shouldEditAnAutoGenerationOption() throws Exception { assertEquals(LOCATION, identifierSourceService.getAutoGenerationOption(Integer.parseInt(getUuid())).getLocation().getUuid()); assertEquals(SOURCE, identifierSourceService.getAutoGenerationOption(Integer.parseInt(getUuid())).getSource().getUuid()); assertTrue( identifierSourceService.getAutoGenerationOption(Integer.parseInt(getUuid())).isAutomaticGenerationEnabled()); assertTrue(identifierSourceService.getAutoGenerationOption(Integer.parseInt(getUuid())).isManualEntryEnabled()); SimpleObject autoGenerationOption = new SimpleObject(); autoGenerationOption.add("location", NEW_LOCATION); autoGenerationOption.add("source", NEW_SOURCE); autoGenerationOption.add("manualEntryEnabled", false); autoGenerationOption.add("automaticGenerationEnabled", false); String json = new ObjectMapper().writeValueAsString(autoGenerationOption); MockHttpServletRequest req = request(RequestMethod.POST, getURI() + "/" + getUuid()); req.setContent(json.getBytes()); handle(req); assertEquals(NEW_LOCATION, identifierSourceService.getAutoGenerationOption(Integer.parseInt(getUuid())).getLocation().getUuid()); assertEquals(NEW_SOURCE, identifierSourceService.getAutoGenerationOption(Integer.parseInt(getUuid())).getSource().getUuid()); assertFalse( identifierSourceService.getAutoGenerationOption(Integer.parseInt(getUuid())).isAutomaticGenerationEnabled()); assertFalse(identifierSourceService.getAutoGenerationOption(Integer.parseInt(getUuid())).isManualEntryEnabled()); }

Target:
public void shouldEditAnAutoGenerationOption() throws Exception { AutoGenerationOption autogenerationOption = identifierSourceService.getAutoGenerationOption(getId()); assertEquals(LOCATION, autogenerationOption.getLocation().getUuid()); assertEquals(SOURCE, autogenerationOption.getSource().getUuid()); assertTrue(autogenerationOption.isAutomaticGenerationEnabled()); assertTrue(autogenerationOption.isManualEntryEnabled()); SimpleObject autoGenerationOption = new SimpleObject(); autoGenerationOption.add("location", NEW_LOCATION); autoGenerationOption.add("source", NEW_SOURCE); autoGenerationOption.add("manualEntryEnabled", false); autoGenerationOption.add("automaticGenerationEnabled", false); String json = new ObjectMapper().writeValueAsString(autoGenerationOption); MockHttpServletRequest req = request(RequestMethod.POST, getURI() + "/" + getUuid()); req.setContent(json.getBytes()); handle(req); AutoGenerationOption updatedAutogenerationOption = identifierSourceService.getAutoGenerationOption(getId()); assertEquals(NEW_LOCATION, updatedAutogenerationOption.getLocation().getUuid()); assertEquals(NEW_SOURCE, updatedAutogenerationOption.getSource().getUuid()); assertFalse(updatedAutogenerationOption.isAutomaticGenerationEnabled()); assertFalse(updatedAutogenerationOption.isManualEntryEnabled()); }
Source:
public Iterable<Location> listLocations() { List<Location> locations = new ArrayList<Location>(); Location loc = Location.create("westus", "westus", "westus", 20, 20); locations.add(loc); return locations; }

Target:
public Iterable<Location> listLocations() { List<Location> locations = api.getLocationApi().list(); List<ResourceProviderMetaData> resources = api.getResourceProviderApi().get("Microsoft.Compute"); final List<String> vmLocations = new ArrayList<String>(); for (ResourceProviderMetaData m : resources){ if (m.resourceType().equals("virtualMachines")){ vmLocations.addAll(m.locations()); break; } } Iterable<Location> result = Iterables.filter(locations, new Predicate<Location>() { @Override public boolean apply(Location input) { return vmLocations.contains(input.displayName()); } }); return result; }
Source:
List getNetworkInterfaces(VM vm){ List net = new ArrayList(); List<Device> nicDevices = vm.getDevicesByType(Device.DeviceType.NIC); for (Device device: nicDevices){ Map resultMap = new HashMap(); List templist = new ArrayList(); List templist2 = new ArrayList(); resultMap.put("name", "eth0"); templist.add("fe80::21a:4aff:fe16:2016"); templist.add("2620:52:0:2380:21a:4aff:fe16:2016"); resultMap.put("inet6", templist); templist2.add(vm.getIp()); resultMap.put("inet", templist2); resultMap.put("hw", vm.getMacAddress()); net.add(resultMap); break; } log.debug("network list is {}", net.toString()); return net; }

Target:
List getNetworkInterfaces(VM vm){ List net = new ArrayList(); Map resultMap = new HashMap(); List Inet6List = new ArrayList(); List Inet4List = new ArrayList(); resultMap.put("name", "eth0"); Inet6List.add("fe80::21a:4aff:fe16:2016"); Inet6List.add("2620:52:0:2380:21a:4aff:fe16:2016"); resultMap.put("inet6", Inet6List); Inet4List.add(vm.getIp()); resultMap.put("inet", Inet4List); resultMap.put("hw", vm.getMacAddress()); net.add(resultMap); log.debug("network list is {}", net.toString()); return net; }
Source:
public void verifyPerformance() { final OnmsNode node1 = m_populator.getNode1(); final IPAddressRange ipAddresses = new IPAddressRange("10.10.0.0", "10.10.255.255"); final Iterator<IPAddress> iterator = ipAddresses.iterator(); while (iterator.hasNext()) { IPAddress address = iterator.next(); OnmsIpInterface ipInterface = new OnmsIpInterface(); ipInterface.setNode(node1); ipInterface.setIpAddress(address.toInetAddress()); m_interfaceDao.save(ipInterface); } assertThat(m_interfaceDao.countAll(), greaterThan(255 * 255)); long start = System.currentTimeMillis(); m_dao.getActiveIPAddressList("IPADDR != '0.0.0.0'"); long diff = System.currentTimeMillis() - start; start = System.currentTimeMillis(); assertThat(m_dao.isValid("10.10.0.1", "IPADDR != '0.0.0.0'"), is(true)); long diff2 = System.currentTimeMillis() - start; assertThat(diff, greaterThan(diff2)); }

Target:
public void verifyPerformance() { final OnmsNode node1 = m_populator.getNode1(); final IPAddressRange ipAddresses = new IPAddressRange("10.10.0.0", "10.10.255.255"); final Iterator<IPAddress> iterator = ipAddresses.iterator(); while (iterator.hasNext()) { IPAddress address = iterator.next(); OnmsIpInterface ipInterface = new OnmsIpInterface(); ipInterface.setNode(node1); ipInterface.setIpAddress(address.toInetAddress()); m_interfaceDao.save(ipInterface); } final int numberOfInterfaces = m_interfaceDao.countAll(); assertThat(numberOfInterfaces, greaterThan(255 * 255)); assertThat(m_dao.getActiveIPAddressList("IPADDR != '0.0.0.0'"), Matchers.hasSize(numberOfInterfaces)); assertThat(m_dao.isValid("10.10.0.1", "IPADDR != '0.0.0.0'"), is(true)); }
Source:
public OutputToScreenNode(Context context) { super(context); displayResolutionDependentFBOs = context.get(DisplayResolutionDependentFBOs.class); worldRenderer = context.get(WorldRenderer.class); WorldRenderer worldRenderer = context.get(WorldRenderer.class); requiresCondition(() -> worldRenderer.getCurrentRenderStage() == MONO || worldRenderer.getCurrentRenderStage() == LEFT_EYE); addDesiredStateChange(new EnableMaterial(DEFAULT_TEXTURED_MATERIAL_URN)); bindFbo = new SetInputTextureFromFbo(0, FINAL_BUFFER, ColorTexture, displayResolutionDependentFBOs, DEFAULT_TEXTURED_MATERIAL_URN, "texture"); addDesiredStateChange(bindFbo); nodeInstance = this; SwappableFBO gBufferPair = displayResolutionDependentFBOs.getGBufferPair(); lastUpdatedGBuffer = gBufferPair.getLastUpdatedFbo(); staleGBuffer = gBufferPair.getStaleFbo(); }

Target:
public OutputToScreenNode(Context context) { super(context); displayResolutionDependentFBOs = context.get(DisplayResolutionDependentFBOs.class); worldRenderer = context.get(WorldRenderer.class); WorldRenderer worldRenderer = context.get(WorldRenderer.class); requiresCondition(() -> worldRenderer.getCurrentRenderStage() == MONO || worldRenderer.getCurrentRenderStage() == LEFT_EYE); addDesiredStateChange(new EnableMaterial(DEFAULT_TEXTURED_MATERIAL_URN)); bindFbo = new SetInputTextureFromFbo(0, FINAL_BUFFER, ColorTexture, displayResolutionDependentFBOs, DEFAULT_TEXTURED_MATERIAL_URN, "texture"); addDesiredStateChange(bindFbo); SwappableFBO gBufferPair = displayResolutionDependentFBOs.getGBufferPair(); lastUpdatedGBuffer = gBufferPair.getLastUpdatedFbo(); staleGBuffer = gBufferPair.getStaleFbo(); }
Source:
public void verifyLightboxVideo() { waitForElementByElement(videoContainer); PageObjectLogging.log("verifyLightboxVideo", "verify lightbox video appeared", true); }

Target:
public void verifyLightboxVideo() { waitForElementByElement(videoContainer); PageObjectLogging.log("verifyLightboxVideo", "Lightbox video appeared", true); }
Source:
public void setPortNumbers(int[] portNumbers) { this.portNumbers = portNumbers; }

Target:
public void setPortNumbers(int[] portNumbers) { if (portNumbers == null || portNumbers.length == 0) { portNumbers = new int[] { 0 }; } this.portNumbers = Arrays.copyOf(portNumbers, portNumbers.length); }
Source:
public String convert(DockerImageURI dockerImage) { String name = dockerImage.getName(); StringBuilder builder = new StringBuilder(name.length()); for(int i=0; i < name.length();++i) { char c = name.charAt(i); if (((c >= '0') && (c <= '9')) || ((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z'))) { builder.append(c); } else if (c == '_') { builder.append('-'); } } if (builder.length() > 24) { builder.delete(24, builder.length()); } return builder.toString(); }

Target:
public String convert(DockerImageURI dockerImage) { String name = dockerImage.getName(); StringBuilder builder = new StringBuilder(name.length()); boolean lastSpecialChar = true; for(int i=0; i < name.length() && builder.length() < MAXLENGTH;++i) { char c = name.charAt(i); if (((c >= '0') && (c <= '9')) || ((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z'))) { if ((c >= '0') && (c <= '9') && (builder.length() == 0)) { builder.append('a'); } builder.append(c); lastSpecialChar = false; } else if (((c == '_') || (c == '-')) && !lastSpecialChar) { builder.append('-'); lastSpecialChar = true; } } if ((builder.length() > 0) && lastSpecialChar) { builder.deleteCharAt(builder.length() - 1); } return builder.toString(); }
Source:
public static void register(ScalarFunctionModule module) { FunctionName name = new FunctionName(null, NAME); module.register( new FuncResolver( new Signature( name, FunctionInfo.Type.SCALAR, Collections.emptyList(), List.of(parseTypeSignature("text"), parseTypeSignature("text")), parseTypeSignature("text"), false), args -> new StringConcatFunction( new FunctionInfo( new FunctionIdent(NAME, args), DataTypes.STRING)) ) ); module.register( new FuncResolver( new Signature( name, FunctionInfo.Type.SCALAR, Collections.emptyList(), List.of(parseTypeSignature("text")), parseTypeSignature("text"), true), args -> new GenericConcatFunction( new FunctionInfo( new FunctionIdent(NAME, args), DataTypes.STRING)) ) ); Signature signature = new Signature( name, FunctionInfo.Type.SCALAR, List.of(typeVariable("E")), List.of(parseTypeSignature("array(E)"), parseTypeSignature("array(E)")), parseTypeSignature("array(E)"), false ); module.register( new FuncResolver( signature, args -> new ArrayCatFunction(ArrayCatFunction.createInfo(args)) ) ); }

Target:
public static void register(ScalarFunctionModule module) { module.register( Signature.builder() .name(NAME) .kind(FunctionInfo.Type.SCALAR) .argumentTypes(parseTypeSignature("text"), parseTypeSignature("text")) .returnType(parseTypeSignature("text")) .setVariableArity(false) .build(), args -> new StringConcatFunction( new FunctionInfo(new FunctionIdent(NAME, args), DataTypes.STRING) ) ); module.register( Signature.builder() .name(NAME) .kind(FunctionInfo.Type.SCALAR) .argumentTypes(parseTypeSignature("text")) .returnType(parseTypeSignature("text")) .setVariableArity(true) .build(), args -> new GenericConcatFunction( new FunctionInfo(new FunctionIdent(NAME, args), DataTypes.STRING) ) ); module.register( Signature.builder() .name(NAME) .kind(FunctionInfo.Type.SCALAR) .typeVariableConstraints(typeVariable("E")) .argumentTypes(parseTypeSignature("array(E)"), parseTypeSignature("array(E)")) .returnType(parseTypeSignature("array(E)")) .setVariableArity(false) .build(), args -> new ArrayCatFunction(ArrayCatFunction.createInfo(args)) ); }
Source:
private boolean mediate(MessageContext synCtx, String format) { if (!isDoingXml(synCtx) && !isDoingJson(synCtx)) { log.error("#mediate. Could not identify the payload format of the existing payload prior to mediate."); return false; } org.apache.axis2.context.MessageContext axis2MessageContext = ((Axis2MessageContext) synCtx).getAxis2MessageContext(); StringBuffer result = new StringBuffer(); StringBuffer resultCTX = new StringBuffer(); regexTransformCTX(resultCTX, synCtx, format); regexTransform(result, synCtx, resultCTX.toString()); String out = result.toString().trim(); if (log.isDebugEnabled()) { log.debug("#mediate. Transformed payload format>>> " + out); } if (mediaType.equals(XML_TYPE)) { try { JsonUtil.removeJsonPayload(axis2MessageContext); OMElement omXML = AXIOMUtil.stringToOM(out); if (!checkAndReplaceEnvelope(omXML, synCtx)) { axis2MessageContext.getEnvelope().getBody().addChild(omXML.getFirstElement().getFirstElement()); } } catch (XMLStreamException e) { handleException("Error creating SOAP Envelope from source " + out, synCtx); } } else if (mediaType.equals(JSON_TYPE)) { JsonUtil.newJsonPayload(axis2MessageContext, out, true, true); } else if (mediaType.equals(TEXT_TYPE)) { JsonUtil.removeJsonPayload(axis2MessageContext); axis2MessageContext.getEnvelope().getBody().addChild(getTextElement(out)); } setContentType(synCtx); return true; }

Target:
private boolean mediate(MessageContext synCtx, String format) { if (!isDoingXml(synCtx) && !isDoingJson(synCtx)) { log.error("#mediate. Could not identify the payload format of the existing payload prior to mediate."); return false; } org.apache.axis2.context.MessageContext axis2MessageContext = ((Axis2MessageContext) synCtx).getAxis2MessageContext(); StringBuffer result = new StringBuffer(); StringBuffer resultCTX = new StringBuffer(); regexTransformCTX(resultCTX, synCtx, format); replace(resultCTX.toString(),result, synCtx); String out = result.toString().trim(); if (log.isDebugEnabled()) { log.debug("#mediate. Transformed payload format>>> " + out); } if (mediaType.equals(XML_TYPE)) { try { JsonUtil.removeJsonPayload(axis2MessageContext); OMElement omXML = AXIOMUtil.stringToOM(out); if (!checkAndReplaceEnvelope(omXML, synCtx)) { axis2MessageContext.getEnvelope().getBody().addChild(omXML.getFirstElement()); } } catch (XMLStreamException e) { handleException("Error creating SOAP Envelope from source " + out, synCtx); } } else if (mediaType.equals(JSON_TYPE)) { JsonUtil.newJsonPayload(axis2MessageContext, out, true, true); } else if (mediaType.equals(TEXT_TYPE)) { JsonUtil.removeJsonPayload(axis2MessageContext); axis2MessageContext.getEnvelope().getBody().addChild(getTextElement(out)); } setContentType(synCtx); return true; }
Source:
public static void getRootCAList(StringWriter writer) { KeyStore instance = null; try { instance = KeyStore.getInstance(KeyStore.getDefaultType()); while (instance.aliases().hasMoreElements()) { String s = instance.aliases().nextElement(); writer.append("========"); writer.append("Alias: " + s); writer.append(instance.getCertificate(s).getPublicKey().toString()); writer.append("Trusted certificate: " + instance.isCertificateEntry(s)); } } catch (KeyStoreException e) { writer.write(ExceptionUtils.getFullStackTrace(e)); } }

Target:
public static void getRootCAList(StringWriter writer) { KeyStore instance = null; try { instance = KeyStore.getInstance(KeyStore.getDefaultType()); Enumeration<String> aliases = instance.aliases(); while (aliases.hasMoreElements()) { String s = aliases.nextElement(); writer.append("========"); writer.append("Alias: " + s); writer.append(instance.getCertificate(s).getPublicKey().toString()); writer.append("Trusted certificate: " + instance.isCertificateEntry(s)); } } catch (KeyStoreException e) { writer.write(Functions.printThrowable(e)); } }
Source:
private static Function<CompositeData, MemoryUsage> compositeDataToMemoryUsage() { return new Function<CompositeData, MemoryUsage>() { @Override public MemoryUsage apply(CompositeData input) { return (input == null) ? null : MemoryUsage.from(input); } }; }

Target:
public static Function<CompositeData, MemoryUsage> compositeDataToMemoryUsage() { return new Function<CompositeData, MemoryUsage>() { @Override public MemoryUsage apply(CompositeData input) { return (input == null) ? null : MemoryUsage.from(input); } }; }
Source:
private void produceCount(String brokerList, ArrayList<byte[]> monitorSet) { Properties props = new Properties(); props.put("metadata.broker.list", brokerList); props.put("producer.type", "async"); props.put("request.required.acks", "1"); props.put("request.timeout.ms", "30000"); log.debug("Broker list: " + brokerList); Producer producer = null; try { producer = createProducer(props); for (byte[] message : monitorSet) { for (int i = 0; i < NUM_TRIES_PUBLISH_COUNTS; i++) { try { KeyedMessage keyedMessage = new KeyedMessage("TrackingMonitoringEvent", message); producer.send(keyedMessage); break; } catch (Exception e) { log.error("Publishing count for topic " + topic + " to " + brokerList.toString() + " has failed " + (i + 1) + " times. " + (NUM_TRIES_PUBLISH_COUNTS - i - 1) + " more attempts will be made."); if (i == NUM_TRIES_PUBLISH_COUNTS - 1) { throw new RuntimeException(e.getMessage() + ": " + "Have retried maximum (" + NUM_TRIES_PUBLISH_COUNTS + ") times."); } try { Thread.sleep((long) (Math.random() * (i + 1) * 1000)); } catch (InterruptedException e1) { log.error("Caught interrupted exception between retries of publishing counts to Kafka. " + e1.getMessage()); } } } } } catch (Exception e) { throw new RuntimeException("failed to publish counts to kafka: " + e.getMessage()); } finally { if (producer != null) { producer.close(); } } }

Target:
private void produceCount(String brokerList, ArrayList<byte[]> monitorSet) { Properties props = new Properties(); props.put("metadata.broker.list", brokerList); props.put("producer.type", "async"); props.put("request.required.acks", "1"); props.put("request.timeout.ms", "30000"); log.debug("Broker list: " + brokerList); Producer producer = null; try { producer = createProducer(props); for (byte[] message : monitorSet) { for (int i = 0; i < NUM_TRIES_PUBLISH_COUNTS; i++) { try { KeyedMessage keyedMessage = new KeyedMessage("TrackingMonitoringEvent", message); producer.send(keyedMessage); break; } catch (Exception e) { log.error("Publishing count for topic " + topic + " to " + brokerList.toString() + " has failed " + (i + 1) + " times. " + (NUM_TRIES_PUBLISH_COUNTS - i - 1) + " more attempts will be made."); if (i == NUM_TRIES_PUBLISH_COUNTS - 1) { throw new RuntimeException(e.getMessage() + ": " + "Have retried maximum (" + NUM_TRIES_PUBLISH_COUNTS + ") times."); } try { Thread.sleep((long) (Math.random() * (i + 1) * 1000)); } catch (InterruptedException e1) { log.error("Caught interrupted exception between retries of publishing counts to Kafka. " + e1.getMessage()); } } } } } catch (Exception e) { throw new RuntimeException("failed to publish counts to kafka: " + e.getMessage(), e); } finally { if (producer != null) { producer.close(); } } }
Source:
public int getNextMessageId() { return currentMID.getAndIncrement() % TOTAL_NO_OF_MIDS; }

Target:
public int getNextMessageId() { return currentMID.getAndIncrement() & 0x0000FFFF; }
Source:
public JSONObject toJASON() throws JSONException { JSONObject rv = new JSONObject(); rv.put("type", type.ordinal()); rv.put("inputVal", inputVal); rv.put("autoChar", autoChar); rv.put("customChar", customChar); return rv; }

Target:
public JSONObject toJASON() throws JSONException { final JSONObject rv = new JSONObject(); rv.put("type", type.ordinal()); rv.put("inputVal", inputVal); rv.put("autoChar", autoChar); rv.put("customChar", customChar); return rv; }
Source:
public void stopWorkers() throws Exception { if (mWorkers == null) { return; } for (WorkerProcess worker : mWorkers) { worker.stop(); } for (Thread thread : mWorkerThreads) { while (thread.isAlive()) { LOG.info("Stopping thread {}.", thread.getName()); thread.interrupt(); thread.join(1000); } } mWorkerThreads.clear(); DefaultBlockMaster bm = (DefaultBlockMaster) getLocalAlluxioMaster().getMasterProcess() .getMaster(BlockMaster.class); bm.forgetAllWorkers(); }

Target:
public void stopWorkers() throws Exception { if (mWorkers == null) { return; } for (WorkerProcess worker : mWorkers) { worker.stop(); } for (Thread thread : mWorkerThreads) { while (thread.isAlive()) { LOG.info("Stopping thread {}.", thread.getName()); thread.interrupt(); thread.join(1000); } } mWorkerThreads.clear(); LocalAlluxioMaster master = getLocalAlluxioMaster(); if (master != null) { DefaultBlockMaster bm = (DefaultBlockMaster) master.getMasterProcess().getMaster(BlockMaster.class); bm.forgetAllWorkers(); } }
Source:
public static void notifyOutputAuthSuccessful(HttpMessage msg) { try { Stats.incCounter(SessionStructure.getHostName(msg), AUTH_SUCCESS_STATS); } catch (URIException e) { } if (View.isInitialised()) { View.getSingleton().getOutputPanel() .append(Constant.messages.getString("authentication.output.success") + "\n"); } }

Target:
public static void notifyOutputAuthSuccessful(HttpMessage msg) { if (msg != null) { try { Stats.incCounter(SessionStructure.getHostName(msg), AUTH_SUCCESS_STATS); } catch (URIException e) { } } if (View.isInitialised()) { View.getSingleton().getOutputPanel() .append(Constant.messages.getString("authentication.output.success") + "\n"); } }
Source:
private void highlightActiveMenuItem() { for (int id : ACTION_ITEMS_ALL) { page.getNavDrawer().getMenu().findItem(id).setCheckable(true) .setChecked(false); } int highlightItem = -1; if (page.getTopFragment() instanceof HistoryFragment) { highlightItem = R.id.nav_item_history; } else if (page.getTopFragment() instanceof SavedPagesFragment) { highlightItem = R.id.nav_item_saved_pages; } else if (page.getTopFragment() instanceof NearbyFragment) { highlightItem = R.id.nav_item_nearby; } else if (page.getTopFragment() instanceof PageViewFragmentInternal) { PageViewFragmentInternal fragment = (PageViewFragmentInternal) page.getTopFragment(); if (fragment.getHistoryEntry() != null) { if (fragment.getHistoryEntry().getSource() == HistoryEntry.SOURCE_MAIN_PAGE) { highlightItem = R.id.nav_item_today; } else if (fragment.getHistoryEntry().getSource() == HistoryEntry.SOURCE_RANDOM) { highlightItem = R.id.nav_item_random; } } } if (highlightItem != -1) { page.getNavDrawer().getMenu().findItem(highlightItem).setChecked(true); } }

Target:
private void highlightActiveMenuItem() { int test = page.getNavDrawer().getMenu().size(); for (int i = 0; i < test; i++) { page.getNavDrawer().getMenu().getItem(i).setChecked(false); } @IdRes int highlightItem = View.NO_ID; if (page.getTopFragment() instanceof HistoryFragment) { highlightItem = R.id.nav_item_history; } else if (page.getTopFragment() instanceof SavedPagesFragment) { highlightItem = R.id.nav_item_saved_pages; } else if (page.getTopFragment() instanceof NearbyFragment) { highlightItem = R.id.nav_item_nearby; } else if (page.getTopFragment() instanceof PageViewFragmentInternal) { PageViewFragmentInternal fragment = (PageViewFragmentInternal) page.getTopFragment(); if (fragment.getHistoryEntry() != null) { if (fragment.getHistoryEntry().getSource() == HistoryEntry.SOURCE_MAIN_PAGE) { highlightItem = R.id.nav_item_today; } else if (fragment.getHistoryEntry().getSource() == HistoryEntry.SOURCE_RANDOM) { highlightItem = R.id.nav_item_random; } } } if (highlightItem != View.NO_ID) { page.getNavDrawer().getMenu().findItem(highlightItem).setChecked(true); } }
Source:
public void testTypeUseWithList() { Foo foo = new Foo(); foo.names = Arrays.asList( "First", "", null ); Set<ConstraintViolation<Foo>> constraintViolations = validator.validate( foo ); assertNumberOfViolations( constraintViolations, 3 ); assertCorrectPropertyPaths( constraintViolations, "names[1]", "names[2]", "names[2]" ); }

Target:
public void testTypeUseWithList() { A a = new A(); a.names = Arrays.asList( "First", "", null ); Set<ConstraintViolation<A>> constraintViolations = validator.validate( a ); assertNumberOfViolations( constraintViolations, 3 ); assertCorrectPropertyPaths( constraintViolations, "names[1]", "names[2]", "names[2]" ); assertCorrectConstraintTypes( constraintViolations, NotBlankTypeUse.class, NotBlankTypeUse.class, NotNullTypeUse.class ); }
Source:
public void testMultipleEarlyNegotiationWithShortInterval() throws InterruptedException { final int nbApplicativeRequestReceived = applicativeLayerGetRequestCount.get(); testGetRequestWithEarlyNegotiation(false, PARAM_SHORT_RESP); testGetRequestWithEarlyNegotiation(false, PARAM_SHORT_RESP); assertEquals("Applicative layer received only one request", 2, applicativeLayerGetRequestCount.get() - nbApplicativeRequestReceived); }

Target:
public void testMultipleEarlyNegotiationWithShortInterval() throws InterruptedException { testGetRequestWithEarlyNegotiation(false, PARAM_SHORT_RESP); testGetRequestWithEarlyNegotiation(false, PARAM_SHORT_RESP); assertEquals("Application layer did not receive two requests", 2, applicationLayerGetRequestCount.get()); }
Source:
public void reinitializeCharts() { if (getGlobalPC() != null && !getGlobalPC().isDisposed()) { getGlobalPC().dispose(); } fGlobalPC = new PieChart(this, SWT.NONE); getGlobalPC().getTitle().setText(fGlobalPCname); getGlobalPC().getAxisSet().getXAxis(0).getTitle().setText(""); if (getTimeRangePC() != null && !getTimeRangePC().isDisposed()) { getTimeRangePC().dispose(); fTimeRangePC = null; } layout(); setCurrentState(new PieChartViewerStateNoContentSelected(this)); }

Target:
synchronized public void reinitializeCharts() { if(isDisposed()){ return; } if (getGlobalPC() != null && !getGlobalPC().isDisposed()) { getGlobalPC().dispose(); } fGlobalPC = new PieChart(this, SWT.NONE); getGlobalPC().getTitle().setText(fGlobalPCname); getGlobalPC().getAxisSet().getXAxis(0).getTitle().setText(""); if (getTimeRangePC() != null && !getTimeRangePC().isDisposed()) { getTimeRangePC().dispose(); fTimeRangePC = null; } layout(); setCurrentState(new PieChartViewerStateNoContentSelected(this)); }
Source:
private void sendConsentViaSMS(Study study, Subpopulation subpop, StudyParticipant participant, ConsentPdf consentPdf) { String shortUrl = null; try { String fileName = getSignedConsentUrl(); DateTime expiresOn = getDownloadExpiration(); s3Helper.writeBytesToS3(USERSIGNED_CONSENTS_BUCKET, fileName, consentPdf.getBytes()); URL url = s3Helper.generatePresignedUrl(USERSIGNED_CONSENTS_BUCKET, fileName, expiresOn, HttpMethod.GET); shortUrl = urlShortenerService.shortenUrl(url.toString(), SIGNED_CONSENT_DOWNLOAD_EXPIRE_IN_SECONDS); } catch(IOException e) { throw new BridgeServiceException(e); } SmsMessageProvider provider = new SmsMessageProvider.Builder() .withStudy(study) .withPhone(participant.getPhone()) .withExpirationPeriod(EXPIRATION_PERIOD_KEY, SIGNED_CONSENT_DOWNLOAD_EXPIRE_IN_SECONDS) .withPromotionType() .withSmsTemplate(study.getSignedConsentSmsTemplate()) .withToken(BridgeConstants.CONSENT_URL, shortUrl) .build(); notificationsService.sendSmsMessage(provider); }

Target:
private void sendConsentViaSMS(Study study, Subpopulation subpop, StudyParticipant participant, ConsentPdf consentPdf) { String shortUrl = null; try { String fileName = getSignedConsentUrl(); DateTime expiresOn = getDownloadExpiration(); s3Helper.writeBytesToS3(USERSIGNED_CONSENTS_BUCKET, fileName, consentPdf.getBytes()); URL url = s3Helper.generatePresignedUrl(USERSIGNED_CONSENTS_BUCKET, fileName, expiresOn, HttpMethod.GET); shortUrl = urlShortenerService.shortenUrl(url.toString(), SIGNED_CONSENT_DOWNLOAD_EXPIRE_IN_SECONDS); } catch(IOException e) { throw new BridgeServiceException(e); } SmsMessageProvider provider = new SmsMessageProvider.Builder() .withStudy(study) .withPhone(participant.getPhone()) .withExpirationPeriod(EXPIRATION_PERIOD_KEY, SIGNED_CONSENT_DOWNLOAD_EXPIRE_IN_SECONDS) .withTransactionType() .withSmsTemplate(study.getSignedConsentSmsTemplate()) .withToken(BridgeConstants.CONSENT_URL, shortUrl) .build(); notificationsService.sendSmsMessage(provider); }
Source:
public Flowable<K> publishKeys(Predicate<? super K> filter) { return Flowable.fromIterable(() -> { List<K> keys = new ArrayList<>(entries.size()); long now = ctx.getTimeService().wallClockTime(); synchronized (entries) { for (Map.Entry<K, FileEntry> e : entries.entrySet()) { K key = e.getKey(); if ((filter == null || filter.test(key)) && !e.getValue().isExpired(now)) { keys.add(key); } } } return keys.iterator(); }); }

Target:
public Flowable<K> publishKeys(Predicate<? super K> filter) { return Flowable.fromIterable(() -> { List<K> keys = new ArrayList<>(entries.size()); long now = ctx.getTimeService().wallClockTime(); synchronized (entries) { for (Map.Entry<K, FileEntry> e : entries.entrySet()) { K key = e.getKey(); if (!e.getValue().isExpired(now) && (filter == null || filter.test(key))) { keys.add(key); } } } return keys.iterator(); }); }
Source:
private void init() { this.navigate = new Navigate(); this.cc = new CuratedMainPagePageObject(); this.curatedContent = new CuratedContentPageObject(); this.loading = new Loading(driver); }

Target:
private void init() { this.navigate = new Navigate(); this.curatedMainPage = new CuratedMainPagePageObject(); this.curatedContent = new CuratedContentPageObject(); this.loading = new Loading(driver); }
Source:
private String getParameters() { Map<String, String> params = new HashMap<>(parameters); System.getProperties() .stringPropertyNames() .stream() .filter(k -> k.startsWith("reporter.")) .forEach(k -> { if (System.getProperty(k) != null) { params.put(k, System.getProperty(k)); } }); StringBuilder param = new StringBuilder(); if (!params.isEmpty()) { param.append(";parameters='"); } params.entrySet() .forEach(e -> { param.append(e.getKey() + "=" + e.getValue() + ","); }); if (!params.isEmpty()) { param.deleteCharAt(param.length() - 1); param.append("'"); } return param.toString(); }

Target:
private String getParameters() { Map<String, String> params = new HashMap<>(parameters); System.getProperties() .stringPropertyNames() .stream() .filter(k -> k.startsWith("bnd.reporter.")) .forEach(k -> { if (System.getProperty(k) != null) { params.put(k, System.getProperty(k)); } }); StringBuilder param = new StringBuilder(); if (!params.isEmpty()) { param.append(";parameters='"); } params.entrySet() .forEach(e -> { param.append(e.getKey() + "=" + e.getValue() + ","); }); if (!params.isEmpty()) { param.deleteCharAt(param.length() - 1); param.append("'"); } return param.toString(); }
Source:
public Integer getZkConnectionTimeoutMs() { return zkConnectionTimeoutMs; }

Target:
public int getZkConnectionTimeoutMs() { return zkConnectionTimeoutMs; }
Source:
protected void resolveDataPolicy(RegionFactory<K, V> regionFactory, Boolean persistent, String dataPolicy) { DataPolicy resolvedDataPolicy = new DataPolicyConverter().convert(dataPolicy); Assert.isTrue(resolvedDataPolicy != null || (resolvedDataPolicy == null && !StringUtils.hasText(dataPolicy)), String.format("Data Policy '%1$s' is invalid.", dataPolicy)); if (resolvedDataPolicy == null || DataPolicy.NORMAL.equals(resolvedDataPolicy)) { regionFactory.setDataPolicy(isPersistent() ? DataPolicy.PERSISTENT_REPLICATE : DataPolicy.NORMAL); } else if (DataPolicy.PRELOADED.equals(resolvedDataPolicy)) { regionFactory.setDataPolicy(isPersistent() ? DataPolicy.PERSISTENT_REPLICATE : DataPolicy.PRELOADED); } else { throw new IllegalArgumentException(String.format("Data Policy '%1$s' is not supported in Local Regions.", dataPolicy)); } }

Target:
protected void resolveDataPolicy(RegionFactory<K, V> regionFactory, Boolean persistent, String dataPolicy) { DataPolicy resolvedDataPolicy = new DataPolicyConverter().convert(dataPolicy); Assert.isTrue(resolvedDataPolicy != null || !StringUtils.hasText(dataPolicy), String.format("Data Policy '%1$s' is invalid.", dataPolicy)); if (resolvedDataPolicy == null || DataPolicy.NORMAL.equals(resolvedDataPolicy)) { regionFactory.setDataPolicy(isPersistent() ? DataPolicy.PERSISTENT_REPLICATE : DataPolicy.NORMAL); } else if (DataPolicy.PRELOADED.equals(resolvedDataPolicy)) { regionFactory.setDataPolicy(isPersistent() ? DataPolicy.PERSISTENT_REPLICATE : DataPolicy.PRELOADED); } else { throw new IllegalArgumentException(String.format("Data Policy '%1$s' is not supported in Local Regions.", dataPolicy)); } }