auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void addCurrentReviewers(ChangeAttribute a, Change change) throws OrmException { String approvaltype = "Code-Review"; a.currentReviewers = Lists.newArrayList(); <START> PatchSet.Id psid = change.currentPatchSetId(); <END> for (PatchSetApproval psa : db.get().patchSetApprovals().byPatchSet(psid)) { if(psa.getLabel().equals(approvaltype)) a.currentReviewers.add(asAccountAttribute(psa.getAccountId())); } }</code><technical_language>a done in ListReviewers: for (PatchSetApproval patchSetApproval : db.patchSetApprovals().byChange(changeId)) { Account.Id accountId = patchSetApproval.getAccountId(); if (!reviewers.containsKey(accountId)) { reviewers.put(accountId, resourceFactory.create(rsrc, accountId)); } } need change variable names fit in here, generally work expected</technical_language>

Target:
public void addCurrentReviewers(ChangeAttribute a, Change change) throws OrmException { a.currentReviewers = Lists.newArrayList(); ArrayList<Object> accountIdlist = Lists.newArrayList(); PatchSet.Id psid = change.currentPatchSetId(); for (PatchSetApproval psa : db.get().patchSetApprovals().byPatchSet(psid)) { Account.Id accountId = psa.getAccountId(); if (!accountIdlist.contains(accountId)) { accountIdlist.add(accountId); a.currentReviewers.add(asAccountAttribute(psa.getAccountId())); } } if (a.currentReviewers.isEmpty()) { a.currentReviewers = null; } }
Source:
<code>protected void postShutdown() { logger().debug("Shutting down the elasticsearch index provider '{0}' in repository '{1}'", getName(), getRepositoryName()); try { client.close(); esNode.stop(); } catch (Exception e) { <START> } <END> }</code><technical_language>exception logged</technical_language>

Target:
protected void postShutdown() { logger().debug("Shutting down the elasticsearch index provider '{0}' in repository '{1}'", getName(), getRepositoryName()); }
Source:
<code>private void ensureState() { if (version == null) { <START> version = Constants.HeaderConstants.TARGET_STORAGE_VERSION; <END> } if (ImplUtils.isNullOrEmpty(blobName)) { resource = SAS_CONTAINER_CONSTANT; } else if (snapshotId != null) { resource = SAS_BLOB_SNAPSHOT_CONSTANT; } else { resource = SAS_BLOB_CONSTANT; } if (permissions != null) { switch (resource) { case SAS_BLOB_CONSTANT: case SAS_BLOB_SNAPSHOT_CONSTANT: permissions = BlobSasPermission.parse(permissions).toString(); break; case SAS_CONTAINER_CONSTANT: permissions = BlobContainerSasPermission.parse(permissions).toString(); break; default: logger.info("Not re-parsing permissions. Resource type '{}' is unknown.", resource); break; } } }</code><technical_language>this changed based service version work @samvaity (which is in repo)</technical_language>

Target:
private void ensureState() { if (version == null) { version = BlobServiceVersion.getLatest().getVersion(); } if (ImplUtils.isNullOrEmpty(blobName)) { resource = SAS_CONTAINER_CONSTANT; } else if (snapshotId != null) { resource = SAS_BLOB_SNAPSHOT_CONSTANT; } else { resource = SAS_BLOB_CONSTANT; } if (permissions != null) { switch (resource) { case SAS_BLOB_CONSTANT: case SAS_BLOB_SNAPSHOT_CONSTANT: permissions = BlobSasPermission.parse(permissions).toString(); break; case SAS_CONTAINER_CONSTANT: permissions = BlobContainerSasPermission.parse(permissions).toString(); break; default: logger.info("Not re-parsing permissions. Resource type '{}' is unknown.", resource); break; } } }
Source:
<code>private Job createSaveJob() { <START> Job job = new UIJob("Saving") { END> @Override public IStatus runInUIThread(IProgressMonitor monitor) { currentEditor.doSave(new NullProgressMonitor()); if (!browser.isDisposed()) { refresh(browser); } return Status.OK_STATUS; } }; return job; }</code><technical_language>Lets show requested saving name job instance properly this template: HTML Preview: Saving '${filename-without-path}' I borrowed this format system job name like: System: Message text</technical_language>

Target:
private Job createSaveJob() { Job job = new UIJob("HTML Preview: Saving " + currentEditor.getTitle()) { @Override public IStatus runInUIThread(IProgressMonitor monitor) { currentEditor.doSave(new NullProgressMonitor()); if (!browser.isDisposed()) { refresh(browser); } return Status.OK_STATUS; } }; return job; }
Source:
<code>private void setLoggedInUser(User user, Session session) { if (mSession != session) { mSession = session; updateSessionExpiryWithTimezone(); } if (mSession != null) { Cookies.setCookie(COOKIE_KEY_TOKEN, mSession.token, mSession.expires); <START> Date nextYear = new Date(); <END> CalendarUtil.addMonthsToDate(nextYear, 12); if (mSession.user != null && mSession.user.username != null) { Cookies.setCookie(COOKIE_KEY_LAST_USER, mSession.user.username, nextYear); } } else { Cookies.removeCookie(COOKIE_KEY_TOKEN); } if (mLoggedInUser != user) { mLoggedInUser = user; MixPanelApiHelper.trackLoginUser(mLoggedInUser); if (mLoggedInUser == null) { DefaultEventBus.get().fireEventFromSource(new UserLoggedOut(), SessionController.this); } else { DefaultEventBus.get().fireEventFromSource(new UserLoggedIn(mLoggedInUser, mSession), SessionController.this); } } }</code><technical_language>cookies end dates optional... leave open</technical_language>

