auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void <START> registerRcsAvailabilityCallback(IImsCapabilityCallback <END> callback) throws ImsException { try { mRcsFeatureConnection.addCapabilityCallback(callback); } catch (RemoteException e) { loge("registerRcsAvailabilityCallback: ", e); throw new ImsException( "register capability callback", e, ImsReasonInfo.CODE_LOCAL_INTERNAL_ERROR); } }</code><technical_language>Unfortunately, add capability callback here, this is mapped a phoneId a subId. This lead a bunch of bugs, subscription phoneId changing, causing user able unregister a callback (because callback is a subId) subId removed callback unregistered service. In MmTelFeatureConnection, this handled a Callback manager, listen for subscription changes automatically unregister callbacks a phone subId changes. instead, abstract CallbackAdapterManager FeatureConnection RcsFeatureConnection implement a CallbackAdapterManger for CallbackAdapterManager</technical_language>

Target:
public void registerRcsAvailabilityCallback(IImsCapabilityCallback callback) throws ImsException { try { int subId = sSubscriptionManagerProxy.getSubId(mSlotId); mCapabilityCallbackManager.addCallbackForSubscription(callback, subId); } catch (IllegalStateException e) { loge("registerRcsAvailabilityCallback: ", e); throw new ImsException( "register capability callback", e, ImsReasonInfo.CODE_LOCAL_INTERNAL_ERROR); } }
Source:
<code>public SearchHelper executeQuery() { <START> SuggesterServiceImpl.getInstance().onSearch(projects, query); END> if (redirect != null || errorMsg != null) { return this; } try { TopFieldDocs fdocs = searcher.search(query, start + maxItems, sort); totalHits = fdocs.totalHits; hits = fdocs.scoreDocs; boolean isSingleDefinitionSearch = (query instanceof TermQuery) && (builder.getDefs() != null); boolean uniqueDefinition = false; if (isSingleDefinitionSearch && hits != null && hits.length == 1) { Document doc = searcher.doc(hits[0].doc); if (doc.getField(QueryBuilder.TAGS) != null) { byte[] rawTags = doc.getField(QueryBuilder.TAGS).binaryValue().bytes; Definitions tags = Definitions.deserialize(rawTags); String symbol = ((TermQuery) query).getTerm().text(); if (tags.occurrences(symbol) == 1) { uniqueDefinition = true; } } } if (uniqueDefinition && hits != null && hits.length > 0 && isCrossRefSearch) { redirect = contextPath + Prefix.XREF_P + Util.URIEncodePath(searcher.doc(hits[0].doc).get(QueryBuilder.PATH)) + '#' + Util.URIEncode(((TermQuery) query).getTerm().text()); } } catch (BooleanQuery.TooManyClauses e) { errorMsg = "Too many results for wildcard!"; } catch (IOException | ClassNotFoundException e) { errorMsg = e.getMessage(); } return this; }</code><technical_language>sure, this work json search</technical_language>

Target:
public SearchHelper executeQuery() { SuggesterServiceFactory.getDefault().onSearch(projects, query); if (redirect != null || errorMsg != null) { return this; } try { TopFieldDocs fdocs = searcher.search(query, start + maxItems, sort); totalHits = fdocs.totalHits; hits = fdocs.scoreDocs; boolean isSingleDefinitionSearch = (query instanceof TermQuery) && (builder.getDefs() != null); boolean uniqueDefinition = false; if (isSingleDefinitionSearch && hits != null && hits.length == 1) { Document doc = searcher.doc(hits[0].doc); if (doc.getField(QueryBuilder.TAGS) != null) { byte[] rawTags = doc.getField(QueryBuilder.TAGS).binaryValue().bytes; Definitions tags = Definitions.deserialize(rawTags); String symbol = ((TermQuery) query).getTerm().text(); if (tags.occurrences(symbol) == 1) { uniqueDefinition = true; } } } if (uniqueDefinition && hits != null && hits.length > 0 && isCrossRefSearch) { redirect = contextPath + Prefix.XREF_P + Util.URIEncodePath(searcher.doc(hits[0].doc).get(QueryBuilder.PATH)) + '#' + Util.URIEncode(((TermQuery) query).getTerm().text()); } } catch (BooleanQuery.TooManyClauses e) { errorMsg = "Too many results for wildcard!"; } catch (IOException | ClassNotFoundException e) { errorMsg = e.getMessage(); } return this; }
Source:
<code>private void loadData(boolean isResponseOk, Search response) { if (isResponseOk) { mCountProducts = Integer.parseInt(response.getCount()); if (pageAddress == 1) { <START> countProductsView.setText(getResources().getString(R.string.number_of_products)+ " " + NumberFormat.getInstance(getResources().getConfiguration().locale).format(Long.parseLong(response.getCount() <END> ))); mProducts = new ArrayList<>(); mProducts.addAll(response.getProducts()); if (mProducts.size() < mCountProducts) { mProducts.add(null); } setUpRecyclerView(); } else { if (mProducts.size() - 1 < mCountProducts + 1) { final int posStart = mProducts.size(); mProducts.remove(mProducts.size() - 1); mProducts.addAll(response.getProducts()); if (mProducts.size() < mCountProducts) { mProducts.add(null); } productsRecyclerView.getAdapter().notifyItemRangeChanged(posStart - 1, mProducts.size() - 1); } } } else { progressBar.setVisibility(View.INVISIBLE); offlineCloudLayout.setVisibility(View.VISIBLE); } }</code><technical_language>This is piece of code needs changed resolve this. Please ensure code is tested app lifecycle ensure of setUp variable prevent this handing onResume() rest of app lifecycle</technical_language>

Target:
private void loadData(boolean isResponseOk, Search response) { if (isResponseOk) { mCountProducts = Integer.parseInt(response.getCount()); if (pageAddress == 1) { countProductsView.setText(getResources().getString(R.string.number_of_results) + " " + NumberFormat.getInstance(getResources().getConfiguration().locale).format(Long.parseLong(response.getCount()))); mProducts = new ArrayList<>(); mProducts.addAll(response.getProducts()); if (mProducts.size() < mCountProducts) { mProducts.add(null); } if (setupDone) { productsRecyclerView.setAdapter(new ProductsRecyclerViewAdapter(mProducts)); } setUpRecyclerView(); } else { if (mProducts.size() - 1 < mCountProducts + 1) { final int posStart = mProducts.size(); mProducts.remove(mProducts.size() - 1); mProducts.addAll(response.getProducts()); if (mProducts.size() < mCountProducts) { mProducts.add(null); } productsRecyclerView.getAdapter().notifyItemRangeChanged(posStart - 1, mProducts.size() - 1); } } } else { swipeRefreshLayout.setRefreshing(false); productsRecyclerView.setVisibility(View.INVISIBLE); progressBar.setVisibility(View.INVISIBLE); offlineCloudLayout.setVisibility(View.VISIBLE); } }
Source:
<code>public void sendOffsetsToTransaction(Map<TopicPartition, OffsetAndMetadata> offsets, ConsumerGroupMetadata groupMetadata) throws ProducerFencedException, IllegalGenerationException, <START> UnknownMemberIdException, <END> FencedInstanceIdException { sendOffsetsToTransaction(offsets, groupMetadata.groupId()); }</code><technical_language>nit: this definition awkward</technical_language>

