auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public int getNumOfMsqOptions(int qnNumber) { int numOfOptions = 0; if (isGenerateOptionsForMsqChecked(qnNumber)) { String selectedOption = getGenerateOptionsForMsqValue(qnNumber); switch (selectedOption) { case "students": numOfOptions = getNumOfStudentsForFs(); break; case "teams": numOfOptions = getNumOfTeamsForFs(); break; case "instructors": numOfOptions = getNumOfInstructorsForFs(); break; default: numOfOptions = 0; break; } } else { numOfOptions = browser.driver.findElements( By.cssSelector("#msqChoiceTable-" + qnNumber + " div[id*=\"msqOptionRow\"]")).size(); } <START> return numOfOptions; <END> }</code><technical_language>Again, here, do return case blocks</technical_language>

Target:
public int getNumOfMsqOptions(int qnNumber) { if (isGenerateOptionsForMsqChecked(qnNumber)) { String selectedOption = getGenerateOptionsForMsqValue(qnNumber); switch (selectedOption) { case "students": return getNumOfStudentsForFs(); case "teams": return getNumOfTeamsForFs(); case "instructors": return getNumOfInstructorsForFs(); default: return 0; } } return browser.driver.findElements( By.cssSelector("#msqChoiceTable-" + qnNumber + " div[id*=\"msqOptionRow\"]")).size(); }
Source:
<code>public void preClose(final ObserverContext<RegionCoprocessorEnvironment> c, boolean abortRequested) { executor.shutdownNow(); <START> GlobalCache.getInstance(c.getEnvironment()).getMetaDataCache().invalidateAll(); <END> }</code><technical_language>I need do this</technical_language>

Target:
public void preClose(final ObserverContext<RegionCoprocessorEnvironment> c, boolean abortRequested) { executor.shutdownNow(); }
Source:
<code>public void testDeserialize() throws Exception { String data = getResourceAsString("/api_fixtures/usage_record.json"); UsageRecord resource = APIResource.GSON.fromJson(data, UsageRecord.class); assertNotNull(resource); <START> assertNotNull(resource.getId()); <END> }</code><technical_language>stripe-mock</technical_language>

Target:
public void testDeserialize() throws Exception { final String data = getResourceAsString("/api_fixtures/usage_record.json"); final UsageRecord record = APIResource.GSON.fromJson(data, UsageRecord.class); assertNotNull(record); assertNotNull(record.getId()); assertEquals("usage_record", record.getObject()); }
Source:
<code>private boolean pingLeader(Optional<PaxosValue> maybeGreatestLearnedValue) { if (!maybeGreatestLearnedValue.isPresent()) { return false; } <START> return leaderPinger.pingLeaderWithUuid(UUID.fromString(maybeGreatestLearnedValue.get().getLeaderUUID())); <END> }</code><technical_language>Hmm, a bunch of on. this is superhot (which I is) I write return maybeGreatestLearnedValue .map(PaxosValue::getLeaderUUID) .map(UUID::fromString) .map(leaderPinger::pingLeaderWithUuid) .orElse(false);</technical_language>

Target:
private boolean pingLeader(Optional<PaxosValue> maybeGreatestLearnedValue) { return maybeGreatestLearnedValue .map(PaxosValue::getLeaderUUID) .map(UUID::fromString) .map(leaderPinger::pingLeaderWithUuid) .orElse(false); }
Source:
<code>public int getNumIdleInstances(ServiceEndPoint endPoint) { String uniqueId = buildUniqueId(endPoint); <START> return _instancesPerEndpoint.get(uniqueId) == null ? 0 : 1; <END> }</code><technical_language>sense do a containsKey(uniqueId) instead, cases a null service instance</technical_language>

Target:
public int getNumIdleInstances(ServiceEndPoint endPoint) { checkNotNull(endPoint); return _instancesPerEndpoint.containsKey(endPoint) ? 1 : 0; }
Source:
<code>public FirebaseAuthAnonymousUpgradeException(@ErrorCodes.Code int code, @NonNull IdpResponse response) { super(ErrorCodes.toFriendlyMessage(code)); <START> this.response = response; <END> }</code><technical_language>Nit: this, mResponse. finally able get rid of convention start Kotlin, for now, consistent</technical_language>

Target:
public FirebaseAuthAnonymousUpgradeException(@ErrorCodes.Code int code, @NonNull IdpResponse response) { super(ErrorCodes.toFriendlyMessage(code)); mResponse = response; }
Source:
<code>public static void removeCallControlMucAccount(String id) { ConfigurationService config = JigasiBundleActivator.getConfigurationService(); ProtocolProviderFactory xmppProviderFactory = ProtocolProviderFactory.getProtocolProviderFactory( JigasiBundleActivator.osgiContext, ProtocolNames.JABBER); AccountManager accountManager = ProtocolProviderActivator.getAccountManager(); String accountIDStr = config.getString( accountManager.getFactoryImplPackageName(xmppProviderFactory) + "." + id + "." + ProtocolProviderFactory.ACCOUNT_UID); AccountID accountID = accountManager.getStoredAccounts().stream() .filter(a -> a.getAccountUniqueID().equals(accountIDStr)) .findFirst().orElse(null); if (accountID != null) { boolean result = xmppProviderFactory.uninstallAccount(accountID); logger.info("Removing muc control account: " + id + ", successful:" + result); } else { <START> logger.warn("No muc control account found for removing"); <END> } }</code><technical_language>propagate this HTTP</technical_language>

Target:
public static boolean removeCallControlMucAccount(String id) { ConfigurationService config = JigasiBundleActivator.getConfigurationService(); ProtocolProviderFactory xmppProviderFactory = ProtocolProviderFactory.getProtocolProviderFactory( JigasiBundleActivator.osgiContext, ProtocolNames.JABBER); AccountManager accountManager = ProtocolProviderActivator.getAccountManager(); String accountIDStr = config.getString( accountManager.getFactoryImplPackageName(xmppProviderFactory) + "." + id + "." + ProtocolProviderFactory.ACCOUNT_UID); AccountID accountID = accountManager.getStoredAccounts().stream() .filter(a -> a.getAccountUniqueID().equals(accountIDStr)) .findFirst().orElse(null); if (accountID != null) { boolean result = xmppProviderFactory.uninstallAccount(accountID); logger.info("Removing muc control account: " + id + ", successful:" + result); return result; } else { logger.warn("No muc control account found for removing"); return false; } }
Source:
<code>public List<Option> getOptions() { <START> return unmodifiableList(options); <END> }</code><technical_language>This class immutable wrap collection in constructor time is returned caller</technical_language>