Target:
private void setLoggedInUser(User user, Session session) { if (mSession != session) { mSession = session; updateSessionExpiryWithTimezone(); } if (mSession != null) { Cookies.setCookie(COOKIE_KEY_TOKEN, mSession.token, mSession.expires); if (mSession.user != null && mSession.user.username != null) { Cookies.setCookie(COOKIE_KEY_LAST_USER, mSession.user.username); } } else { Cookies.removeCookie(COOKIE_KEY_TOKEN); } if (mLoggedInUser != user) { mLoggedInUser = user; MixPanelApiHelper.trackLoginUser(mLoggedInUser); if (mLoggedInUser == null) { DefaultEventBus.get().fireEventFromSource(new UserLoggedOut(), SessionController.this); } else { DefaultEventBus.get().fireEventFromSource(new UserLoggedIn(mLoggedInUser, mSession), SessionController.this); } } }
Source:
<code>private static Map<String, String> getOldStyleUserMetadataAsHashMap(byte[] userMetadata) <START> throws UnsupportedEncodingException { <END> int totalSize = userMetadata.length; Map<String, String> toReturn = new HashMap<String, String>(); int sizeRead = 0; int counter = 0; ByteBuffer userMetadataBuffer = ByteBuffer.wrap(userMetadata); while (sizeRead < totalSize) { String key = Headers.UserMetaData_OldStyle_Prefix + counter++; int sizeToRead = Math.min(totalSize - sizeRead, Max_UserMetadata_Value_Size); byte[] userMetadataPart = new byte[sizeToRead]; userMetadataBuffer.get(userMetadataPart); String value = new String(userMetadataPart, "US-ASCII"); toReturn.put(key, value); sizeRead += sizeToRead; } return toReturn; }</code><technical_language>library support decode</technical_language>

Target:
private static Map<String, String> getOldStyleUserMetadataAsHashMap(byte[] userMetadata) { int totalSize = userMetadata.length; Map<String, String> toReturn = new HashMap<String, String>(); int sizeRead = 0; int counter = 0; while (sizeRead < totalSize) { String key = Headers.UserMetaData_OldStyle_Prefix + counter++; int sizeToRead = Math.min(totalSize - sizeRead, Max_UserMetadata_Value_Size); String value = new String(userMetadata, sizeRead, sizeToRead, StandardCharsets.US_ASCII); toReturn.put(key, value); sizeRead += sizeToRead; } return toReturn; }
Source:
<code>public void test12() throws InterruptedException { log.info("Test12 - Test output attributes and its types for table"); SiddhiManager siddhiManager = new SiddhiManager(); String streams = "" + "define stream StockStream (symbol string, price float, volume long);" + "@PrimaryKey('symbol') " + "define table StockTable (symbol string, price float, volume long); "; String storeQuery = "" + "from StockTable " + "select * ;"; SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(streams); <START> siddhiAppRuntime.start(); <END> Attribute[] actualAttributeArray = siddhiAppRuntime.getStoreQueryOutputAttributes(SiddhiCompiler.parseStoreQuery (storeQuery)); Attribute symbolAttribute = new Attribute("symbol", Attribute.Type.STRING); Attribute priceAttribute = new Attribute("price", Attribute.Type.FLOAT); Attribute volumeAttribute = new Attribute("volume", Attribute.Type.LONG); Attribute[] expectedAttributeArray = new Attribute[]{symbolAttribute, priceAttribute, volumeAttribute}; AssertJUnit.assertArrayEquals(expectedAttributeArray, actualAttributeArray); storeQuery = "" + "from StockTable " + "select symbol, sum(volume) as totalVolume ;"; actualAttributeArray = siddhiAppRuntime.getStoreQueryOutputAttributes(SiddhiCompiler.parseStoreQuery (storeQuery)); Attribute totalVolumeAttribute = new Attribute("totalVolume", Attribute.Type.LONG); expectedAttributeArray = new Attribute[]{symbolAttribute, totalVolumeAttribute}; AssertJUnit.assertArrayEquals(expectedAttributeArray, actualAttributeArray); }</code><technical_language>stop siddhiApp started</technical_language>

Target:
public void test12() throws InterruptedException { log.info("Test12 - Test output attributes and its types for table"); SiddhiManager siddhiManager = new SiddhiManager(); String streams = "" + "define stream StockStream (symbol string, price float, volume long);" + "@PrimaryKey('symbol') " + "define table StockTable (symbol string, price float, volume long); "; String storeQuery = "" + "from StockTable " + "select * ;"; SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(streams); siddhiAppRuntime.start(); Attribute[] actualAttributeArray = siddhiAppRuntime.getStoreQueryOutputAttributes(SiddhiCompiler.parseStoreQuery (storeQuery)); Attribute symbolAttribute = new Attribute("symbol", Attribute.Type.STRING); Attribute priceAttribute = new Attribute("price", Attribute.Type.FLOAT); Attribute volumeAttribute = new Attribute("volume", Attribute.Type.LONG); Attribute[] expectedAttributeArray = new Attribute[]{symbolAttribute, priceAttribute, volumeAttribute}; AssertJUnit.assertArrayEquals(expectedAttributeArray, actualAttributeArray); storeQuery = "" + "from StockTable " + "select symbol, sum(volume) as totalVolume ;"; actualAttributeArray = siddhiAppRuntime.getStoreQueryOutputAttributes(SiddhiCompiler.parseStoreQuery (storeQuery)); Attribute totalVolumeAttribute = new Attribute("totalVolume", Attribute.Type.LONG); expectedAttributeArray = new Attribute[]{symbolAttribute, totalVolumeAttribute}; siddhiAppRuntime.shutdown(); AssertJUnit.assertArrayEquals(expectedAttributeArray, actualAttributeArray); }
Source:
<code>public void updateExistingPaymentWorksVendorInStagingTable(Integer id, String kfsVendorProcessingStatus, Integer vendorHeaderGeneratedIdentifier, Integer vendorDetailAssignedIdentifier, Timestamp processingTimeStamp) { <START> updateExistingPaymentWorksVendorInStagingTable(id, null, kfsVendorProcessingStatus, KFSConstants.EMPTY_STRING, KFSConstants.EMPTY_STRING, KFSConstants.EMPTY_STRING, processingTimeStamp, vendorHeaderGeneratedIdentifier, vendorDetailAssignedIdentifier, null); <END> }</code><technical_language>arg for this call set empty string</technical_language>