Target:
public void sendOffsetsToTransaction(Map<TopicPartition, OffsetAndMetadata> offsets, ConsumerGroupMetadata groupMetadata) throws ProducerFencedException { Objects.requireNonNull(groupMetadata); sendOffsetsToTransaction(offsets, groupMetadata.groupId()); }
Source:
<code>public <T> T get(Class<T> serviceType) { ArgChecker.notNull(serviceType, "serviceType"); <START> final T service = services.getInstance(serviceType); <END> if (service == null) { throw new IllegalArgumentException("No service found: " + serviceType); } return service; }</code><technical_language>need for a final var</technical_language>

Target:
public <T> T get(Class<T> serviceType) { ArgChecker.notNull(serviceType, "serviceType"); T service = services.getInstance(serviceType); if (service == null) { throw new IllegalArgumentException("No service found: " + serviceType); } return service; }
Source:
<code>void testDeployAndResolveArtifact(@TestRepository(layout = RawLayoutProvider.ALIAS, storageId = STORAGE, repositoryId = REPOSITORY) Repository repository, @TestArtifact(resource = "foo/bar.zip", generator = NullArtifactGenerator.class) Path artifactPath) throws Exception { String path = "foo/bar.zip"; RepositoryPath artifactRepositoryPath = repositoryPathResolver.resolve(repository, path); artifactManagementService.validateAndStore(artifactRepositoryPath, createZipFile()); assertTrue(Files.exists(artifactRepositoryPath), "Failed to deploy artifact!"); assertTrue(Files.size(artifactRepositoryPath) > 0, "Failed to deploy artifact!"); try { <START> artifactManagementService.validateAndStore(artifactRepositoryPath, createZipFile()); <END> } catch (Exception e) { if (e.getMessage().contains("repository does not allow artifact re-deployment")) { logger.info("Successfully declined to re-deploy {}!", artifactRepositoryPath); } else { throw e; } } try (InputStream is = artifactResolutionService.getInputStream(artifactRepositoryPath)) { int total = 0; int len; final int size = 4096; byte[] bytes = new byte[size]; while ((len = is.read(bytes, 0, size)) != -1) { total += len; } assertTrue(total > 0, "Failed to resolve artifact!"); } }</code><technical_language>@ptirador noticed need createZipFile() well, Files.newInputStream(artifactPath) instead,</technical_language>

Target:
void testDeployAndResolveArtifact(@TestRepository(layout = RawLayoutProvider.ALIAS, storageId = STORAGE, repositoryId = REPOSITORY) Repository repository, @TestArtifact(resource = "foo/bar.zip", generator = NullArtifactGenerator.class) Path artifactPath) throws Exception { String path = "foo/bar.zip"; RepositoryPath artifactRepositoryPath = repositoryPathResolver.resolve(repository, path); artifactManagementService.validateAndStore(artifactRepositoryPath, Files.newInputStream(artifactPath)); assertTrue(Files.exists(artifactRepositoryPath), "Failed to deploy artifact!"); assertTrue(Files.size(artifactRepositoryPath) > 0, "Failed to deploy artifact!"); try { artifactManagementService.validateAndStore(artifactRepositoryPath, Files.newInputStream(artifactPath)); } catch (Exception e) { if (e.getMessage().contains("repository does not allow artifact re-deployment")) { logger.debug("Successfully declined to re-deploy {}!", artifactRepositoryPath); } else { throw e; } } try (InputStream is = artifactResolutionService.getInputStream(artifactRepositoryPath)) { int total = 0; int len; final int size = 4096; byte[] bytes = new byte[size]; while ((len = is.read(bytes, 0, size)) != -1) { total += len; } assertTrue(total > 0, "Failed to resolve artifact!"); } }
Source:
<code>public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) { if (sourceViewer == null) { return null; } Map<?, ?> targets = getHyperlinkDetectorTargets(sourceViewer); HyperlinkDetectorRegistry hlDetectorRegistry = EditorsUI.getHyperlinkDetectorRegistry(); HyperlinkDetectorDescriptor[] hlDetectorDescriptor = hlDetectorRegistry.getHyperlinkDetectorDescriptors(); List<IHyperlinkDetector> tempHDList = new ArrayList<IHyperlinkDetector>(); for (Map.Entry<?, ?> entry : targets.entrySet()) { for (HyperlinkDetectorDescriptor hdd : hlDetectorDescriptor) { try { AbstractHyperlinkDetector ahld = hdd.createHyperlinkDetector(); <START> if (hdd.getTargetId().equals(entry.getKey()) && !(ahld instanceof URLHyperlinkDetector)) { <END> ahld.setContext((IAdaptable)entry.getValue()); tempHDList.add(ahld); } } catch (CoreException e) { SpecfileLog.logError(e); } } } if (!tempHDList.isEmpty()) { IHyperlinkDetector[] rc = new IHyperlinkDetector[tempHDList.size()]; rc = tempHDList.toArray(rc); return rc; } else { return null; } }</code><technical_language>instanceof check exclude URLHyperlinkWithMacroDetector want included. a result hovering URL displays nothing</technical_language>