Target:
public List<Option> getOptions() { return options; }
Source:
<code>public void openFile() { FileDialog fd = new FileDialog(viewer.getControl().getShell(), SWT.OK); String filePath = fd.open(); if (!filePath.isEmpty()) { parseFile(filePath, <START> "-1"); <END> } else { showMessage(viewer.getControl().getShell(), SWT.ERROR, "Error", "Not an Excel or Word file."); } viewer.refresh(); }</code><technical_language>class-level constant</technical_language>

Target:
public void openFile() { FileDialog fd = new FileDialog(viewer.getControl().getShell(), SWT.OK); String filePath = fd.open(); if (!filePath.isEmpty()) { parseFile(filePath, OBJECT_ID_NOT_SPECIFIED); } else { showMessage(viewer.getControl().getShell(), SWT.ERROR, "Error", "Couldn't find the file."); } viewer.refresh(); }
Source:
<code><START> public void start() { <END> if (isStarted) { return; } thread = new IncrementThread(); thread.start(); isStarted = true; Log.i(TAG, "Background job started."); }</code><technical_language>of methods depend start called a single thread. more clear safer if start/stop synchronized</technical_language>

Target:
public void start() { synchronized (lock) { if (isStarted) { return; } thread = new IncrementThread(); thread.start(); isStarted = true; Log.i(TAG, "Background job started."); } }
Source:
<code><START> public Text next() { <END> if (toBeReturned!=null) { Text result = toBeReturned; toBeReturned = null; return result; } else { return getNext(); } }</code><technical_language>throw NoSuchElementException</technical_language>

Target:
public Text next() { if (toBeReturned != null) { Text result = toBeReturned; toBeReturned = null; return result; } else { Text resultCandidate = getNext(); if (resultCandidate!=null) { return resultCandidate; } else { throw new NoSuchElementException(); } } }
Source:
<code>private void handleOffsetOutOfRange(FetchPosition fetchPosition, TopicPartition topicPartition) { String errorMessage = "Fetch position " + fetchPosition + " is out of range for partition " + topicPartition; if (subscriptions.hasDefaultOffsetResetPolicy()) { log.info("{}, resetting offset", errorMessage); subscriptions.requestOffsetReset(topicPartition); } else { log.info("{}, raising error to the application", errorMessage); <START> throw new OffsetOutOfRangeException(errorMessage, <END> Collections.singletonMap(topicPartition, fetchPosition.offset)); } }</code><technical_language>mention configured reset policy IMHO</technical_language>

Target:
private void handleOffsetOutOfRange(FetchPosition fetchPosition, TopicPartition topicPartition) { String errorMessage = "Fetch position " + fetchPosition + " is out of range for partition " + topicPartition; if (subscriptions.hasDefaultOffsetResetPolicy()) { log.info("{}, resetting offset", errorMessage); subscriptions.requestOffsetReset(topicPartition); } else { log.info("{}, raising error to the application since no reset policy is configured", errorMessage); throw new OffsetOutOfRangeException(errorMessage, Collections.singletonMap(topicPartition, fetchPosition.offset)); } }
Source:
<code>public void testAllModulesWithDefaultConfiguration() throws Exception { final String inputFilePath = getPath("InputAllChecksDefaultConfig.java"); final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; for (Class<?> module : CheckUtil.getCheckstyleModules()) { if (ModuleReflectionUtil.isRootModule(module)) { continue; } final DefaultConfiguration moduleConfig = createModuleConfig(module); if (module.equals(ImportControlCheck.class)) { moduleConfig.addAttribute("file", getPath( "InputAllChecksImportControl.xml")); } else if (module.equals(NewlineAtEndOfFileCheck.class)) { <START> moduleConfig.addAttribute("lineSeparator", "lf"); <END> } final Checker checker = createChecker(moduleConfig); verify(checker, inputFilePath, expected); } }</code><technical_language>Newline defaults allow LF, CRLF, CR. I this is required now</technical_language>

Target:
public void testAllModulesWithDefaultConfiguration() throws Exception { final String inputFilePath = getPath("InputAllChecksDefaultConfig.java"); final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; for (Class<?> module : CheckUtil.getCheckstyleModules()) { if (ModuleReflectionUtil.isRootModule(module)) { continue; } final DefaultConfiguration moduleConfig = createModuleConfig(module); if (module.equals(ImportControlCheck.class)) { moduleConfig.addAttribute("file", getPath( "InputAllChecksImportControl.xml")); } final Checker checker = createChecker(moduleConfig); verify(checker, inputFilePath, expected); } }
Source:
<code>private void initOpenVideoButton(View view, final EditText embedCodeEditText, final EditText pCodeEditText, final CheckBox imaCheckBox) { view.findViewById(R.id.open_button).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { AdType adType = imaCheckBox.isChecked() ? AdType.IMA : AdType.VAST; String embedCode = embedCodeEditText.getText().toString(); String pCode = pCodeEditText.getText().toString(); if (embedCode.isEmpty()) { embedCode = "dyeW82ZDE6cFE2fW4sWqaOSmRHVWj8yp"; adType = AdType.IMA; } if (pCode.isEmpty()) { pCode = "BzY2syOq6kIK6PTXN7mmrGVSJEFj"; } <START> <END> VideoData data = new VideoData(VideoItemType.VIDEO, "Custom video", adType, embedCode, pCode); FragmentActivity activity = getActivity(); if (activity instanceof VideoChooseInterface) { ((VideoChooseInterface) activity).onVideoChoose(data); } dismiss(); } }); }</code><technical_language>if embed pcode empty please create a toast msg instead of opening fragment hardcoded video</technical_language>