Target:
public void updateExistingPaymentWorksVendorInStagingTable(Integer id, String kfsVendorProcessingStatus, Integer vendorHeaderGeneratedIdentifier, Integer vendorDetailAssignedIdentifier, Timestamp processingTimeStamp) { updateExistingPaymentWorksVendorInStagingTable(id, KFSConstants.EMPTY_STRING, kfsVendorProcessingStatus, KFSConstants.EMPTY_STRING, KFSConstants.EMPTY_STRING, KFSConstants.EMPTY_STRING, processingTimeStamp, vendorHeaderGeneratedIdentifier, vendorDetailAssignedIdentifier, null); }
Source:
<code>private int getNumTasks(DatastreamGroup dg, int numInstances) { int numTasks = dg.getDatastreams().stream() .map(ds -> ds.getMetadata().get(CFG_MAX_TASKS)) .filter(Objects::nonNull) .mapToInt(Integer::valueOf) .map(x -> x < 1 ? Integer.MAX_VALUE : x) .max() .orElse(_maxTasks); <START> return _limitTasksToInstanceSize ? Math.min(numTasks, numInstances) : numTasks; <END> }</code><technical_language>if advice, this Math.min(maxTasks, numInstances * dsLimitTaskPerInstance)</technical_language>

Target:
private int getNumTasks(DatastreamGroup dg, int numInstances) { int numTasks = dg.getDatastreams().stream() .map(ds -> ds.getMetadata().get(CFG_MAX_TASKS)) .filter(Objects::nonNull) .mapToInt(Integer::valueOf) .map(x -> x < 1 ? Integer.MAX_VALUE : x) .max() .orElse(_maxTasks); return Math.min(numTasks, numInstances * _dsTaskLimitPerInstance); }
Source:
<code>public FEELFnResult<BigDecimal> invoke(@ParameterName("list") List<?> list) { <START> if ( list == null ) { <END> return FEELFnResult.ofError( new InvalidParametersEvent( FEELEvent.Severity.ERROR, "list", "the list cannot be null" ) ); } int length = list.size(); List<Double> intermediate = new ArrayList<>( length ); double total = 0.0; for ( Object o : list ) { if (!(o instanceof Number)) { return FEELFnResult.ofError( new InvalidParametersEvent( FEELEvent.Severity.ERROR, "list", "an element in the list is not suitable for the stddev" ) ); } double val = ((Number) o).doubleValue(); intermediate.add( val ); total += val; } double mean = total/length; double total2 = 0.0; for ( Double val : intermediate) { total2 += Math.pow( val - mean, 2 ); } double mean2 = total2 / ( length - 1 ); BigDecimal result = new BigDecimal( Math.sqrt( mean2 ) ); return FEELFnResult.ofResult( result ); }</code><technical_language>I for BigDecimals. list is homogenous filled BigDecimals, start. I correct @etirelli</technical_language>

Target:
public FEELFnResult<BigDecimal> invoke(@ParameterName("list") List<?> list) { if ( list == null ) { return FEELFnResult.ofError( new InvalidParametersEvent( FEELEvent.Severity.ERROR, "list", "the list cannot be null" ) ); } int n = list.size(); BigDecimal[] numbers = new BigDecimal[n]; for ( int i = 0; i < n; i++ ) { final BigDecimal val = EvalHelper.getBigDecimalOrNull( list.get( i ) ); if ( val == null ) { return FEELFnResult.ofError( new InvalidParametersEvent( FEELEvent.Severity.ERROR, "list", "an element in the list is not suitable for the stddev" ) ); } numbers[i] = val; } BigDecimal total = BigDecimal.ZERO; for ( int i = 0; i < n; i++ ) { total = total.add( numbers[i] ); } BigDecimal mean = total.divide( BigDecimal.valueOf( n ), MathContext.DECIMAL128 ); total = BigDecimal.ZERO; for ( int i = 0; i < n; i++ ) { BigDecimal distanceSquared = numbers[i].subtract( mean ).pow( 2, MathContext.DECIMAL128 ); total = total.add( distanceSquared ); } mean = total.divide( BigDecimal.valueOf( n - 1 ), MathContext.DECIMAL128 ); return FEELFnResult.ofResult( SqrtFunction.sqrt( mean ) ); }
Source:
<code>public void updated(Dictionary<String, ?> config) throws ConfigurationException { if (config != null && config.get("bots") != null) { String[] bots = ((String) config.get("bots")).split(","); for (String bot : bots) { String chatIdKey = String.format("%s.chatId", bot); String tokenKey = String.format("%s.token", bot); String parseKey = String.format("%s.parseMode", bot); if (config.get(chatIdKey) != null && config.get(tokenKey) != null) { <START> String chatId = (String) config.get(chatIdKey); <END> String token = (String) config.get(tokenKey); if (parseKey == null) { Telegram.addToken(bot, chatId, token); } else { Telegram.addToken(bot, chatId, token, (String) config.get(parseKey)); } logger.info("Bot loaded from config file", bot); } else { logger.warn("Bot is misconfigured. Please check the configuration", bot); } } isProperlyConfigured = true; } }</code><technical_language>For config getters (lines 69, 70, 74), please Objects.toString() convention. e.g.: String defaultAccessToken = Objects.toString(config.get(ACCESS_TOKEN_KEY), null);</technical_language>

Target:
public void updated(Dictionary<String, ?> config) throws ConfigurationException { if (config != null && config.get("bots") != null) { String[] bots = ((String) config.get("bots")).split(","); for (String bot : bots) { String chatIdKey = String.format("%s.chatId", bot); String tokenKey = String.format("%s.token", bot); String parseModeKey = String.format("%s.parseMode", bot); String chatId = Objects.toString(config.get(chatIdKey), null); String token = Objects.toString(config.get(tokenKey), null); String parseMode = Objects.toString(config.get(parseModeKey), null); if (chatId != null && token != null) { if (parseMode == null) { Telegram.addToken(bot, chatId, token); } else { Telegram.addToken(bot, chatId, token, parseMode); } logger.info("Bot loaded from config file", bot); } else { logger.warn("Bot is misconfigured. Please check the configuration", bot); } } isProperlyConfigured = true; } }
Source:
<code><START> void abort(Exception abortCause) { <END> operationCompleteCallback.completeOperation(operationFuture, operationCallback, null, new RouterException("Aborted operation because Router is closed", RouterErrorCode.RouterClosed)); }</code><technical_language>is purpose of arg here. Also, assume router close is possibility</technical_language>