Target:
public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) { if (sourceViewer == null) { return null; } Map<?, ?> targets = getHyperlinkDetectorTargets(sourceViewer); HyperlinkDetectorRegistry hlDetectorRegistry = EditorsUI.getHyperlinkDetectorRegistry(); HyperlinkDetectorDescriptor[] hlDetectorDescriptor = hlDetectorRegistry.getHyperlinkDetectorDescriptors(); List<IHyperlinkDetector> tempHDList = new ArrayList<IHyperlinkDetector>(); for (Map.Entry<?, ?> entry : targets.entrySet()) { for (HyperlinkDetectorDescriptor hdd : hlDetectorDescriptor) { try { AbstractHyperlinkDetector ahld = hdd.createHyperlinkDetector(); if (hdd.getTargetId().equals(entry.getKey()) && (!(ahld instanceof URLHyperlinkDetector) || (ahld instanceof URLHyperlinkDetector && ahld instanceof URLHyperlinkWithMacroDetector))) { ahld.setContext((IAdaptable)entry.getValue()); tempHDList.add(ahld); } } catch (CoreException e) { SpecfileLog.logError(e); } } } if (!tempHDList.isEmpty()) { IHyperlinkDetector[] rc = new IHyperlinkDetector[tempHDList.size()]; rc = tempHDList.toArray(rc); return rc; } else { return null; } }
Source:
<code>public boolean validate() { if (!getShouldSetDnsConfiguration().getEntity()) { getShouldSetDnsConfiguration().setIsValid(true); setIsValid(true); return true; } Collection<NameServerModel> items = this.nameServerModelListModel.getItems(); int numberOfAddresses = items.size(); boolean atLeastOneAddress = numberOfAddresses > 0; boolean exceedingNumberOfAddresses = numberOfAddresses > BusinessEntitiesDefinitions.MAX_SUPPORTED_DNS_CONFIGURATIONS; boolean isValid = atLeastOneAddress && !exceedingNumberOfAddresses && validateNameserverAddresses(items); <START> getShouldSetDnsConfiguration().setIsValid(atLeastOneAddress); <END> setIsValid(isValid); return isValid; }</code><technical_language>is obvious failed, I add invalidity reason: getShouldSetDnsConfiguration().getInvalidityReasons().add(constants.atLeastOneDnsServerHasToBeConfigured()); forget invalidity reasons need set calling setIsValid()</technical_language>

Target:
public boolean validate() { if (!getShouldSetDnsConfiguration().getEntity()) { setShouldSetDnsConfigurationValidity(true); setIsValid(true); return true; } Collection<NameServerModel> items = this.nameServerModelListModel.getItems(); int numberOfAddresses = items.size(); boolean atLeastOneAddress = numberOfAddresses > 0; boolean exceedingNumberOfAddresses = numberOfAddresses > BusinessEntitiesDefinitions.MAX_SUPPORTED_DNS_CONFIGURATIONS; boolean isValid = atLeastOneAddress && !exceedingNumberOfAddresses && validateNameserverAddresses(items); setShouldSetDnsConfigurationValidity(atLeastOneAddress); setIsValid(isValid); return isValid; }
Source:
<code>private void processReportDetailed(SensorContext context, Collection<TestSuite> parsedReports) { Map<InputFile, TestResult> locatedResources = lookupResources(parsedReports); for (Map.Entry<InputFile, TestResult> entry : locatedResources.entrySet()) { InputFile inputFile = entry.getKey(); TestResult fileTestResult = entry.getValue(); LOG.debug("Saving test execution measures for '{}'", inputFile.toString()); saveMeasure(context, inputFile, CoreMetrics.SKIPPED_TESTS, fileTestResult.getSkipped()); <START> saveMeasure(context, inputFile, CoreMetrics.TESTS, fileTestResult.getTests() - fileTestResult.getSkipped()); <END> saveMeasure(context, inputFile, CoreMetrics.TEST_ERRORS, fileTestResult.getErrors()); saveMeasure(context, inputFile, CoreMetrics.TEST_FAILURES, fileTestResult.getFailures()); saveMeasure(context, inputFile, CoreMetrics.TEST_EXECUTION_TIME, fileTestResult.getTime()); } }</code><technical_language>I explicitly this in TestResult class, called getExecutedTests(), do substraction everywhere</technical_language>

Target:
private void processReportDetailed(SensorContext context, Collection<TestSuite> parsedReports) { Map<InputFile, TestResult> locatedResources = lookupResources(parsedReports); for (Map.Entry<InputFile, TestResult> entry : locatedResources.entrySet()) { InputFile inputFile = entry.getKey(); TestResult fileTestResult = entry.getValue(); LOG.debug("Saving test execution measures for '{}'", inputFile.toString()); saveMeasure(context, inputFile, CoreMetrics.SKIPPED_TESTS, fileTestResult.getSkipped()); saveMeasure(context, inputFile, CoreMetrics.TESTS, fileTestResult.getExecutedTests()); saveMeasure(context, inputFile, CoreMetrics.TEST_ERRORS, fileTestResult.getErrors()); saveMeasure(context, inputFile, CoreMetrics.TEST_FAILURES, fileTestResult.getFailures()); saveMeasure(context, inputFile, CoreMetrics.TEST_EXECUTION_TIME, fileTestResult.getTime()); } }
Source:
<code>private boolean executeDumper(String dumperPath, String inputFilePath, String inputFilePrefix, String outputDir){ final String outputFileFullPath = outputDir + File.separator + inputFilePrefix + ".txt"; final String errFileFullPath = outputDir + File.separator + inputFilePrefix + ".err"; logger.log(Level.INFO, "Writing ESEDatabaseViewer results to: {0}", outputDir); List<String> commandLine = new ArrayList<>(); commandLine.add(dumperPath); commandLine.add("/table"); commandLine.add(inputFilePath); commandLine.add("*"); commandLine.add("/scomma"); commandLine.add(outputDir + "\\" + inputFilePrefix + "_*.csv"); ProcessBuilder processBuilder = new ProcessBuilder(commandLine); processBuilder.redirectOutput(new File(outputFileFullPath)); processBuilder.redirectError(new File(errFileFullPath)); try{ ExecUtil.execute(processBuilder, new DataSourceIngestModuleProcessTerminator(context)); }catch(IOException ex){ <START> logger.log(Level.SEVERE, "Unable to execute ESEDatabaseView to process Edge file." , ex); END> return false; } return true; }</code><technical_language>Edge file? Personally, I is throw exceptions boolean error code return values; general policy is level code throws exceptions for handling higher level code. I propagate IOException - is cleaner multiple return statements fro true/false. Also, format (ALT+SHIFT+F) check in. For example, formatter add space reserved words "curly" braces of this try-catch</technical_language>