Target:
private void initOpenVideoButton(View view, final EditText embedCodeEditText, final EditText pCodeEditText, final CheckBox imaCheckBox) { view.findViewById(R.id.open_button).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { AdType adType = imaCheckBox.isChecked() ? AdType.IMA : AdType.VAST; String embedCode = embedCodeEditText.getText().toString(); String pCode = pCodeEditText.getText().toString(); if (embedCode.isEmpty()) { Toast.makeText(getContext(), "Embed code can't be empty!", Toast.LENGTH_LONG).show(); dismiss(); return; } if (pCode.isEmpty()) { pCode = "BzY2syOq6kIK6PTXN7mmrGVSJEFj"; } VideoData data = new VideoData(VideoItemType.VIDEO, "Custom video", adType, embedCode, pCode); FragmentActivity activity = getActivity(); if (activity instanceof VideoChooseInterface) { ((VideoChooseInterface) activity).onVideoChoose(data); } dismiss(); } }); }
Source:
<code>public GalleryBuilderComponentObject clickGalleryButton(){ waitForElementByElement(galleryButton); scrollAndClick(galleryButton); <START> PageObjectLogging.log("clickGallery", "gallery button clicked", true); <END> return new GalleryBuilderComponentObject(driver); }</code><technical_language>clickGallery is name of method</technical_language>

Target:
public GalleryBuilderComponentObject clickGalleryButton(){ waitForElementByElement(galleryButton); scrollAndClick(galleryButton); PageObjectLogging.log("clickGalleryButton", "gallery button clicked", true); return new GalleryBuilderComponentObject(driver); }
Source:
<code>static BlobReadOptions fromBytes(DataInputStream stream, StoreKeyFactory factory, Log log) throws IOException { short version = stream.readShort(); switch (version) { case 0: <START> Offset offset = new Offset(log.getStartOffset().getName(), stream.readLong()); <END> long size = stream.readLong(); long ttl = stream.readLong(); StoreKey key = factory.getStoreKey(stream); return new BlobReadOptions(log, offset, size, ttl, key); case 1: offset = Offset.fromBytes(stream); size = stream.readLong(); ttl = stream.readLong(); key = factory.getStoreKey(stream); return new BlobReadOptions(log, offset, size, ttl, key); default: throw new IOException("Unknown version encountered for BlobReadOptions"); } }</code><technical_language>log.getFirstSegment().getName() more intuitive</technical_language>