Target:
void abort(Exception abortCause) { operationCompleteCallback.completeOperation(operationFuture, operationCallback, null, abortCause); operationCompleted = true; }
Source:
<code>public void onBackPressed() { if (mDrawerLayout != null && mDrawerLayout.isDrawerOpen(GravityCompat.START)) { mDrawerLayout.closeDrawer(Gravity.START); } else { if (doubleBackToExitPressedOnce) { setMenuCreateClient(true); setMenuCreateCentre(true); setMenuCreateGroup(true); super.onBackPressed(); return; } this.doubleBackToExitPressedOnce = true; FragmentManager fragmentManager = getSupportFragmentManager(); Fragment fragment = fragmentManager.findFragmentById(R.id.container); <START> if (fragment instanceof CreateNewClientFragment) { <END> Toast.makeText(this, R.string.back_to_dashboard, Toast.LENGTH_SHORT).show(); new Handler().postDelayed(new Runnable() { @Override public void run() { doubleBackToExitPressedOnce = false; } }, 2000); } else if (fragment instanceof CreateNewCenterFragment) { Toast.makeText(this, R.string.back_to_dashboard, Toast.LENGTH_SHORT).show(); new Handler().postDelayed(new Runnable() { @Override public void run() { doubleBackToExitPressedOnce = false; } }, 2000); } else if (fragment instanceof CreateNewGroupFragment) { Toast.makeText(this, R.string.back_to_dashboard, Toast.LENGTH_SHORT).show(); new Handler().postDelayed(new Runnable() { @Override public void run() { doubleBackToExitPressedOnce = false; } }, 2000); } else { Toast.makeText(this, R.string.back_again, Toast.LENGTH_SHORT).show(); new Handler().postDelayed(new Runnable() { @Override public void run() { doubleBackToExitPressedOnce = false; } }, 2000); } } }</code><technical_language>I a lot of duplicate code here, please refactor a method call method</technical_language>

Target:
public void onBackPressed() { if (mDrawerLayout != null && mDrawerLayout.isDrawerOpen(GravityCompat.START)) { mDrawerLayout.closeDrawer(Gravity.START); } else { if (doubleBackToExitPressedOnce) { setMenuCreateClient(true); setMenuCreateCentre(true); setMenuCreateGroup(true); super.onBackPressed(); return; } this.doubleBackToExitPressedOnce = true; Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.container); if (fragment instanceof CreateNewClientFragment || fragment instanceof CreateNewCenterFragment || fragment instanceof CreateNewGroupFragment) { showToastOnBackPressed(R.string.back_to_dashboard); } else { showToastOnBackPressed(R.string.back_again); } } }
Source:
<code>public static JSONPropertyWriter create() { JSONPropertyWriter writer = new JSONPropertyWriter(); <START> writer.dateTimeFormat = DateTimeFormat.W3C; <END> return writer; }</code><technical_language>put this field default writeEmpty writeNull</technical_language>

Target:
public static JSONPropertyWriter create() { return new JSONPropertyWriter(); }
Source:
<code>public IStatus validate(IProject project, String path) { File xmlFile = new File(path); if (xmlFile.exists() && xmlFile.isFile() && xmlFile.canRead() && xmlFile.length() > 0) { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db; try { db = dbf.newDocumentBuilder(); EntityResolver resolver = new EntityResolver() { @Override public InputSource resolveEntity(String publicId, String systemId) { String empty = ""; <START> ByteArrayInputStream bais = new ByteArrayInputStream(empty.getBytes()); <END> return new InputSource(bais); } }; db.setEntityResolver(resolver); db.setErrorHandler(new ErrorHandler() { @Override public void error(SAXParseException saxparseexception) throws SAXException { } @Override public void warning(SAXParseException saxparseexception) throws SAXException { } @Override public void fatalError(SAXParseException saxparseexception) throws SAXException { throw saxparseexception; } }); db.parse(new FileInputStream(xmlFile)); return Status.OK_STATUS; } catch (ParserConfigurationException e) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e); } catch (FileNotFoundException e) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e); } catch (SAXException e) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e); } catch (IOException e) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e); } } return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.CustomTrace_FileNotFound + ": " + path); }</code><technical_language>do create a String here? Is gonna work empty array? new ByteArrayInputStream(new byte[10]) something</technical_language>

Target:
public IStatus validate(IProject project, String path) { File xmlFile = new File(path); if (xmlFile.exists() && xmlFile.isFile() && xmlFile.canRead() && xmlFile.length() > 0) { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db; try { db = dbf.newDocumentBuilder(); EntityResolver resolver = new EntityResolver() { @Override public InputSource resolveEntity(String publicId, String systemId) { return new InputSource(new ByteArrayInputStream(new byte[0])); } }; db.setEntityResolver(resolver); db.setErrorHandler(new ErrorHandler() { @Override public void error(SAXParseException saxparseexception) throws SAXException { } @Override public void warning(SAXParseException saxparseexception) throws SAXException { } @Override public void fatalError(SAXParseException saxparseexception) throws SAXException { throw saxparseexception; } }); db.parse(new FileInputStream(xmlFile)); return Status.OK_STATUS; } catch (ParserConfigurationException e) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e); } catch (FileNotFoundException e) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e); } catch (SAXException e) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e); } catch (IOException e) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e); } } return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.CustomTrace_FileNotFound + ": " + path); }
Source:
<code>private void internalConfigChanged(TemperatureControlStatus tempControlStatus) { <START> if (tempControlStatus != null) { <END> if (tempControlStatus.getIsConfigured()) { logger.debug("found configured zone TemperatureControlStatus = {}", tempControlStatus); ThingUID thingUID = getThingUID(tempControlStatus); if (thingUID != null) { Map<String, Object> properties = new HashMap<>(1); properties.put(DigitalSTROMBindingConstants.ZONE_ID, tempControlStatus.getZoneID()); String zoneName = tempControlStatus.getZoneName(); if (StringUtils.isBlank(zoneName)) { zoneName = tempControlStatus.getZoneID().toString(); } DiscoveryResult discoveryResult = DiscoveryResultBuilder.create(thingUID).withProperties(properties) .withBridge(BRIDGE_UID).withLabel(zoneName).build(); thingDiscovered(discoveryResult); } } } }</code><technical_language>Please early return</technical_language>