Target:
private void executeDumper(String dumperPath, String inputFilePath, String inputFilePrefix, String outputDir) throws IOException { final String outputFileFullPath = outputDir + File.separator + inputFilePrefix + ".txt"; final String errFileFullPath = outputDir + File.separator + inputFilePrefix + ".err"; logger.log(Level.INFO, "Writing ESEDatabaseViewer results to: {0}", outputDir); List<String> commandLine = new ArrayList<>(); commandLine.add(dumperPath); commandLine.add("/table"); commandLine.add(inputFilePath); commandLine.add("*"); commandLine.add("/scomma"); commandLine.add(outputDir + "\\" + inputFilePrefix + "_*.csv"); ProcessBuilder processBuilder = new ProcessBuilder(commandLine); processBuilder.redirectOutput(new File(outputFileFullPath)); processBuilder.redirectError(new File(errFileFullPath)); ExecUtil.execute(processBuilder, new DataSourceIngestModuleProcessTerminator(context)); }
Source:
<code>public static final MavenExecutionResult tryAndExec(Path directory, String[] mavenArgs) { <START> log.info("Defaultin to MavenInvocator"); <END> return new MavenInvokatorMavenTaskRunner().exec(directory, mavenArgs); }</code><technical_language>Defaultin**g**</technical_language>

Target:
public static final MavenExecutionResult tryAndExec(Path directory, String[] mavenArgs) { log.info("Defaulting to MavenInvokator"); return new MavenInvokatorMavenTaskRunner().exec(directory, mavenArgs); }
Source:
<code>protected Set<String> listObjects() { Set<String> digests = new HashSet<>(); try { binaryManager.storage.list(binaryManager.bucketName).iterateAll().forEach(blob -> { if (blob != null) { digests.add(blob.getName()); } }); return digests; } catch (StorageException e) { if (e.getMessage().equals("Not Found")) return digests; throw new NuxeoException(e); <START> } <END> }</code><technical_language>{ } if</technical_language>

Target:
protected Set<String> listObjects() { Set<String> digests = new HashSet<>(); try { binaryManager.storage.list(binaryManager.bucketName).iterateAll().forEach(blob -> { if (blob != null) { digests.add(binaryManager.bucketPrefix + blob.getName()); } }); return digests; } catch (StorageException e) { if (e.getMessage().equals("Not Found")) { return digests; } throw new NuxeoException(e); } }
Source:
<code>public void canUntangleHighlyConflictingPutUnlessExists() { TransactionTables.createTables(keyValueService); TransactionTables.truncateTables(keyValueService); TransactionService transactionService = WriteBatchingTransactionService.create( SimpleTransactionService.createV2(keyValueService)); ExecutorService executorService = Executors.newCachedThreadPool(); List<Future<?>> futures = LongStream.range(0, 100) <START> .mapToObj(unused -> executorService.submit(() -> { <END> try { transactionService.putUnlessExists(unused, unused + 1); transactionService.putUnlessExists(unused + 1, unused + 3); transactionService.putUnlessExists(unused - 1, unused + 5); } catch (KeyAlreadyExistsException ex) { } })) .collect(Collectors.toList()); futures.forEach(Futures::getUnchecked); }</code><technical_language>unused</technical_language>

Target:
public void canUntangleHighlyConflictingPutUnlessExists() { TransactionTables.createTables(keyValueService); TransactionTables.truncateTables(keyValueService); SimpleTransactionService v2TransactionService = SimpleTransactionService.createV2(keyValueService); TransactionService transactionService = WriteBatchingTransactionService.create(v2TransactionService); ExecutorService executorService = Executors.newCachedThreadPool(); int numTransactionPutters = 100; List<Future<?>> futures = LongStream.range(1, numTransactionPutters) .mapToObj(timestamp -> executorService.submit(() -> { tryPutTimestampPermittingExceptions(transactionService, timestamp); tryPutTimestampPermittingExceptions(transactionService, timestamp + 1); })) .collect(Collectors.toList()); futures.forEach(Futures::getUnchecked); }
Source:
<code>public ConfigDiff buildConfigDiff(PluginTask task, Schema schema, int taskCount, List<TaskReport> taskReports) { ConfigDiff configDiff = super.buildConfigDiff(task, schema, taskCount, taskReports); if (task.getQueryBy().isPresent() && task.getQueryBy().get() == QueryBy.DATE_RANGE && task.getIncremental()) { <START> OffsetDateTime earliest = task.getEarliestUpdatedAt().isPresent() ? task.getEarliestUpdatedAt().get().toInstant().atOffset(ZoneOffset.UTC) : OffsetDateTime.now(ZoneOffset.UTC); OffsetDateTime latest = task.getLatestUpdatedAt().isPresent() ? task.getLatestUpdatedAt().get().toInstant().atOffset(ZoneOffset.UTC) : OffsetDateTime.now(ZoneOffset.UTC); <END> Duration d = Duration.between(earliest, latest); OffsetDateTime nextEarliestUpdatedAt = latest.plusSeconds(1); configDiff.set("earliest_updated_at", nextEarliestUpdatedAt.format(DATE_FORMATTER)); configDiff.set("report_duration", task.getReportDuration().or(d.toMillis())); } return configDiff; }</code><technical_language>ditto, redundant check for presentation of keys checked in validation method</technical_language>

Target:
public ConfigDiff buildConfigDiff(PluginTask task, Schema schema, int taskCount, List<TaskReport> taskReports) { ConfigDiff configDiff = super.buildConfigDiff(task, schema, taskCount, taskReports); if (task.getQueryBy().isPresent() && task.getQueryBy().get() == QueryBy.DATE_RANGE && task.getIncremental()) { OffsetDateTime earliest = task.getEarliestUpdatedAt().isPresent() ? OffsetDateTime.ofInstant(task.getEarliestUpdatedAt().get().toInstant(), ZoneOffset.UTC) : OffsetDateTime.now(ZoneOffset.UTC); OffsetDateTime latest = task.getLatestUpdatedAt().isPresent() ? OffsetDateTime.ofInstant(task.getLatestUpdatedAt().get().toInstant(), ZoneOffset.UTC) : OffsetDateTime.now(ZoneOffset.UTC); Duration d = Duration.between(earliest, latest); OffsetDateTime nextEarliestUpdatedAt = latest.plusSeconds(1); configDiff.set("earliest_updated_at", nextEarliestUpdatedAt.format(DATE_FORMATTER)); configDiff.set("report_duration", task.getReportDuration().or(d.toMillis())); } return configDiff; }
Source:
<code>public void testCreateDTD() { factory.createDTD("foo"); <START> Assert.fail("executed without expected exception"); <END> }</code><technical_language>do need a assert.fail this statement executed of factory.createDTD("foo") throws exception. failed throw exception, junit fail test</technical_language>