Target:
static BlobReadOptions fromBytes(DataInputStream stream, StoreKeyFactory factory, Log log) throws IOException { short version = stream.readShort(); switch (version) { case 0: Offset offset = new Offset(log.getFirstSegment().getName(), stream.readLong()); long size = stream.readLong(); long expiresAtMs = stream.readLong(); StoreKey key = factory.getStoreKey(stream); return new BlobReadOptions(log, offset, size, expiresAtMs, key); case 1: offset = Offset.fromBytes(stream); size = stream.readLong(); expiresAtMs = stream.readLong(); key = factory.getStoreKey(stream); return new BlobReadOptions(log, offset, size, expiresAtMs, key); default: throw new IOException("Unknown version encountered for BlobReadOptions"); } }
Source:
<code>protected void service(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException { LOG.debug("Metrics servlet called"); <START> String response = prometheusRegistry.scrape(); <END> resp.getOutputStream().write(response.getBytes()); }</code><technical_language>Add final keyword</technical_language>

Target:
protected void service(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException { LOG.debug("Metrics servlet called"); final String response = prometheusRegistry.scrape(); resp.getOutputStream().write(response.getBytes()); }
Source:
<code>private String getRequestBody(HttpServerExchange exchange) { exchange.startBlocking(); Scanner scanner = new Scanner(exchange.getInputStream()).useDelimiter("\\A"); String requestBody = scanner.hasNext() ? scanner.next() : ""; requestBody = <START> requestBody.replaceAll("\\s+",""); <END> return requestBody; }</code><technical_language>I this safe, remove spaces values of tags attributes. For example, if I send this: <vm> <description>My VM</description> </vm> replaced this: <vm><description>MyVM</description></vm> description wrong. replace ">\\s+" "><", generate wrong data, in tests</technical_language>

Target:
private String getRequestBody(HttpServerExchange exchange) { exchange.startBlocking(); Scanner scanner = new Scanner(exchange.getInputStream()).useDelimiter("\\A"); String requestBody = scanner.hasNext() ? scanner.next() : ""; requestBody = requestBody.replaceAll(">\\s+<", "><"); return requestBody; }
Source:
<code>public void testSIPreventsReadSkewUsingWritePredicate(ITestContext context) throws Exception { TransactionManager tm = newTransactionManager(context); TTable txTable = new TTable(hbaseConf, TEST_TABLE); Transaction tx1 = tm.begin(); Transaction tx2 = tm.begin(); Scan rowId1Scan = new Scan(rowId1, rowId1); rowId1Scan.addColumn(famName, colName); <START> assertNumberOfRows(txTable, tx1, 2, new Scan()); <END> assertNumberOfRows(txTable, tx2, 2, new Scan()); Put updateRow1Tx2 = new Put(rowId1); updateRow1Tx2.add(famName, colName, Bytes.toBytes(12)); Put updateRow2Tx2 = new Put(rowId2); updateRow2Tx2.add(famName, colName, Bytes.toBytes(18)); txTable.put(tx2, Arrays.asList(updateRow1Tx2, updateRow2Tx2)); tm.commit(tx2); Filter f = new SingleColumnValueFilter(famName, colName, CompareFilter.CompareOp.EQUAL, Bytes.toBytes(20)); Scan checkFor20 = new Scan(); checkFor20.setFilter(f); ResultScanner checkFor20Scanner = txTable.getScanner(tx1, checkFor20); Result res = checkFor20Scanner.next(); while (res != null) { LOG.info("RESSS {}", res); LOG.info("Deleting row id with value {}", Bytes.toString(res.getRow()), Bytes.toInt(res.getValue(famName, colName))); Delete delete20 = new Delete(res.getRow()); txTable.delete(tx1, delete20); res = checkFor20Scanner.next(); } try { tm.commit(tx1); fail("Should be aborted"); } catch (RollbackException e) { } }</code><technical_language>be: assertNumberOfRows(txTable, tx1, 1, rowId1Scan);</technical_language>

Target:
public void testSIPreventsReadSkewUsingWritePredicate(ITestContext context) throws Exception { TransactionManager tm = newTransactionManager(context); TTable txTable = new TTable(hbaseConf, TEST_TABLE); Transaction tx1 = tm.begin(); Transaction tx2 = tm.begin(); assertNumberOfRows(txTable, tx1, 2, new Scan()); assertNumberOfRows(txTable, tx2, 2, new Scan()); Put updateRow1Tx2 = new Put(rowId1); updateRow1Tx2.add(famName, colName, Bytes.toBytes(12)); Put updateRow2Tx2 = new Put(rowId2); updateRow2Tx2.add(famName, colName, Bytes.toBytes(18)); txTable.put(tx2, Arrays.asList(updateRow1Tx2, updateRow2Tx2)); tm.commit(tx2); Filter f = new SingleColumnValueFilter(famName, colName, CompareFilter.CompareOp.EQUAL, Bytes.toBytes(20)); Scan checkFor20 = new Scan(); checkFor20.setFilter(f); ResultScanner checkFor20Scanner = txTable.getScanner(tx1, checkFor20); Result res = checkFor20Scanner.next(); while (res != null) { LOG.info("RESSS {}", res); LOG.info("Deleting row id with value {}", Bytes.toString(res.getRow()), Bytes.toInt(res.getValue(famName, colName))); Delete delete20 = new Delete(res.getRow()); txTable.delete(tx1, delete20); res = checkFor20Scanner.next(); } try { tm.commit(tx1); fail("Should be aborted"); } catch (RollbackException e) { } }
Source:
<code>protected void init(final ImmutableMap<String, Object> execEnvVars) throws DbException, IOException { if (connectionInfo == null && execEnvVars != null) { connectionInfo = (ConnectionInfo) execEnvVars.get(MyriaConstants.EXEC_ENV_VAR_DATABASE_CONN_INFO); } if (lang == MyriaConstants.FunctionLanguage.PYTHON) { <START> <END> BASE64Decoder decoder = new BASE64Decoder(); if (binary != null) { byte[] decodedBytes = decoder.decodeBuffer(binary); ByteBuffer binaryFunction = ByteBuffer.wrap(decodedBytes); PythonFunctionRegistrar pyFunc = new PythonFunctionRegistrar(connectionInfo); pyFunc.addFunction(name, binaryFunction, outputSchema.toString()); } else { throw new DbException("Cannot register python UDF without binary"); } } }</code><technical_language>remove</technical_language>

Target:
protected void init(final ImmutableMap<String, Object> execEnvVars) throws DbException, IOException { if (connectionInfo == null && execEnvVars != null) { connectionInfo = (ConnectionInfo) execEnvVars.get(MyriaConstants.EXEC_ENV_VAR_DATABASE_CONN_INFO); } switch (lang) { case POSTGRES: Pattern pattern = Pattern.compile("(CREATE FUNCTION)([\\s\\S]*)(LANGUAGE SQL;)"); Matcher matcher = pattern.matcher(description); if (matcher.matches()) { String modifiedReplaceFunction = description.replace("CREATE FUNCTION", "CREATE OR REPLACE FUNCTION"); accessMethod.runCommand(modifiedReplaceFunction); } else { throw new DbException("Postgres function is invalid."); } break; case PYTHON: if (binary != null) { PythonFunctionRegistrar pyFunc = new PythonFunctionRegistrar(connectionInfo); pyFunc.addFunction(name, description, outputType, isMultiValued, binary); } else { throw new DbException("Cannot register python UDF without binary."); } break; default: throw new DbException("Function language not supported!"); } }
Source:
<code>public void rolloverException() throws Exception { final IncrementingPrintableStringGenerator gen = new IncrementingPrintableStringGenerator(2, ATOC); gen.setThrowExceptionOnRollover(true); int i = 0; try { while(i < 11) { ++i; gen.nextValue(); } <START> fail("Expected RuntimeException"); <END> } catch (RuntimeException e) { assertEquals(i, 10); } }</code><technical_language>testng equivalent junit's @Test(expected=SomeException.class) annotation</technical_language>

Target:
public void rolloverException() throws Exception { final IncrementingPrintableStringGenerator gen = new IncrementingPrintableStringGenerator(2, ATOC); gen.setThrowExceptionOnRollover(true); int i = 0; try { while(i < 11) { ++i; gen.nextValue(); } fail("Expected NoSuchElementException"); } catch (NoSuchElementException e) { assertEquals(i, 10); } }
Source:
<code>protected IsWidget createBodyPanel(String header, VmNetworkInterface networkInterface) { <START> descriptionHeaderPanel.getElement().setInnerHTML(header); <END> descriptionHeaderPanel.add(createLinkStatusPanel( networkInterface != null ? networkInterface.isLinked() : false)); descriptionHeaderPanel.add(createCardPluggedStatusPanel( networkInterface != null ? networkInterface.isPlugged() : false)); createAdditionalInfoPanel(); return bodyPanel; }</code><technical_language>setInnerHTML is dangerous, please setInnerText if possible</technical_language>

Target:
protected IsWidget createBodyPanel(String header, VmNetworkInterface networkInterface) { checkBoxPanel.add(createLinkStatusPanel(isInterfaceUp(networkInterface))); checkBoxPanel.add(createCardPluggedStatusPanel(isCardPlugged(networkInterface))); descriptionHeaderPanel.getElement().setInnerText(header); createAdditionalInfoPanel(); return bodyPanel; }
Source:
<code>public void performSearchByQueryPaged_twoPagesNotEqual() throws Exception { Page<BibEntry> page = fetcher.performSearchPaged("author:\"A\"", 0); <START> Page<BibEntry> page2 = fetcher.performSearchPaged("author:\"A\"", 1); <END> assertNotEquals(page.getContent(), page2.getContent(), "Two conseecutive pages shouldn't be equal"); }</code><technical_language>I think, in UI hard pass query. adding intermediate layer searchPagesFactory = fetcher.searchPagesFactory("author:...") searchPagesFactory.getPage(0)</technical_language>

Target:
public void performSearchByQueryPaged_twoPagesNotEqual() throws Exception { Page<BibEntry> page = fetcher.performSearchPaged("author:\"A\"", 0); Page<BibEntry> page2 = fetcher.performSearchPaged("author:\"A\"", 1); assertNotEquals(page.getContent(), page2.getContent(), "Two consecutive pages shouldn't be equal"); }
Source:
<code>private void addStorageResource() { String storageAccountName = name.replaceAll("[^A-Za-z0-9 ]", "") + "storage"; variables.put("storageAccountName", storageAccountName); ResourceDefinition storageAccount = ResourceDefinition.builder() .name("[variables('storageAccountName')]") .type("Microsoft.Storage/storageAccounts") .location(location) <START> .apiVersion("2015-06-15") <END> .properties( StorageServiceProperties.builder() .accountType(StorageService.AccountType.Standard_LRS) .build() ) .build(); resources.add(storageAccount); }</code><technical_language>Move this a constant is shared APIs too? (consider this elsewhere)</technical_language>

Target:
private void addStorageResource() { String storageAccountName = name.replaceAll("[^A-Za-z0-9 ]", "") + "storage"; variables.put("storageAccountName", storageAccountName); ResourceDefinition storageAccount = ResourceDefinition.builder() .name("[variables('storageAccountName')]") .type("Microsoft.Storage/storageAccounts") .location(location) .apiVersion(STORAGE_API_VERSION) .properties( StorageServiceProperties.builder() .accountType(StorageService.AccountType.Standard_LRS) .build() ) .build(); resources.add(storageAccount); }
Source:
<code><START> public ActiveDirectorySecurityRealm(String domain, String site, String bindName, <END> String bindPassword, String server, GroupLookupStrategy groupLookupStrategy, boolean removeIrrelevantGroups, Boolean customDomain, CacheConfiguration cache) { this(domain,site,bindName,bindPassword,server,groupLookupStrategy,removeIrrelevantGroups, customDomain, cache, "30000", "60000"); }</code><technical_language>possibly a DataboudSetter new fields</technical_language>

Target:
public ActiveDirectorySecurityRealm(String domain, String site, String bindName, String bindPassword, String server, GroupLookupStrategy groupLookupStrategy, boolean removeIrrelevantGroups, Boolean customDomain, CacheConfiguration cache) { if (customDomain!=null && !customDomain) domain = null; this.domain = fixEmpty(domain); this.site = fixEmpty(site); this.bindName = fixEmpty(bindName); this.bindPassword = Secret.fromString(fixEmpty(bindPassword)); this.groupLookupStrategy = groupLookupStrategy; this.removeIrrelevantGroups = removeIrrelevantGroups; server = fixEmpty(server); if (server != null) { String[] servers = server.split(","); for (int i = 0; i < servers.length; i++) { if (!servers[i].contains(":")) { servers[i] += ":3268"; } } server = StringUtils.join(servers, ","); } this.server = server; this.cache = cache; }
Source:
<code>private Factory<? extends CacheEntryEventFilter> getFilterFactory(ClientConnectionContext ctx) { if (filter == null) return null; if (!(filter instanceof BinaryObject)) throw new IgniteClientException(ClientStatus.FAILED, "Filter must be a BinaryObject: " + filter.getClass()); BinaryObjectImpl bo = (BinaryObjectImpl) filter; switch (filterPlatform) { case ClientPlatform.JAVA: { if (bo.typeId() == GridBinaryMarshaller.PLATFORM_JAVA_OBJECT_FACTORY_PROXY) { PlatformJavaObjectFactoryProxy prx = bo.deserialize(); CacheEntryEventSerializableFilter rmtFilter = (CacheEntryEventSerializableFilter) prx.factory(ctx.kernalContext()).create(); return FactoryBuilder.factoryOf(rmtFilter); } return bo.deserialize(); } case ClientPlatform.DOTNET: { PlatformContext platformCtx = ctx.kernalContext().platform().context(); String curPlatform = platformCtx.platform(); if (!PlatformUtils.PLATFORM_DOTNET.equals(curPlatform)) <START> throw new IgniteClientException(ClientStatus.FAILED, "ScanQuery filter platform is " + <END> PlatformUtils.PLATFORM_DOTNET + ", current platform is " + curPlatform); return FactoryBuilder.factoryOf(platformCtx.createContinuousQueryFilter(filter)); } default: throw new IgniteClientException(ClientStatus.FAILED, "Unsupported filter platform: " + filterPlatform); } }</code><technical_language>ScanQuery -> ContinuousQuery</technical_language>

Target:
private Factory<? extends CacheEntryEventFilter> getFilterFactory(ClientConnectionContext ctx) { if (filter == null) return null; if (!(filter instanceof BinaryObject)) throw new IgniteClientException(ClientStatus.FAILED, "Filter must be a BinaryObject: " + filter.getClass()); BinaryObjectImpl bo = (BinaryObjectImpl) filter; switch (filterPlatform) { case ClientPlatform.JAVA: { if (bo.typeId() == GridBinaryMarshaller.PLATFORM_JAVA_OBJECT_FACTORY_PROXY) { PlatformJavaObjectFactoryProxy prx = bo.deserialize(); CacheEntryEventSerializableFilter rmtFilter = (CacheEntryEventSerializableFilter) prx.factory(ctx.kernalContext()).create(); return FactoryBuilder.factoryOf(rmtFilter); } return bo.deserialize(); } case ClientPlatform.DOTNET: { PlatformContext platformCtx = ctx.kernalContext().platform().context(); String curPlatform = platformCtx.platform(); if (!PlatformUtils.PLATFORM_DOTNET.equals(curPlatform)) throw new IgniteClientException(ClientStatus.FAILED, "ContinuousQuery filter platform is " + PlatformUtils.PLATFORM_DOTNET + ", current platform is " + curPlatform); return FactoryBuilder.factoryOf(platformCtx.createContinuousQueryFilter(filter)); } default: throw new IgniteClientException(ClientStatus.FAILED, "Unsupported filter platform: " + filterPlatform); } }
Source:
<code>private void fetchRandomArticles() { <START> new RandomFetchTask(getActivity(), site) { <END> @Override public void onFinish(ArrayList<PageTitle> result) { if (!isAdded()) { return; } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { adapter.addAll(result); } else { for (PageTitle page : result) { adapter.add(page); } } fetchThumbnails(result); fetchWikidataIds(result); } @Override public void onCatch(Throwable caught) { if (!isAdded()) { return; } if (caught instanceof ApiException) { Crouton.makeText(getActivity(), R.string.error_network_error, Style.ALERT, randomContainer).show(); } else if (caught instanceof RandomFetchException) { Log.e("Wikipedia", "Could not get list of random articles: " + caught.toString()); Crouton.makeText(getActivity(), R.string.random_server_error, Style.ALERT, randomContainer).show(); } else { super.onCatch(caught); } } }.execute(); }</code><technical_language>Suggestion: interact main Progress Bar show user update is in progress. (For example, FullSearchFragment.java calls updateProgressBar function. (it's simple))</technical_language>

Target:
private void fetchRandomArticles() { new RandomFetchTask(getActivity(), site, NUMBER_OF_PAGES) { @Override public void onFinish(ArrayList<RandomPage> result) { if (!isAdded()) { return; } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { adapter.addAll(result); } else { for (RandomPage page : result) { adapter.add(page); } } fetchWikiDataDescriptions(result); } @Override public void onCatch(Throwable caught) { if (!isAdded()) { return; } if (caught instanceof ApiException) { Crouton.makeText(getActivity(), R.string.error_network_error, Style.ALERT, randomContainer).show(); } else if (caught instanceof RandomFetchException) { Log.e("Wikipedia", "Could not get list of random articles: " + caught.toString()); Crouton.makeText(getActivity(), R.string.random_server_error, Style.ALERT, randomContainer).show(); } else { super.onCatch(caught); } } }.execute(); }
Source:
<code>protected boolean isAccountAdmin(HttpServletRequest request) { M_log.debug("isAdmin() call"); String courseId = request.getParameter(Utils.LTI_PARAM_CANVAS_COURSE_ID); int userId = Integer.parseInt(request.getParameter(Utils.LTI_PARAM_CANVAS_USER_ID)); int courseAccountId = getCourseAccountId(courseId); if (courseAccountId == 0) { <START> return false; <END> } M_log.debug("*** Course Account ID " + courseAccountId); return determineIfUserIsAdminInHierarchy(userId, courseAccountId); }</code><technical_language>Leave a debug error log message</technical_language>

Target:
protected boolean isAccountAdmin(HttpServletRequest request) { M_log.debug("isAdmin() call"); String courseId = request.getParameter(Utils.LTI_PARAM_CANVAS_COURSE_ID); int userId = Integer.parseInt(request.getParameter(Utils.LTI_PARAM_CANVAS_USER_ID)); int courseAccountId = getCourseAccountId(courseId); if (courseAccountId == 0) { M_log.error("Couldn't get the course account id for course "+courseId); return false; } M_log.debug("*** Course Account ID " + courseAccountId); return determineIfUserIsAdminInHierarchy(userId, courseAccountId); }
Source:
<code>private void registerVillagerSkin(int villagerId, ResourceLocation villagerSkin) <START> { <END> if (newVillagers == null) { newVillagers = Maps.newHashMap(); } newVillagers.put(villagerId, villagerSkin); }</code><technical_language>This is deprecated removed in 1.8.8 exists dont want fire MissingMethodExceptions</technical_language>

Target:
private void registerVillagerSkin(int villagerId, ResourceLocation villagerSkin) { }
Source:
<code>public Task load(Long id) throws EntityNotFoundException { Task task = taskDao.load(id); <START> task.setHref(MessageFormat.format(systemPropertiesProvider.getProperty(SDC_MANAGER_URL)+ <END> Configuration.TASK_BASE_PATH, Long.valueOf(task.getId()) .toString(), task.getVdc())); return task; }</code><technical_language>blanck space "+"</technical_language>

Target:
public Task load(Long id) throws EntityNotFoundException { Task task = taskDao.load(id); task.setHref(getHrefUrl(task)); return task; }
Source:
<code>private void uploadBlocking(String key, long length, InputStream in, boolean casUpload) throws IOException, InterruptedException { InputStream wrappedIn = new FilterInputStream(in) { @Override public void close() { } }; UploadCommand upload = new UploadCommand(uri, casUpload, key, wrappedIn, length); Channel ch = null; boolean success = false; <START> if (storedBlobs.putIfAbsent((casUpload ? "cas/" : "ac/") + key, true) == null) { <END> try { ch = acquireUploadChannel(); ChannelFuture uploadFuture = ch.writeAndFlush(upload); uploadFuture.sync(); success = true; } catch (Exception e) { if (e instanceof HttpException) { HttpResponse response = ((HttpException) e).response(); if (authTokenExpired(response)) { refreshCredentials(); if (!reset(in)) { throw e; } putAfterCredentialRefresh(upload); success = true; return; } } throw e; } finally { if (!success) { storedBlobs.remove(key); } in.close(); if (ch != null) { releaseUploadChannel(ch); } } } }</code><technical_language>Move "cas/" "ac/" constants</technical_language>

Target:
private void uploadBlocking(String key, long length, InputStream in, boolean casUpload) throws IOException, InterruptedException { InputStream wrappedIn = new FilterInputStream(in) { @Override public void close() { } }; UploadCommand upload = new UploadCommand(uri, casUpload, key, wrappedIn, length); Channel ch = null; boolean success = false; if (storedBlobs.putIfAbsent((casUpload ? CAS_PREFIX : AC_PREFIX) + key, true) == null) { try { ch = acquireUploadChannel(); ChannelFuture uploadFuture = ch.writeAndFlush(upload); uploadFuture.sync(); success = true; } catch (Exception e) { if (e instanceof HttpException) { HttpResponse response = ((HttpException) e).response(); if (authTokenExpired(response)) { refreshCredentials(); if (!reset(in)) { throw e; } putAfterCredentialRefresh(upload); success = true; return; } } throw e; } finally { if (!success) { storedBlobs.remove(key); } in.close(); if (ch != null) { releaseUploadChannel(ch); } } } }
Source:
<code>public Set<TaskId> prevTasks() { <START> return data.prevTasks() <END> .stream() .map(t -> new TaskId(t.topicGroupId(), t.partition())) .collect(Collectors.toSet()); }</code><technical_language>want consider building Set time this method is invoked caching for subsequent calls? code this a hot code path task assignments change, sure. for method below</technical_language>

Target:
public Set<TaskId> prevTasks() { if (prevTasksCache == null) { prevTasksCache = Collections.unmodifiableSet( data.prevTasks() .stream() .map(t -> new TaskId(t.topicGroupId(), t.partition())) .collect(Collectors.toSet()) ); } return prevTasksCache; }
Source:
<code>public void testDirectArenaOffsetCacheLine() throws Exception { int capacity = 5; int alignment = 128; for (int i = 0; i < 1000; i++) { ByteBuffer bb = PlatformDependent.useDirectBufferNoCleaner() ? PlatformDependent.allocateDirectNoCleaner(capacity + alignment) : ByteBuffer.allocateDirect(capacity + alignment); PoolArena.DirectArena arena = new PoolArena.DirectArena(null, 0, 0, 9, 9, alignment); <START> Method offsetCacheLineMethod = arena.getClass().getDeclaredMethod("offsetCacheLine", ByteBuffer.class); <END> offsetCacheLineMethod.setAccessible(true); int offset = (Integer) offsetCacheLineMethod.invoke(arena, bb); long address = PlatformDependent.directBufferAddress(bb); int expected = alignment - (int) (address & (alignment - 1)); Assert.assertEquals(expected, offset); PlatformDependent.freeDirectBuffer(bb); } }</code><technical_language>@uxgnoz mark this method package-private reflection</technical_language>

Target:
public void testDirectArenaOffsetCacheLine() throws Exception { int capacity = 5; int alignment = 128; for (int i = 0; i < 1000; i++) { ByteBuffer bb = PlatformDependent.useDirectBufferNoCleaner() ? PlatformDependent.allocateDirectNoCleaner(capacity + alignment) : ByteBuffer.allocateDirect(capacity + alignment); PoolArena.DirectArena arena = new PoolArena.DirectArena(null, 0, 0, 9, 9, alignment); int offset = arena.offsetCacheLine(bb); long address = PlatformDependent.directBufferAddress(bb); Assert.assertEquals(0, (offset + address) & (alignment - 1)); PlatformDependent.freeDirectBuffer(bb); } }
Source:
<code>public void currentThreadsBusyCountUpdates() throws InterruptedException { Meter meter = getMeter(ThreadPoolMonitor.CURRENT_THREADS_BUSY); Iterator<Measurement> measurements = meter.measure().iterator(); assertEquals(0.0, measurements.next().value(), 0.0); Cancellable command = new Cancellable(); threadPoolExecutor.execute(command); <START> Thread.sleep(60); <END> PolledMeter.update(registry); measurements = meter.measure().iterator(); assertEquals(1.0, measurements.next().value(), 0.0); command.canceled = true; Thread.sleep(60); PolledMeter.update(registry); measurements = meter.measure().iterator(); assertEquals(0.0, measurements.next().value(), 0.0); }</code><technical_language>Avoid sleep, like: java final CountDownLatch started = new CountDownLatch(1); final CountDownLatch okToComplete = new CountDownLatch(1); final CountDownLatch completed = new CountDownLatch(1); final ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(3, 10, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>()) { @Override protected void afterExecute(Runnable r, Throwable t) { completed.countDown(); } }; threadPoolExecutor.execute(() -> { started.countDown(); try { okToComplete.await(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } }); started.await(); System.out.println(threadPoolExecutor.getActiveCount()); okToComplete.countDown(); completed.await(); System.out.println(threadPoolExecutor.getActiveCount()); threadPoolExecutor.shutdownNow();</technical_language>

Target:
public void currentThreadsBusyCountUpdates() throws InterruptedException { final Gauge gauge = getGauge(ThreadPoolMonitor.CURRENT_THREADS_BUSY); assertEquals(0.0, gauge.value(), 0.0); final CountDownLatch synchronizer = new CountDownLatch(1); final CountDownLatch terminator = new CountDownLatch(1); final TestRunnable command = new TestRunnable(synchronizer, terminator); latchedExecutor.execute(command); synchronizer.await(6, TimeUnit.SECONDS); PolledMeter.update(registry); assertEquals(1.0, gauge.value(), 0.0); terminator.countDown(); latchedExecutor.getCompletedLatch().await(6, TimeUnit.SECONDS); PolledMeter.update(registry); assertEquals(0.0, gauge.value(), 0.0); }
Source:
<code>public void removeAccounts() { new Thread(new Runnable() { @Override public void run() { Logger.v(TAG, "removeAccounts:"); Account[] accountList = mAcctManager .getAccountsByType(AuthenticationConstants.Broker.BROKER_ACCOUNT_TYPE); if (accountList != null) { for (Account targetAccount : accountList) { Logger.v(TAG, "remove tokens for:" + targetAccount.name); <START> Bundle brokerOptions = new Bundle(); <END> brokerOptions.putString(AuthenticationConstants.Broker.ACCOUNT_REMOVE_TOKENS, AuthenticationConstants.Broker.ACCOUNT_REMOVE_TOKENS_VALUE); mAcctManager.getAuthToken(targetAccount, AuthenticationConstants.Broker.AUTHTOKEN_TYPE, brokerOptions, false, null , mHandler); } } } }).start(); }</code><technical_language>API guarantee Account in returned array is null</technical_language>

Target:
public void removeAccounts() { new Thread(new Runnable() { @Override public void run() { Logger.v(TAG, "removeAccounts:"); Account[] accountList = mAcctManager .getAccountsByType(AuthenticationConstants.Broker.BROKER_ACCOUNT_TYPE); if (accountList.length != 0) { for (Account targetAccount : accountList) { Logger.v(TAG, "remove tokens for:" + targetAccount.name); Bundle brokerOptions = new Bundle(); brokerOptions.putString(AuthenticationConstants.Broker.ACCOUNT_REMOVE_TOKENS, AuthenticationConstants.Broker.ACCOUNT_REMOVE_TOKENS_VALUE); mAcctManager.getAuthToken(targetAccount, AuthenticationConstants.Broker.AUTHTOKEN_TYPE, brokerOptions, false, null , mHandler); } } } }).start(); }
Source:
<code>public void addObject(String uri, boolean isPrivateAccess){ String subjectId = ""; String fileName = ""; String uriPart = null; String paramsPart = null; int idx = uri.indexOf("?"); if(idx > 0){ uriPart = uri.substring(0, idx); if(idx + 1 < uri.length()) paramsPart = uri.substring(idx + 1); }else uriPart = uri; String[] parts = uriPart.substring(1).split("/"); if(parts.length >= 3 && parts.length <=5 && parts[2] !=null) subjectId = parts[2]; else{ <START> System.out.println("DAMS stats unknown uri: " + uri); <END> return; } if(parts.length >= 4 && parts[3] != null && parts[3].startsWith("_")) fileName = parts[3]; if(subjectId == null || subjectId.length()!= 10){ System.out.println("Invalid subject " + subjectId + ": " + uri); return; } Map<String, ObjectCounter> iMap = itemsMap; if (isPrivateAccess) iMap = itemsMapPrivate; ObjectCounter objCounter = iMap.get(subjectId); if(objCounter == null){ objCounter = new ObjectCounter(subjectId); iMap.put(subjectId, objCounter); } if (uri.endsWith("/download")) { fileDownload(objCounter, fileName); } else { objCounter.increaseCounter(fileName); } }</code><technical_language>this a logged warning error instead of a System.out</technical_language>

Target:
public void addObject(String uri, boolean isPrivateAccess){ String subjectId = ""; String fileName = ""; String uriPart = null; String paramsPart = null; int idx = uri.indexOf("?"); if(idx > 0){ uriPart = uri.substring(0, idx); if(idx + 1 < uri.length()) paramsPart = uri.substring(idx + 1); }else uriPart = uri; String[] parts = uriPart.substring(1).split("/"); if(parts.length >= 3 && parts.length <=5 && parts[2] !=null) subjectId = parts[2]; else{ log.warn("DAMS stats unknown uri: " + uri); return; } if(parts.length >= 4 && parts[3] != null && parts[3].startsWith("_")) fileName = parts[3]; if(subjectId == null || subjectId.length()!= 10){ log.warn("Invalid subject " + subjectId + ": " + uri); return; } Map<String, ObjectCounter> iMap = itemsMap; if (isPrivateAccess) iMap = itemsMapPrivate; ObjectCounter objCounter = iMap.get(subjectId); if(objCounter == null){ objCounter = new ObjectCounter(subjectId); iMap.put(subjectId, objCounter); } if (uri.endsWith("/download")) { fileDownload(objCounter, fileName); } else { objCounter.increaseCounter(fileName); } }
Source:
<code>public void getCurrentTheme(String siteId, Listener listener, ErrorListener errorListener) { <START> String path = String.format("sites/%s/themes/mine", siteId, 1, 0); <END> get(path, listener, errorListener); }</code><technical_language>arguments used</technical_language>

Target:
public void getCurrentTheme(String siteId, Listener listener, ErrorListener errorListener) { String path = String.format("sites/%s/themes/mine", siteId); get(path, listener, errorListener); }
Source:
<code>private static void createSubtitleLabel(Composite parent, String text) { final Label label = new Label(parent, SWT.WRAP); label.setText(text + ':'); final FontDescriptor boldDescriptor = FontDescriptor.createFrom(parent.getFont()).setStyle(SWT.BOLD); final Font <START> boldFont = <END> boldDescriptor.createFont(parent.getDisplay()); label.setFont(boldFont); }</code><technical_language>This font resource leaks. disposed dialog is disposed. add a dispose listener label</technical_language>

Target:
private static void createSubtitleLabel(Composite parent, String text) { final Label label = new Label(parent, SWT.WRAP); label.setText(text + ':'); final FontDescriptor boldDescriptor = FontDescriptor.createFrom(parent.getFont()).setStyle(SWT.BOLD); final Font boldFont = boldDescriptor.createFont(parent.getDisplay()); label.setFont(boldFont); label.addDisposeListener(event -> boldFont.dispose()); }
Source:
<code>public void start(final BundleContext context) throws Exception { super.start(context); pluginId = context.getBundle().getSymbolicName(); Dictionary<String, String> props = new Hashtable<String, String>(4); props.put(DebugOptions.LISTENER_SYMBOLICNAME, pluginId); context.registerService(DebugOptionsListener.class.getName(), this, props); repositoryCache = new RepositoryCache(); indexDiffCache = new IndexDiffCache(); try { GitProjectData.reconfigureWindowCache(); } catch (RuntimeException e) { logError(CoreText.Activator_ReconfigureWindowCacheError, e); } GitProjectData.attachToWorkspace(true); IEclipsePreferences node = InstanceScope.INSTANCE.getNode(Activator.getPluginId()); String gitPrefix = node.get(GitCorePreferences.core_gitPrefix, null); if (gitPrefix != null) FS.DETECTED.setGitPrefix(new File(gitPrefix)); repositoryUtil = new RepositoryUtil(); secureStore = new EGitSecureStore(SecurePreferencesFactory.getDefault()); registerAutoShareProjects(); <START> if (preDeleteProjectListener == null) { <END> preDeleteProjectListener = new IResourceChangeListener() { public void resourceChanged(IResourceChangeEvent event) { IResource resource = event.getResource(); if (resource instanceof IProject) { IProject project = (IProject) resource; if (RepositoryProvider.getProvider(project) instanceof GitProvider) { IResource dotGit = project.findMember(Constants.DOT_GIT); if (dotGit != null && dotGit.getType() == IResource.FOLDER) GitProjectData.reconfigureWindowCache(); } } } }; ResourcesPlugin.getWorkspace().addResourceChangeListener(preDeleteProjectListener, IResourceChangeEvent.PRE_DELETE); } }</code><technical_language>a method of this section, registerAutoShareProjects</technical_language>

Target:
public void start(final BundleContext context) throws Exception { super.start(context); pluginId = context.getBundle().getSymbolicName(); Dictionary<String, String> props = new Hashtable<String, String>(4); props.put(DebugOptions.LISTENER_SYMBOLICNAME, pluginId); context.registerService(DebugOptionsListener.class.getName(), this, props); repositoryCache = new RepositoryCache(); indexDiffCache = new IndexDiffCache(); try { GitProjectData.reconfigureWindowCache(); } catch (RuntimeException e) { logError(CoreText.Activator_ReconfigureWindowCacheError, e); } GitProjectData.attachToWorkspace(true); IEclipsePreferences node = InstanceScope.INSTANCE.getNode(Activator.getPluginId()); String gitPrefix = node.get(GitCorePreferences.core_gitPrefix, null); if (gitPrefix != null) FS.DETECTED.setGitPrefix(new File(gitPrefix)); repositoryUtil = new RepositoryUtil(); secureStore = new EGitSecureStore(SecurePreferencesFactory.getDefault()); registerAutoShareProjects(); registerPreDeleteResourceChangeListener(); }
Source:
<code>public void clickOnProjectsButton() { seleniumWebDriverHelper <START> .waitVisibility(By.xpath(" END> .click(); }</code><technical_language>simplified seleniumWebDriverHelper.waitAndClick() method</technical_language>

Target:
public void clickOnProjectsButton() { seleniumWebDriverHelper.waitAndClick(By.xpath(" }
Source:
<code>protected final void describeMismatchSafely(final T item, final Description description) { <START> description.appendText("body was: ").appendText(this.itext); <END> }</code><technical_language>@olenagerasimova appendText(this.text(item)), this.itext point wrong value, if text(item) != this.itext</technical_language>

Target:
protected final void describeMismatchSafely(final T item, final Description description) { try { description.appendText("body was: ").appendText(this.text(item)); } catch (final IOException ex) { throw new IllegalStateException(ex); } }