Target:
private void internalConfigChanged(TemperatureControlStatus tempControlStatus) { if (tempControlStatus == null) { return; } if (tempControlStatus.getIsConfigured()) { logger.debug("found configured zone TemperatureControlStatus = {}", tempControlStatus); ThingUID thingUID = getThingUID(tempControlStatus); if (thingUID != null) { Map<String, Object> properties = new HashMap<>(); properties.put(DigitalSTROMBindingConstants.ZONE_ID, tempControlStatus.getZoneID()); String zoneName = tempControlStatus.getZoneName(); if (StringUtils.isBlank(zoneName)) { zoneName = tempControlStatus.getZoneID().toString(); } DiscoveryResult discoveryResult = DiscoveryResultBuilder.create(thingUID).withProperties(properties) .withBridge(bridgeUID).withLabel(zoneName).build(); thingDiscovered(discoveryResult); } } }
Source:
<code>public Object execute(ExecutionEvent event) throws ExecutionException { <START> Object checkCompositeRename= HandlerUtil.getVariable(event, LTK_CHECK_COMPOSITE_RENAME_PARAMETER_KEY); <END> if (checkCompositeRename != null) { return checkForCompositeRename(event, checkCompositeRename); } else { performRename(event); } return null; }</code><technical_language>other HandlerUtil.getVariable() calls, usual logic is for instance of for (in this case Boolean) treat other situation if null provided. This remove need check for Boolean in checkForCompositeRename code issue error log message occur</technical_language>

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { Object checkCompositeRename= HandlerUtil.getVariable(event, LTK_CHECK_COMPOSITE_RENAME_PARAMETER_KEY); if (checkCompositeRename instanceof Boolean) { return checkForCompositeRename(event); } else { performRename(event); } return null; }
Source:
<code>public <T> ExecuteOperation<T> newExecuteOperation(String taskName, Map<String, byte[]> marshalledParams) { return new ExecuteOperation<>(codec, transportFactory, cacheNameBytes == null ? DEFAULT_CACHE_NAME_BYTES : cacheNameBytes, <START> topologyId, flags(), clientIntelligence, taskName, marshalledParams); <END> }</code><technical_language>assign cacheNameBytes DEFAULT_CACHE_NAME_BYTES in constructor if null instead this variable null</technical_language>

Target:
public <T> ExecuteOperation<T> newExecuteOperation(String taskName, Map<String, byte[]> marshalledParams) { return new ExecuteOperation<>(codec, transportFactory, cacheNameBytes, topologyId, flags(), clientIntelligence, taskName, marshalledParams); }
Source:
<code>protected static Filter appendFilter(final Filter main, final Filter toAppend) { if (main == null) { return toAppend; <START> } else { <END> return ff.and(main, toAppend); } }</code><technical_language>this have: else if (toAppend == null) { return main; } For consistency convenience</technical_language>

Target:
protected static Filter appendFilter(final Filter main, final Filter toAppend) { if (main == null) { return toAppend; } else if (toAppend == null) { return main; } else { return ff.and(main, toAppend); } }
Source:
<code>public void validate(Long partSizeInMB) throws IllegalArgumentException { checkNotNull(partSizeInMB, "partSizeInMB"); <START> checkArgument(!(partSizeInMB < MIN_PART_SIZE || partSizeInMB > MAX_PART_SIZE || (partSizeInMB & (partSizeInMB - 1)) != 0), <END> "partSizeInMB must be a power of 2 between 1 and 4096."); }</code><technical_language>write this more Long.bitCount. JDK optimize this a single x86 POPCNT instruction modern hardware</technical_language>

Target:
public void validate(Long partSizeInMB) throws IllegalArgumentException { checkNotNull(partSizeInMB, "partSizeInMB"); checkArgument(!(partSizeInMB < MIN_PART_SIZE || partSizeInMB > MAX_PART_SIZE || Long.bitCount(partSizeInMB) != 1), "partSizeInMB must be a power of 2 between 1 and 4096."); }
Source:
<code>private static void set(final Map<String, Object> map, final String key, final String defaultValue, final Consumer<String> consumer) { final String value = (String) map.get(key); <START> if (isNotEmpty(value)) { <END> consumer.accept(value); } else if (null != defaultValue) { consumer.accept(defaultValue); } }</code><technical_language>isEmpty is more consistent other equivalent methods in Collections.isEmpty(), etc. a personal preference</technical_language>

Target:
private static void set(final Map<String, Object> map, final String key, final String defaultValue, final Consumer<String> consumer) { final String value = (String) map.get(key); if (nonEmpty(value)) { consumer.accept(value); } else if (null != defaultValue) { consumer.accept(defaultValue); } }
Source:
<code>public List<ProductRelease> findAllProductReleasesOfProduct(String pName, String token, String tenant) throws SdcException { Response response = null; try { String url = sDCUtil.getSdcUtil(token) + "/catalog/product/" + pName + "/release"; log.debug("url: " + url); Invocation.Builder builder = createWebResource(url, token, tenant); builder = builder.accept(MediaType.APPLICATION_JSON); response = builder.get(); String responseJSON = response.readEntity(String.class); return fromSDCToPaasManager(responseJSON); } catch (Exception e) { <START> String message = "Error calling SDC to obtain the products " + e.getMessage(); <END> log.error(message); throw new SdcException(message); } finally { if (response != null) { response.close(); } } }</code><technical_language>Try differentiate error messages in order easy it. String message = "Error calling SDC obtain products " + e.getMessage(); is in previous method..</technical_language>

Target:
public List<ProductRelease> findAllProductReleasesOfProduct(String pName, String token, String tenant) throws SdcException { Response response = null; try { String url = sDCUtil.getSdcUtil(token) + "/catalog/product/" + pName + "/release"; log.debug("url: " + url); Invocation.Builder builder = createWebResource(url, token, tenant); builder = builder.accept(MediaType.APPLICATION_JSON); response = builder.get(); String responseJSON = response.readEntity(String.class); return fromSDCToPaasManager(responseJSON); } catch (Exception e) { String message = "Error calling SDC to obtain the product release list: " + e.getMessage(); log.error(message); throw new SdcException(message); } finally { if (response != null) { response.close(); } } }
Source:
<code><START> private void encodeLocalizedDescriptions(Described entity, DBObject dbObject) { <END> Iterable<DBObject> localizedDescriptions = Iterables.transform(entity.getLocalizedDescriptions(), new Function<LocalizedDescription, DBObject>() { @Override public DBObject apply(LocalizedDescription input) { return localizedDescriptionTranslator.toDBObject(new BasicDBObject(), input); } }); dbObject.put(LOCALIZED_DESCRIPTIONS_KEY, localizedDescriptions); }</code><technical_language>Need ensure ordering, conversation re. hashcodes :)</technical_language>