Target:
public void testCreateDTD() { factory.createDTD("foo"); }
Source:
<code><START> public void invitesUserByEmail() throws Exception { <END> final MkBase base = new MkBase(); final String urn = "urn:test:1"; final User user = base.user(new URN(urn)); user.aliases().add("jeff"); final Alias alias = user.aliases().iterate().iterator().next(); final Bout bout = alias.inbox().bout(alias.inbox().start()); bout.messages().post("Before invite by email."); bout.friends().invite(alias.name()); try { new TkInvite(base).act( new RqWithHeader( new RqWithAuth( urn, new RqFake( RqMethod.POST, String.format( "/b/%d/invite", bout.number() ), "name=foo@bar.com" ) ), "X-Netbout-Bout", Long.toString(bout.number()) ) ); } catch (final RsForward ex) { MatcherAssert.assertThat( ex.getLocalizedMessage(), Matchers.containsString("foo-bar-com") ); } }</code><technical_language>@antonini this test case pass exception is thrown, please refactor</technical_language>

Target:
public void invitesUserByEmail() throws Exception { final MkBase base = new MkBase(); final String urn = "urn:test:1"; final User user = base.user(new URN(urn)); user.aliases().add("jeff"); final Alias alias = user.aliases().iterate().iterator().next(); final Bout bout = alias.inbox().bout(alias.inbox().start()); bout.messages().post("Before invite by email."); bout.friends().invite(alias.name()); try { new TkInvite(base).act( new RqWithHeader( new RqWithAuth( urn, new RqFake( RqMethod.POST, String.format( "/b/%d/invite", bout.number() ), "name=foo@bar.airforce" ) ), "X-Netbout-Bout", Long.toString(bout.number()) ) ); } catch (final RsForward ex) { MatcherAssert.assertThat( ex.getLocalizedMessage(), Matchers.containsString("foo-bar-airforce") ); throw ex; } }
Source:
<code>public SinglePhaseSubTask newSubTaskWithBackwardCompatibleType(int numAttempts) { return new SinglePhaseSubTask( null, getGroupId(), null, getSupervisorTaskId(), numAttempts, getIngestionSpec(), getContext(), null, null, new DummyForInjectionAppenderatorsManager() ) { @Override public String getType() { <START> return SinglePhaseSubTask.OLD_TYPE_NAME; <END> } }; }</code><technical_language>this affect task is serialized? I thought type field end based solely Jackson thinks type code for class is, based @JsonTypeName @JsonSubTypes annotations. include a test serializes correctly? (Maybe serialize it, deserialize a Map check type field.)</technical_language>

Target:
public SinglePhaseSubTask newSubTaskWithBackwardCompatibleType(int numAttempts) { return new LegacySinglePhaseSubTask( null, getGroupId(), null, getSupervisorTaskId(), numAttempts, getIngestionSpec(), getContext(), null, null, new DummyForInjectionAppenderatorsManager() ); }
Source:
<code>public void testSameEncryption() { String firstEncrypt = "123456:654321"; String secondEncrypt = "123456:654322"; try { String firstEncrypted = EncryptUtility.encrypt(firstEncrypt); String secondEncrypted = EncryptUtility.encrypt(secondEncrypt); if (firstEncrypted.equals(secondEncrypted)) { <START> fail("should be different"); <END> } } catch (Exception ex) { fail("no exceptions"); } }</code><technical_language>suggest a method shows expected actual in results automatically test</technical_language>

Target:
public void testSameEncryption() throws Exception { String firstEncrypt = "123456:654321"; String secondEncrypt = "123456:654322"; String firstEncrypted = EncryptUtility.encrypt(firstEncrypt, SECRET); String secondEncrypted = EncryptUtility.encrypt(secondEncrypt, SECRET); assertTrue(!firstEncrypted.equals(secondEncrypted)); }
Source:
<code>public void onBlockBreak(BlockBreakEvent e) { ItemStack item = e.getPlayer().getInventory().getItemInMainHand(); List<ItemStack> drops = new ArrayList<>(e.getBlock().getDrops(item)); int fortune = 1; Random random = ThreadLocalRandom.current(); if (item.getType() != Material.AIR && item.getAmount() > 0) { if (item.getEnchantments().containsKey(Enchantment.LOOT_BONUS_BLOCKS) && !item.getEnchantments().containsKey(Enchantment.SILK_TOUCH)) { fortune = random.nextInt(item.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) + 2) - 1; if (fortune <= 0) fortune = 1; fortune = (e.getBlock().getType() == Material.LAPIS_ORE ? 4 + random.nextInt(5) : 1) * (fortune + 1); } if (!item.getEnchantments().containsKey(Enchantment.SILK_TOUCH) && MaterialCollections.getAllOres().contains(e.getBlock().getType()) && Talisman.checkFor(e, (SlimefunItemStack) SlimefunItems.TALISMAN_MINER)) { for (ItemStack drop : drops) { if (!drop.getType().isBlock()) { <START> int amount = (fortune * 2) - drop.getAmount() == 0 ? 1 : (fortune * 2) - drop.getAmount(); <END> e.getPlayer().getInventory().addItem(new CustomItem(drop, amount)); } } } } }</code><technical_language>Math.min</technical_language>

Target:
public void onBlockBreak(BlockBreakEvent e) { ItemStack item = e.getPlayer().getInventory().getItemInMainHand(); List<ItemStack> drops = new ArrayList<>(e.getBlock().getDrops(item)); int fortune = 1; Random random = ThreadLocalRandom.current(); if (item.getType() != Material.AIR && item.getAmount() > 0) { if (item.getEnchantments().containsKey(Enchantment.LOOT_BONUS_BLOCKS) && !item.getEnchantments().containsKey(Enchantment.SILK_TOUCH)) { fortune = random.nextInt(item.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) + 2) - 1; if (fortune <= 0) fortune = 1; fortune = (e.getBlock().getType() == Material.LAPIS_ORE ? 4 + random.nextInt(5) : 1) * (fortune + 1); } if (!item.getEnchantments().containsKey(Enchantment.SILK_TOUCH) && MaterialCollections.getAllOres().contains(e.getBlock().getType()) && Talisman.checkFor(e, (SlimefunItemStack) SlimefunItems.TALISMAN_MINER)) { for (ItemStack drop : drops) { if (!drop.getType().isBlock()) { int amount = Math.max(1, (fortune * 2) - drop.getAmount()); e.getBlock().getWorld().dropItemNaturally(e.getBlock().getLocation(), new CustomItem(drop, amount)); } } } } }
Source:
<code>public void testDeleteParentWithNonEmptyContainerInside() { <START> this.tested = new SafeDeleteNodeProcessor(new ChildrenTraverseProcessorImpl(new TreeWalkTraverseProcessorImpl()), <END> graphHolderContainer.graph, graphHolderContainer.parentNode); tested.run(callback); verify(callback, times(1)).deleteConnector(eq(graphHolderContainer.edge2)); verify(callback, times(1)).removeChild(eq(graphHolderContainer.containerNode), eq(graphHolderContainer.endNode)); verify(callback, times(1)).deleteNode(eq(graphHolderContainer.endNode)); verify(callback, times(1)).deleteConnector(eq(graphHolderContainer.edge1)); verify(callback, times(1)).deleteConnector(eq(graphHolderContainer.edge2)); verify(callback, times(1)).removeChild(eq(graphHolderContainer.containerNode), eq(graphHolderContainer.intermNode)); verify(callback, times(1)).deleteNode(eq(graphHolderContainer.intermNode)); verify(callback, times(1)).deleteConnector(eq(graphHolderContainer.edge1)); verify(callback, times(1)).removeChild(eq(graphHolderContainer.containerNode), eq(graphHolderContainer.startNode)); verify(callback, times(1)).deleteNode(eq(graphHolderContainer.startNode)); verify(callback, times(1)).deleteNode(eq(graphHolderContainer.containerNode)); verify(callback, times(1)).deleteCandidateNode(eq(graphHolderContainer.parentNode)); }</code><technical_language>fine, asserting commands executed right arguments, of key points test is iteration order, fix (by reverting actual order), missing this 2nd part - ensuring methods called in right order</technical_language>

Target:
public void testDeleteParentWithNonEmptyContainerInside() { this.tested = new SafeDeleteNodeProcessor(new ChildrenTraverseProcessorImpl(new TreeWalkTraverseProcessorImpl()), graphHolderContainer.graph, graphHolderContainer.parentNode); tested.run(callback); InOrder inOrder = inOrder(callback); inOrder.verify(callback, times(1)).deleteConnector(eq(graphHolderContainer.edge2)); inOrder.verify(callback, times(1)).removeChild(eq(graphHolderContainer.containerNode), eq(graphHolderContainer.endNode)); inOrder.verify(callback, times(1)).deleteNode(eq(graphHolderContainer.endNode)); inOrder.verify(callback, times(1)).deleteConnector(eq(graphHolderContainer.edge1)); inOrder.verify(callback, times(1)).removeChild(eq(graphHolderContainer.containerNode), eq(graphHolderContainer.intermNode)); inOrder.verify(callback, times(1)).deleteNode(eq(graphHolderContainer.intermNode)); inOrder.verify(callback, times(1)).removeChild(eq(graphHolderContainer.containerNode), eq(graphHolderContainer.startNode)); inOrder.verify(callback, times(1)).deleteNode(eq(graphHolderContainer.startNode)); inOrder.verify(callback, times(1)).deleteNode(eq(graphHolderContainer.containerNode)); inOrder.verify(callback, times(1)).deleteCandidateNode(eq(graphHolderContainer.parentNode)); }
Source:
<code>public static void setUp() throws IOException { <START> String[] files = {"network.dat", "osm.mapdb", "osm.mapdb.p"}; <END> String tempDirPath = createTempDirWithFiles("pointServer", files); String[] args = {"--graphs", tempDirPath}; PointToPointRouterServer.main(args); }</code><technical_language>binary files included in test resources. I tend intermediate results format is subject change, original source data GTFS OSM data. avoid checking intermediate results in (especially MapDB) if possible</technical_language>

Target:
public static void setUp() throws IOException { String[] files = {"osm.pbf", "terre-haute-gtfs.zip"}; String tempDirPath = createTempDirWithFiles("pointServer", files); String[] buildArgs = {"--build", tempDirPath}; PointToPointRouterServer.main(buildArgs); String[] runArgs = {"--graphs", tempDirPath}; PointToPointRouterServer.main(runArgs); }
Source:
<code>public void spec107_mustNotEmitFurtherSignalsOnceOnCompleteHasBeenSignalled_shouldFailForNotCompletingPublisher() throws Throwable { requireTestFailure(new ThrowingRunnable() { @Override public void run() throws Throwable { demandIgnoringSynchronousPublisherVerification().spec107_mustNotEmitFurtherSignalsOnceOnCompleteHasBeenSignalled(); } <START> }, "Expected end-of-stream but got"); <END> }</code><technical_language>This weird</technical_language>

Target:
public void spec107_mustNotEmitFurtherSignalsOnceOnCompleteHasBeenSignalled_shouldFailForNotCompletingPublisher() throws Throwable { requireTestFailure(new ThrowingRunnable() { @Override public void run() throws Throwable { demandIgnoringSynchronousPublisherVerification().spec107_mustNotEmitFurtherSignalsOnceOnCompleteHasBeenSignalled(); } }, "Expected end-of-stream but got element [" ); }
Source:
<code>public List<ApiClusterTemplateConfig> getRoleConfigs(String roleType, HostgroupView hostGroupView, TemplatePreparationObject source) { Integer volumeCount = Objects.nonNull(hostGroupView) ? hostGroupView.getVolumeCount() : 0; switch (roleType) { case HdfsRoles.DATANODE: return List.of( config("dfs_data_dir_list", buildVolumePathStringZeroVolumeHandled(volumeCount, "datanode")) ); case HdfsRoles.NAMENODE: return List.of( config("dfs_name_dir_list", buildVolumePathStringZeroVolumeHandled(volumeCount, "namenode")) ); case HdfsRoles.SECONDARYNAMENODE: return List.of( config("fs_checkpoint_dir_list", buildVolumePathStringZeroVolumeHandled(volumeCount, "namesecondary")) ); case HdfsRoles.JOURNALNODE: return List.of( config("dfs_journalnode_edits_dir", <START> buildVolumePathStringZeroVolumeHandled(volumeCount, "journalnode")) <END> ); default: return List.of(); } }</code><technical_language>accepts multiple volumes? I multiple docs I a single volume only, 100% sure</technical_language>