Target:
private void encodeLocalizedDescriptions(Described entity, DBObject dbObject) { List<LocalizedDescription> sortedDescriptions = LOCALIZED_DESCRIPTION_ORDERING.sortedCopy(entity.getLocalizedDescriptions()); BasicDBList dbDescriptions = new BasicDBList(); for (LocalizedDescription localizedDescriptions : sortedDescriptions) { dbDescriptions.add(localizedDescriptionTranslator.toDBObject(new BasicDBObject(), localizedDescriptions)); } dbObject.put(LOCALIZED_DESCRIPTIONS_KEY, dbDescriptions); }
Source:
<code>public static final Object[][] getFileNames() { return new Object[][] { <START> {"文件名óśłżźćńę.jpg"}, <END> {"Image001.jpg"}, }; }</code><technical_language>Please add ? %</technical_language>

Target:
public static final Object[][] getFileNames() { return new Object[][] { {"文件名óśłżźćńę%?.jpg"}, {"Image001.jpg"}, }; }
Source:
<code>private void destroyPlayer() { if (player != null) { player.destroy(); player = null; } if (skinLayout != null) { skinLayout.release(); } if (playerSkinLayoutController != null) { <START> playerSkinLayoutController.deleteObserver(this); <END> playerSkinLayoutController = null; } }</code><technical_language>call onDestroy() method of playerSkinLayoutController early</technical_language>

Target:
private void destroyPlayer() { pulseManager = null; if (player != null) { player.destroy(); player = null; } if (skinLayout != null) { skinLayout.release(); } if (playerSkinLayoutController != null) { playerSkinLayoutController.onDestroy(); playerSkinLayoutController = null; } }
Source:
<code>public void getContents() throws IOException, SignatureException, URISyntaxException, XmlProcessingException, InterruptedException { final String bucketName = "test_get_contents"; try { client.putBucket(new PutBucketRequest(bucketName)); loadBookTestData(client, bucketName); final Ds3ClientHelpers helpers = Ds3ClientHelpers.wrap(client); final Ds3ClientHelpers.Job job = helpers.startReadAllJob(bucketName); final UUID jobId = job.getJobId(); job.transfer(new Ds3ClientHelpers.ObjectChannelBuilder() { @Override public SeekableByteChannel buildChannel(final String key) throws IOException { final Path filePath = Files.createTempFile("ds3", key); return Files.newByteChannel(filePath, StandardOpenOption.DELETE_ON_CLOSE, StandardOpenOption.WRITE); } }); <START> final JobStatus expectedJobStatus = JobStatus.COMPLETED; <END> assertThat(JobStatusHelper.getJobStatusWithRetries(client, jobId, expectedJobStatus), is(JobStatus.COMPLETED)); } finally { deleteAllContents(client, bucketName); } }</code><technical_language>This inlined call below</technical_language>

Target:
public void getContents() throws IOException, SignatureException, URISyntaxException, XmlProcessingException, InterruptedException { final String bucketName = "test_get_contents"; try { client.putBucket(new PutBucketRequest(bucketName)); loadBookTestData(client, bucketName); final Ds3ClientHelpers helpers = Ds3ClientHelpers.wrap(client); final Ds3ClientHelpers.Job job = helpers.startReadAllJob(bucketName); final UUID jobId = job.getJobId(); job.transfer(new Ds3ClientHelpers.ObjectChannelBuilder() { @Override public SeekableByteChannel buildChannel(final String key) throws IOException { final Path filePath = Files.createTempFile("ds3", key); return Files.newByteChannel(filePath, StandardOpenOption.DELETE_ON_CLOSE, StandardOpenOption.WRITE); } }); assertThat(JobStatusHelper.getJobStatusWithRetries(client, jobId, JobStatus.COMPLETED), is(JobStatus.COMPLETED)); } finally { deleteAllContents(client, bucketName); } }
Source:
<code>public void removeServiceProviders() throws Exception { NewOperator operator = newOperator().build(); Object operID = operRepository.create(operator); NewServiceProvider newSP = newServiceProvider().build(); Object spID = providerRepository.create(newSP); List<ID> spIDs = Lists.newArrayList(new ID(spID)); operRepository.assignServiceProviders(new ID(operID), spIDs); operRepository.removeServiceProviders(new ID(operID), spIDs); List<ServiceProvider> got = operRepository.findServiceProviders(new ID(operID)); List<ServiceProvider> want = Lists.newArrayList(); <START> assertThat(got, deepEquals(want)); <END> }</code><technical_language>assertTrue(got.isEmpty())</technical_language>

Target:
public void removeServiceProviders() throws Exception { NewOperator operator = newOperator().build(); Object operID = operRepository.create(operator); NewServiceProvider newSP = newServiceProvider().build(); Object spID = providerRepository.create(newSP); List<ID> spIDs = Lists.newArrayList(new ID(spID)); operRepository.assignServiceProviders(new ID(operID), spIDs); operRepository.removeServiceProviders(new ID(operID), spIDs); List<ServiceProvider> got = operRepository.findServiceProviders(new ID(operID)); assertTrue(got.isEmpty()); }
Source:
<code>public List<AuditEvent> resolveVirtualAttributeValueChange(PerunSessionImpl sess, AuditEvent message) throws InternalErrorException, AttributeNotExistsException, WrongAttributeAssignmentException { List<AuditEvent> resolvingMessages = new ArrayList<>(); if (message == null) return resolvingMessages; User user = null; try { if (message instanceof UserExtSourceAddedToUser) { user = ((UserExtSourceAddedToUser) message).getUser(); sess.getPerunBl().getUsersManagerBl().checkUserExists(sess, user); resolvingMessages.add(resolveEvent(sess, user)); } else if (message instanceof UserExtSourceRemovedFromUser) { user = ((UserExtSourceRemovedFromUser) message).getUser(); sess.getPerunBl().getUsersManagerBl().checkUserExists(sess, user); resolvingMessages.add(resolveEvent(sess, user)); } else if (message instanceof UserExtSourceUpdated) { resolvingMessages.add(resolveEvent(sess, sess.getPerunBl().getUsersManagerBl().getUserById( sess, ((UserExtSourceUpdated) message).getUserExtSource().getUserId()))); } } catch (UserNotExistsException e) { <START> throw new ConsistencyErrorException("User "+user+" associated with "+message.getName()+" event no longer exists while resolving virtual attribute value change for LoA.", e); <END> } return resolvingMessages; }</code><technical_language>ignore this situation, log instead of throwing exception</technical_language>

Target:
public List<AuditEvent> resolveVirtualAttributeValueChange(PerunSessionImpl sess, AuditEvent message) throws InternalErrorException, AttributeNotExistsException, WrongAttributeAssignmentException { List<AuditEvent> resolvingMessages = new ArrayList<>(); if (message == null) return resolvingMessages; User user = null; try { if (message instanceof UserExtSourceAddedToUser) { user = ((UserExtSourceAddedToUser) message).getUser(); sess.getPerunBl().getUsersManagerBl().checkUserExists(sess, user); resolvingMessages.add(resolveEvent(sess, user)); } else if (message instanceof UserExtSourceRemovedFromUser) { user = ((UserExtSourceRemovedFromUser) message).getUser(); sess.getPerunBl().getUsersManagerBl().checkUserExists(sess, user); resolvingMessages.add(resolveEvent(sess, user)); } else if (message instanceof UserExtSourceUpdated) { resolvingMessages.add(resolveEvent(sess, sess.getPerunBl().getUsersManagerBl().getUserById( sess, ((UserExtSourceUpdated) message).getUserExtSource().getUserId()))); } } catch (UserNotExistsException e) { log.warn("User associated with event no longer exists while resolving virtual attribute value change for LoA.", user, message.getName()); } return resolvingMessages; }
Source:
<code>public Map<Long, Long> get(Iterable<Long> startTimestamps) { Map<T, List<Long>> queryMap = StreamSupport.stream(startTimestamps.spliterator(), false) .collect(Collectors.groupingBy(timestampToServiceKey)); <START> Set<T> extraKeys = Sets.difference(queryMap.keySet(), keyedServices.keySet()); <END> if (!extraKeys.isEmpty()) { throw new SafeIllegalStateException("A batch of timestamps produced some transaction service keys which" + " are unknown: {}. Known transaction service keys were {}.", SafeArg.of("timestamps", startTimestamps), SafeArg.of("extraKeys", extraKeys), SafeArg.of("knownServiceKeys", keyedServices.keySet())); } return queryMap.entrySet() .stream() .map(entry -> keyedServices.get(entry.getKey()).get(entry.getValue())) .flatMap(longLongMap -> longLongMap.entrySet().stream()) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); }</code><technical_language>nit: unknownKeys</technical_language>

Target:
public Map<Long, Long> get(Iterable<Long> startTimestamps) { Map<T, List<Long>> queryMap = StreamSupport.stream(startTimestamps.spliterator(), false) .collect(Collectors.groupingBy(timestampToServiceKey)); Set<T> unknownKeys = Sets.difference(queryMap.keySet(), keyedServices.keySet()); if (!unknownKeys.isEmpty()) { throw new SafeIllegalStateException("A batch of timestamps produced some transaction service keys which" + " are unknown: {}. Known transaction service keys were {}.", SafeArg.of("timestamps", startTimestamps), SafeArg.of("unknownKeys", unknownKeys), SafeArg.of("knownServiceKeys", keyedServices.keySet())); } return queryMap.entrySet() .stream() .map(entry -> keyedServices.get(entry.getKey()).get(entry.getValue())) .collect(HashMap::new, Map::putAll, Map::putAll); }
Source:
<code>MessageFormatFlags getOperationFlag() { <START> switch (options.getOperationType()) { <END> case Data: return MessageFormatFlags.Blob; default: return MessageFormatFlags.All; } }</code><technical_language>considering cases, choose if-else (or ternary operator here) switch-case</technical_language>

Target:
MessageFormatFlags getOperationFlag() { return options.getOperationType() == GetBlobOptions.OperationType.Data ? MessageFormatFlags.Blob : MessageFormatFlags.All; }
Source:
<code>public List<GitReferenceUpdatedListener.Update> getUpdates() { GitReferenceUpdatedListener.Update update = new GitReferenceUpdatedListener.Update() { public String getRefName() { return ref; } <START> @Override <END> public String getOldObjectId() { return oldObjectId; } @Override public String getNewObjectId() { return newObjectId; } }; return ImmutableList.of(update); }</code><technical_language>do need @Override these, getRefName</technical_language>

Target:
public List<GitReferenceUpdatedListener.Update> getUpdates() { GitReferenceUpdatedListener.Update update = new GitReferenceUpdatedListener.Update() { @Override public String getRefName() { return ref; } @Override public String getOldObjectId() { return oldObjectId; } @Override public String getNewObjectId() { return newObjectId; } }; return ImmutableList.of(update); }
Source:
<code><START> private static double totalCost(final int numWorker, final int numDataBlocks, final int numModelBlocks, <END> final int availableEvaluators, final List<EvaluatorSummary> workers, final List<EvaluatorSummary> servers) { final double workerUnitCostInvSum = workers.subList(0, numWorker).stream() .mapToDouble(worker -> worker.unitCostInv) .sum(); final double compCost = numDataBlocks / workerUnitCostInvSum; final double serverUnitCostInvSum = servers.subList(0, availableEvaluators - numWorker).stream() .mapToDouble(server -> server.unitCostInv) .sum(); final double commCost = numModelBlocks / serverUnitCostInvSum * numWorker; return compCost + (commCost * numMiniBatchPerItr); }</code><technical_language>mentioned above, making a non-static method</technical_language>