Target:
public List<ApiClusterTemplateConfig> getRoleConfigs(String roleType, HostgroupView hostGroupView, TemplatePreparationObject source) { Integer volumeCount = Objects.nonNull(hostGroupView) ? hostGroupView.getVolumeCount() : 0; switch (roleType) { case HdfsRoles.DATANODE: return List.of( config("dfs_data_dir_list", buildVolumePathStringZeroVolumeHandled(volumeCount, "datanode")) ); case HdfsRoles.NAMENODE: return List.of( config("dfs_name_dir_list", buildVolumePathStringZeroVolumeHandled(volumeCount, "namenode")) ); case HdfsRoles.SECONDARYNAMENODE: return List.of( config("fs_checkpoint_dir_list", buildVolumePathStringZeroVolumeHandled(volumeCount, "namesecondary")) ); case HdfsRoles.JOURNALNODE: return List.of( config("dfs_journalnode_edits_dir", buildSingleVolumePath(volumeCount, "journalnode")) ); default: return List.of(); } }
Source:
<code>protected Builder() { super(DockerApi.class); id("docker") .name("Docker API") .defaultIdentity("root") <START> .identityName("user") <END> .defaultCredential("password") .credentialName("Password") .documentation(URI.create("<LINK_0>")) .version("1.8") .defaultEndpoint("http://localhost:4243") .defaultProperties(DockerApiMetadata.defaultProperties()) .view(typeToken(ComputeServiceContext.class)) .defaultModules(ImmutableSet.<Class<? extends Module>>of( DockerHttpApiModule.class, DockerParserModule.class, DockerComputeServiceContextModule.class)); }</code><technical_language>capitalize change a text describing identity is</technical_language>

Target:
protected Builder() { super(DockerApi.class); id("docker") .name("Docker API") .identityName("user") .credentialName("password") .documentation(URI.create("<LINK_1>")) .version("1.12") .defaultEndpoint("<LINK_2>") .defaultProperties(DockerApiMetadata.defaultProperties()) .view(typeToken(ComputeServiceContext.class)) .defaultModules(ImmutableSet.<Class<? extends Module>>of( DockerHttpApiModule.class, DockerParserModule.class, DockerComputeServiceContextModule.class)); }
Source:
<code>public boolean onStartJob(JobParameters jobParameters) { <START> String file = jobParameters.getExtras().getString(FileUploader.KEY_FILE); <END> String account = jobParameters.getExtras().getString(FileUploader.KEY_ACCOUNT); UploadsStorageManager uploadsStorageManager = new UploadsStorageManager(getContentResolver()); OCUpload ocUpload = uploadsStorageManager.getLastUploadFor(new OCFile(file), account); FileUploader.UploadRequester uploadRequester = new FileUploader.UploadRequester(); uploadRequester.retry(this, ocUpload); return true; }</code><technical_language>Please, rename variable file more accurate, fileRemotePath remotePath</technical_language>

Target:
public boolean onStartJob(JobParameters jobParameters) { UploadsStorageManager uploadsStorageManager = new UploadsStorageManager(getContentResolver()); String fileRemotePath = jobParameters.getExtras().getString(Extras.EXTRA_REMOTE_PATH); String accountName = jobParameters.getExtras().getString(Extras.EXTRA_ACCOUNT_NAME); Log_OC.d(TAG, String.format("Retrying upload of %1s in %2s", fileRemotePath, accountName)); OCUpload ocUpload = uploadsStorageManager.getLastUploadFor(new OCFile(fileRemotePath), accountName); if (ocUpload != null) { TransferRequester requester = new TransferRequester(); requester.retry(this, ocUpload); } else { Log_OC.w( TAG, String.format( "No upload found in database for %1s in %2s", fileRemotePath, accountName ) ); } jobFinished(jobParameters, false); return true; }
Source:
<code>public void enableVerboseLogging(int verbose) { enforceAccessPermission(); <START> mLog.trace("enableVerboseLogging uid=%").c(Binder.getCallingUid()).flush(); <END> mFacade.setIntegerSetting( mContext, Settings.Global.WIFI_VERBOSE_LOGGING_ENABLED, verbose); enableVerboseLoggingInternal(verbose); }</code><technical_language>trace setting nice</technical_language>

Target:
public void enableVerboseLogging(int verbose) { enforceAccessPermission(); mLog.trace("enableVerboseLogging uid=% verbose=%") .c(Binder.getCallingUid()) .c(verbose).flush(); mFacade.setIntegerSetting( mContext, Settings.Global.WIFI_VERBOSE_LOGGING_ENABLED, verbose); enableVerboseLoggingInternal(verbose); }
Source:
<code>public static void warnMemorySizeLegal(VmBase vm, Version clusterVersion) { if (! VmValidationUtils.isMemorySizeLegal(vm.getOsId(), vm.getMemSizeMb(), clusterVersion)) { <START> AuditLogableBase logable = new AuditLogableBase(); <END> logable.addCustomValue("VmName", vm.getName()); logable.addCustomValue("VmMemInMb", String.valueOf(vm.getMemSizeMb())); logable.addCustomValue("VmMinMemInMb", String.valueOf(VmValidationUtils.getMinMemorySizeInMb(vm.getOsId(), clusterVersion))); logable.addCustomValue("VmMaxMemInMb", String.valueOf(VmValidationUtils.getMaxMemorySizeInMb(vm.getOsId(), clusterVersion))); AuditLogDirector.log(logable, AuditLogType.VM_MEMORY_NOT_IN_RECOMMENDED_RANGE); } }</code><technical_language>please set vm id logable object vm's events tab</technical_language>

Target:
public static void warnMemorySizeLegal(VmBase vm, Version clusterVersion) { if (! VmValidationUtils.isMemorySizeLegal(vm.getOsId(), vm.getMemSizeMb(), clusterVersion)) { AuditLogableBase logable = new AuditLogableBase(); logable.setVmId(vm.getId()); logable.addCustomValue("VmName", vm.getName()); logable.addCustomValue("VmMemInMb", String.valueOf(vm.getMemSizeMb())); logable.addCustomValue("VmMinMemInMb", String.valueOf(VmValidationUtils.getMinMemorySizeInMb(vm.getOsId(), clusterVersion))); logable.addCustomValue("VmMaxMemInMb", String.valueOf(VmValidationUtils.getMaxMemorySizeInMb(vm.getOsId(), clusterVersion))); AuditLogDirector.log(logable, AuditLogType.VM_MEMORY_NOT_IN_RECOMMENDED_RANGE); } }
Source:
<code>private String getColor(TimeEvent event) { List<@NonNull RGBAColor> list = getPalette().get(); int colorInt = list.get((int) Math.floorMod((event.getValue() & ((1L << Integer.SIZE) - 1)), list.size())).toInt(); return <START> X11ColorUtils.toHexColor(colorInt <END> >> 24, colorInt >> 16, colorInt >> 8); }</code><technical_language>ColorUtils</technical_language>