Target:
private double totalCost(final int numWorker, final int numDataBlocks, final int numModelBlocks, final int availableEvaluators, final List<EvaluatorSummary> workers, final List<EvaluatorSummary> servers) { final double workerThroughputSum = workers.subList(0, numWorker).stream() .mapToDouble(worker -> worker.throughput) .sum(); final double compCost = numDataBlocks / workerThroughputSum; final double serverThroughputSum = servers.subList(0, availableEvaluators - numWorker).stream() .mapToDouble(server -> server.throughput) .sum(); final double commCost = numModelBlocks / serverThroughputSum * numWorker; return compCost + (commCost * numMiniBatchPerItr); }
Source:
<code>public boolean visit(FieldAccess node) { char[] fieldName = node.getName().getIdentifier().toCharArray(); char[] superName = new char[0]; Expression expression = node.getExpression(); switch <START> (expression.getNodeType()) <END> { case ASTNode.THIS_EXPRESSION : superName = contextNames.isEmpty() ? null : contextNames.peek(); break; case ASTNode.SIMPLE_NAME : superName = ((SimpleName) expression).getIdentifier().toCharArray(); break; case ASTNode.FIELD_ACCESS : superName = ((FieldAccess) expression).getName().getIdentifier().toCharArray(); break; } if (node.getParent().getNodeType() != ASTNode.FUNCTION_INVOCATION) { if (node.getParent().getNodeType() == ASTNode.ASSIGNMENT && ((Assignment) node.getParent()).getRightHandSide() == node) { indexer.addFieldReference(fieldName); } if (isFieldDeclaration(superName, fieldName)) { indexer.addFieldDeclaration(null, fieldName, superName, 0, false); } else { indexer.addFieldReference(fieldName); } } return true; }</code><technical_language>thing: a check for null</technical_language>

Target:
public boolean visit(FieldAccess node) { char[] fieldName = node.getName().getIdentifier().toCharArray(); char[] superName = new char[0]; Expression expression = node.getExpression(); if (expression == null) { return true; } switch (expression.getNodeType()) { case ASTNode.THIS_EXPRESSION : superName = contextNames.isEmpty() ? null : contextNames.peek(); break; case ASTNode.SIMPLE_NAME : superName = ((SimpleName) expression).getIdentifier().toCharArray(); break; case ASTNode.FIELD_ACCESS : superName = ((FieldAccess) expression).getName().getIdentifier().toCharArray(); break; } if (node.getParent().getNodeType() != ASTNode.FUNCTION_INVOCATION) { if (node.getParent().getNodeType() == ASTNode.ASSIGNMENT && ((Assignment) node.getParent()).getRightHandSide() == node) { indexer.addFieldReference(fieldName); } if (isFieldDeclaration(superName, fieldName)) { indexer.addFieldDeclaration(null, fieldName, superName, 0, false); contextNames.push(fieldName); anonymousNameAvailable = true; } else { indexer.addFieldReference(fieldName); } } return true; }
Source:
<code>public boolean addListener(String type, long id, ClassLoaderListener classLoaderListener) { <START> final VirtualClassLoader localClassLoader = ((VirtualClassLoader) getLocalClassLoader(type, id)); <END> return localClassLoader.addListener(classLoaderListener); }</code><technical_language>change return type of getLocalClassLoader in implementation avoid cast</technical_language>

Target:
public boolean addListener(String type, long id, ClassLoaderListener classLoaderListener) { final VirtualClassLoader localClassLoader = getLocalClassLoader(type, id); return localClassLoader.addListener(classLoaderListener); }
Source:
<code>public URI getOutputChannel() throws InfrastructureException { try { return URI.create(websocketOutputEndpoint); <START> } catch (UriBuilderException | IllegalArgumentException ex) { <END> throw new InternalInfrastructureException( "Failed to get the output channel because: " + ex.getLocalizedMessage()); } }</code><technical_language>catching of UriBuilderException is redundant. in Openshift infra</technical_language>

Target:
public URI getOutputChannel() throws InfrastructureException { try { return URI.create(websocketOutputEndpoint); } catch (IllegalArgumentException ex) { throw new InternalInfrastructureException( "Failed to get the output channel because: " + ex.getLocalizedMessage()); } }
Source:
<code>public TopicThreads call( ) throws Exception{ try { if(courseId!=null){ String view; if (filter == DiscussionPostsFilter.UNREAD) view = "unread"; else if (filter == DiscussionPostsFilter.UNANSWERED) view = "unanswered"; else view = ""; String order; if (orderBy == DiscussionPostsSort.LAST_ACTIVITY_AT) order = "last_activity_at"; else if (orderBy == DiscussionPostsSort.VOTE_COUNT) order = "vote_count"; <START> else order = "comment_count"; <END> int pageSize = pagination.pageSize(); int page = pagination.numOfPagesLoaded() + 1; return environment.getDiscussionAPI().getFollowingThreadList(courseId, view, order, pageSize, page); } } catch (Exception ex) { handle(ex); logger.error(ex, true); } return null; }</code><technical_language>This key ideally a property of DiscussionPostsSort enum, display text resource IDs are. If property is set a public final variable, referenced a get method, implementation of is you</technical_language>

Target:
public TopicThreads call() throws Exception { try { if (courseId != null) { int pageSize = pagination.pageSize(); int page = pagination.numOfPagesLoaded() + 1; return environment.getDiscussionAPI().getFollowingThreadList(courseId, filter.getQueryParamValue(), orderBy.getQueryParamValue(), pageSize, page); } } catch (Exception ex) { handle(ex); logger.error(ex, true); } return null; }
Source:
<code>private static Set<String> getChainHeadFromAllSegments(Layout layout) { List<Layout.LayoutSegment> segments = layout.getSegments(); <START> validateSegments(layout.getSegments()); <END> return segments.stream() .map(Layout.LayoutSegment::getFirstStripe) .map(Layout.LayoutStripe::getLogServers) .map(strip -> strip.get(0)) .collect(Collectors.toSet()); }</code><technical_language>This moved line</technical_language>

Target:
private static Set<String> getChainHeadFromAllSegments(Layout layout) { validateSegments(layout.getSegments()); List<Layout.LayoutSegment> segments = layout.getSegments(); return segments.stream() .map(Layout.LayoutSegment::getFirstStripe) .map(Layout.LayoutStripe::getLogServers) .map(strip -> strip.get(0)) .collect(Collectors.toSet()); }
Source:
<code>public boolean onSingleTapConfirmed(MotionEvent event) { <START> new PageBookmarkTask(getActivity()).execute(mPageNumber); <END> return true; }</code><technical_language>yes, right</technical_language>

Target:
public boolean onSingleTapConfirmed(MotionEvent event) { new TogglePageBookmarkTask().execute(mPageNumber); return true; }