Target:
private String getColor(TimeEvent event) { List<@NonNull RGBAColor> list = getPalette().get(); int colorInt = list.get((int) Math.floorMod((event.getValue() & ((1L << Integer.SIZE) - 1)), list.size())).toInt(); return ColorUtils.toHexColor(colorInt >> 24, colorInt >> 16, colorInt >> 8); }
Source:
<code>protected void executeCommand() { <START> executeInNewTransaction(new TransactionMethod<Void>() { <END> public Void runInTransaction() { setStorageDomainStatus(StorageDomainStatus.Locked, getCompensationContext()); getCompensationContext().stateChanged(); return null; } }); setSucceeded(false); List<String> lunsToRefresh = getParameters().getLunIds(); Map<String, List<VDS>> lunToFailedVDS = refreshLunSizeAllVds(lunsToRefresh); if (!lunToFailedVDS.isEmpty()) { ArrayList<String> failedVds = new ArrayList<>(); for (Map.Entry<String, List<VDS>> entry : lunToFailedVDS.entrySet()) { String lunId = entry.getKey(); List<VDS> vdsList = entry.getValue(); log.error("Failed to refresh device " + lunId + " Not all VDS are seeing the same size " + "VDS :" + vdsList); String vdsListString = StringUtils.join(getVdsNameList(vdsList), ", "); failedVds.add("LUN :" + lunId + "VDS: " + vdsListString); } changeStorageDomainToActive(); throw new VdcBLLException(VdcBllErrors.REFRESH_LUN_ERROR, "Failed to refresh LUNs. Not all VDS are seeing the same size " + failedVds); } resizePVs(lunsToRefresh); updateStorageDomainData(); refreshPVAllVds(lunsToRefresh); changeStorageDomainToActive(); setSucceeded(true); }</code><technical_language>extracted status change active a methods extract lockStorageDomain a similar method in StorageDomainCommandBase (since ExtendSANStorageDomainCommand code is same)</technical_language>

Target:
protected void executeCommand() { executeInNewTransaction(new TransactionMethod<Void>() { public Void runInTransaction() { setStorageDomainStatus(StorageDomainStatus.Locked, getCompensationContext()); getCompensationContext().stateChanged(); return null; } }); List<String> lunsToRefresh = getParameters().getLunIds(); Map<String, List<Pair<VDS, Integer>>> lunToVds = getDeviceListAllVds(lunsToRefresh); Map<String, List<VDS>> lunToFailedVDS = getFailedLuns(lunToVds); if (!lunToFailedVDS.isEmpty()) { List<String> failedVds = new ArrayList<>(); for (Map.Entry<String, List<VDS>> entry : lunToFailedVDS.entrySet()) { String lunId = entry.getKey(); List<VDS> vdsList = entry.getValue(); log.error("Failed to refresh device " + lunId + " Not all VDS are seeing the same size " + "VDS :" + vdsList); String vdsListString = StringUtils.join(getVdsNameList(vdsList), ", "); failedVds.add("LUN : " + lunId + "VDS: " + vdsListString); } throw new VdcBLLException(VdcBllErrors.REFRESH_LUN_ERROR, "Failed to refresh LUNs. Not all VDS are seeing the same size: " + failedVds); } resizePVs(lunsToRefresh); updateStorageDomainData(); changeStorageDomainToActive(); setSucceeded(true); }
Source:
<code>protected @Nullable String getProcessName(@NonNull ITmfEvent event) { return <START> getTrace().getExecAspect().resolve(event); <END> }</code><technical_language>getTrace() a UfTrace painting in a corner here. for TraceEventEvent thing, this provider works UfTrace trace, uftrace-like events implementing semantic. need fixed right now. in mind for later</technical_language>

Target:
protected @Nullable String getProcessName(@NonNull ITmfEvent event) { return fExecAspect.resolve(event); }
Source:
<code>public void send(final OutgoingT message) { final String json = gson.toJson(message); CompletableFutureUtils.logExceptionWhenComplete( <START> CompletableFuture.runAsync(() -> client.sendMessage(json), threadPool), <END> "Failed to send message to server"); }</code><technical_language>Ok I dug code of library pretty send operation is asynchronous already. (Like I expected work experience javascript) a worker pool is speeding a noticeable amount. Of sense parallelize json serialization if objects large, sending blocking all</technical_language>

Target:
public void send(final OutgoingT message) { CompletableFutureUtils.logExceptionWhenComplete( CompletableFuture.runAsync(() -> client.sendMessage(gson.toJson(message)), threadPool), e -> log.log(Level.WARNING, "Failed to send message to server", e)); }
Source:
<code><START> private Mono<Void> createContainerIfNotExistsAsync(final StorageAccount storageAccount, <END> final String containerName) { return getBlobClientAsync(storageAccount) .flatMap(blobServiceAsyncClient -> blobServiceAsyncClient .getBlobContainerAsyncClient(containerName) .exists() .flatMap(aBoolean -> { if (aBoolean) { return Mono.empty(); } return blobServiceAsyncClient.getBlobContainerAsyncClient(containerName).create(); })); }</code><technical_language>Mgmt able create a storage blob container</technical_language>

Target:
private Mono<Indexable> createContainerIfNotExistsAsync(final StorageAccount storageAccount, final String containerName) { return storageManager.blobContainers() .getAsync(storageAccount.resourceGroupName(), storageAccount.name(), containerName) .cast(Indexable.class) .onErrorResume(throwable -> storageManager.blobContainers() .defineContainer(containerName) .withExistingBlobService(storageAccount.resourceGroupName(), storageAccount.name()) .withPublicAccess(PublicAccess.CONTAINER) .createAsync() .last()); }
Source:
<code>void wrapUp(GitHub root) { super.wrapUp(root); if (installation == null) throw new IllegalStateException( "Expected check_suite payload, but got something else. Maybe we've got another type of event?"); else installation.wrapUp(root); if (repositories != null && !repositories.isEmpty()) { try { for (GHRepository singleRepo : repositories) { singleRepo.wrap(root); <START> singleRepo.refresh(); <END> } } catch (IOException e) { throw new GHException("Failed to refresh repositories", e); } } }</code><technical_language>suggestion singleRepo.populate();</technical_language>

Target:
void wrapUp(GitHub root) { super.wrapUp(root); if (installation == null) throw new IllegalStateException( "Expected check_suite payload, but got something else. Maybe we've got another type of event?"); else installation.wrapUp(root); if (repositories != null && !repositories.isEmpty()) { try { for (GHRepository singleRepo : repositories) { singleRepo.wrap(root); singleRepo.populate(); } } catch (IOException e) { throw new GHException("Failed to refresh repositories", e); } } }