auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void alterDatabase(String databaseName, CatalogDatabase newDatabase, boolean ignoreIfNotExists) throws DatabaseNotExistException, CatalogException { checkArgument(!StringUtils.isNullOrWhitespaceOnly(databaseName), "databaseName cannot be null or empty"); checkNotNull(newDatabase, "newDatabase cannot be null"); Database hiveDB; try { hiveDB = getHiveDatabase(databaseName); } catch (DatabaseNotExistException e) { if (!ignoreIfNotExists) { throw new DatabaseNotExistException(getName(), databaseName); } return; } <START> Map<String, String> params = hiveDB.getParameters(); <END> boolean isGeneric = getObjectIsGeneric(params); if (isGeneric) { hiveDB.setParameters(newDatabase.getProperties()); } else { String opStr = newDatabase.getProperties().remove(ALTER_DATABASE_OP); if (opStr == null) { throw new CatalogException(ALTER_DATABASE_OP + " property is missing for alter database statement"); } String newLocation = newDatabase.getProperties().remove(SqlCreateHiveDatabase.DATABASE_LOCATION_URI); Map<String, String> newParams = newDatabase.getProperties(); AlterHiveDatabaseOp op = AlterHiveDatabaseOp.valueOf(opStr); switch (op) { case CHANGE_PROPS: if (params == null) { hiveDB.setParameters(newParams); } else { params.putAll(newParams); } break; case CHANGE_LOCATION: hiveDB.setLocationUri(newLocation); break; case CHANGE_OWNER: String ownerName = newParams.remove(DATABASE_OWNER_NAME); String ownerType = newParams.remove(DATABASE_OWNER_TYPE); hiveDB.setOwnerName(ownerName); switch (ownerType) { case SqlAlterHiveDatabaseOwner.ROLE_OWNER: hiveDB.setOwnerType(PrincipalType.ROLE); break; case SqlAlterHiveDatabaseOwner.USER_OWNER: hiveDB.setOwnerType(PrincipalType.USER); break; default: throw new CatalogException("Unsupported database owner type: " + ownerType); } break; default: throw new CatalogException("Unsupported alter database op:" + opStr); } } try { client.alterDatabase(databaseName, hiveDB); } catch (TException e) { throw new CatalogException(String.format("Failed to alter database %s", databaseName), e); } }</code><technical_language>I HiveCatalog big big, split database related codes a separate class</technical_language>

Target:
public void alterDatabase(String databaseName, CatalogDatabase newDatabase, boolean ignoreIfNotExists) throws DatabaseNotExistException, CatalogException { checkArgument(!StringUtils.isNullOrWhitespaceOnly(databaseName), "databaseName cannot be null or empty"); checkNotNull(newDatabase, "newDatabase cannot be null"); Database hiveDB; try { hiveDB = getHiveDatabase(databaseName); } catch (DatabaseNotExistException e) { if (!ignoreIfNotExists) { throw new DatabaseNotExistException(getName(), databaseName); } return; } try { client.alterDatabase(databaseName, HiveDatabaseUtil.alterDatabase(hiveDB, newDatabase)); } catch (TException e) { throw new CatalogException(String.format("Failed to alter database %s", databaseName), e); } }
Source:
<code>public BlockLease flatten(Block block) { requireNonNull(block, "block is null"); if (block instanceof DictionaryBlock) { <START> return flattenDictionary((DictionaryBlock) block); <END> } if (block instanceof RunLengthEncodedBlock) { return flattenRLE((RunLengthEncodedBlock) block); } return newLease(block); }</code><technical_language>nit: call flattenDictionaryBlock flattenRunLengthEncodedBlock</technical_language>

Target:
public BlockLease flatten(Block block) { requireNonNull(block, "block is null"); if (block instanceof DictionaryBlock) { return flattenDictionaryBlock((DictionaryBlock) block); } if (block instanceof RunLengthEncodedBlock) { return flattenRunLengthEncodedBlock((RunLengthEncodedBlock) block); } return newLease(block); }
Source:
<code>public void handle(StageFeedEntry feedEntry, final PipelineInstanceLoader pipelineInstanceLoader) { StageIdentifier stageIdentifier = feedEntry.getStageIdentifier(); <START> LOGGER.debug("handling stage:<" + stageIdentifier + ">..."); <END> try { stageStorage.save(stageResourceImporter.load(stageIdentifier, new InMemoryTempGraphFactory(), transformerRegistry)); LOGGER.debug("importing stage:<" + stageIdentifier + "> finished."); } catch (GoIntegrationException e) { LOGGER.error("Can not import stage <" + stageIdentifier + ">, will skip to next...", e); } }</code><technical_language>change</technical_language>

Target:
public void handle(StageFeedEntry feedEntry, final PipelineInstanceLoader pipelineInstanceLoader) { StageIdentifier stageIdentifier = feedEntry.getStageIdentifier(); LOGGER.debug("handling stage:<{}>...", stageIdentifier); try { stageStorage.save(stageResourceImporter.load(stageIdentifier, new InMemoryTempGraphFactory(), transformerRegistry)); LOGGER.debug("importing stage:<{}> finished.", stageIdentifier); } catch (GoIntegrationException e) { LOGGER.error("Can not import stage <{}>, will skip to next...", stageIdentifier, e); } }
Source:
<code>public void displayNewPage(PageTitle title, HistoryEntry entry, boolean tryFromCache, boolean pushBackStack, int stagedScrollY, boolean savedPageRefreshed) { tocHandler.setEnabled(false); setToCButtonFadedIn(true); errorView.setVisibility(View.GONE); model.setTitle(title); model.setTitleOriginal(title); model.setCurEntry(entry); savedPagesFunnel = app.getFunnelManager().getSavedPagesFunnel(title.getSite()); getPageActivity().updateProgressBar(true, true, 0); <START> checkIfPageIsSaved(title); <END> refreshedIfSaved = savedPageRefreshed; pageLoadStrategy.onDisplayNewPage(pushBackStack, tryFromCache, stagedScrollY); }</code><technical_language>reset isPageSaved here</technical_language>

Target:
public void displayNewPage(PageTitle title, HistoryEntry entry, boolean tryFromCache, boolean pushBackStack, int stagedScrollY, boolean savedPageRefreshed) { tocHandler.setEnabled(false); setToCButtonFadedIn(true); errorView.setVisibility(View.GONE); model.setTitle(title); model.setTitleOriginal(title); model.setCurEntry(entry); savedPagesFunnel = app.getFunnelManager().getSavedPagesFunnel(title.getSite()); getPageActivity().updateProgressBar(true, true, 0); savedPageCheckComplete = false; checkIfPageIsSaved(); refreshedIfSaved = savedPageRefreshed; pageLoadStrategy.onDisplayNewPage(pushBackStack, tryFromCache, stagedScrollY); }
Source:
<code>SessionManager() { if (BitreserveClient.getApplicationContext() != null) { initSharedPreferences(); } else { <START> sharedPreferences = null; <END> } }</code><technical_language>Do need this else</technical_language>

Target:
SessionManager() { if (BitreserveClient.getApplicationContext() != null) { initSharedPreferences(); } }
Source:
<code>public Optional<ChargeStatus> getMappedGatewayStatus(ChargeEntity charge) { try { return getChargeGatewayStatus(charge).getMappedStatus(); } catch (WebApplicationException | UnsupportedOperationException | GatewayException | IllegalArgumentException e) { logger.info("Unable to retrieve status for charge for gateway {}: {}", charge.getExternalId(), charge.getPaymentGatewayName().toString(), <START> e.getMessage()); <END> return Optional.empty(); } }</code><technical_language>this log line structured key/values while here</technical_language>

Target:
public Optional<ChargeStatus> getMappedGatewayStatus(ChargeEntity charge) { try { return getChargeGatewayStatus(charge).getMappedStatus(); } catch (WebApplicationException | UnsupportedOperationException | GatewayException | IllegalArgumentException e) { logger.info(String.format("Unable to retrieve status for charge %s for gateway %s: %s", charge.getExternalId(), charge.getPaymentGatewayName().toString(), e.getMessage()), kv(PAYMENT_EXTERNAL_ID, charge.getExternalId()), kv(PROVIDER, charge.getPaymentGatewayName().toString())); return Optional.empty(); } }
Source:
<code>public void process(K k, V v) { Span span = kafkaStreamsTracing.nextSpan(processorContext); if (!span.isNoop()) { span.name(spanName); span.start(); } Tracer.SpanInScope ws = tracer.withSpanInScope(span); Throwable error = null; try { delegateProcessor.process(k, v); <START> } catch (RuntimeException | Error e) { <END> error = e; Call.propagateIfFatal(e); throw e; } finally { kafkaStreamsTracing.injector.inject(span.context(), processorContext.headers()); if (error != null) span.error(error); span.finish(); ws.close(); } }</code><technical_language>this turned Throwable well</technical_language>

Target:
public void process(K k, V v) { Span span = kafkaStreamsTracing.nextSpan(processorContext); if (!span.isNoop()) { span.name(spanName); span.start(); } Tracer.SpanInScope ws = tracer.withSpanInScope(span); Throwable error = null; try { delegateProcessor.process(k, v); } catch (Throwable e) { error = e; propagateIfFatal(e); throw e; } finally { kafkaStreamsTracing.injector.inject(span.context(), processorContext.headers()); if (error != null) span.error(error); span.finish(); ws.close(); } }
Source:
<code>public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } <START> return this.hashCode() == obj.hashCode(); <END> }</code><technical_language>.. non-equal objects hashCode! :(</technical_language>

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } PropertiesImpl other = (PropertiesImpl) obj; return computeEqualityWith(this, other); }
Source:
<code>public void writeContent(final XMLExtendedStreamWriter writer, final SubsystemMarshallingContext context) throws XMLStreamException { <<<<<<< HEAD context.startSubsystemElement(EJB3SubsystemNamespace.EJB3_3_1.getUriString(), false); ======= context.startSubsystemElement(EJB3SubsystemNamespace.EJB3_4_0.getUriString(), false); <START> >>>>>>> a05507f... [WFLY-3290] Add cluster attribute to EJB3 subsystem remote element to allow specifying EJBClient cluster name. <END> writeElements(writer, context); writer.writeEndElement(); }</code><technical_language>unresolved merge conflict</technical_language>

Target:
public void writeContent(final XMLExtendedStreamWriter writer, final SubsystemMarshallingContext context) throws XMLStreamException { context.startSubsystemElement(EJB3SubsystemNamespace.EJB3_4_0.getUriString(), false); writeElements(writer, context); writer.writeEndElement(); }
Source:
<code>public ACEReader(String aceCorpusHome, String[] sections, boolean is2004mode) throws Exception { super(CorpusReaderConfigurator.buildResourceManager(aceCorpusHome)); this.aceCorpusHome = aceCorpusHome; this.corpusId = is2004mode ? "ACE2004" : "ACE2005"; this.is2004mode = is2004mode; if (sections == null || sections.length == 0) { sections = IOUtils.lsDirectories(this.aceCorpusHome); } File corpusHomeDir = new File(this.aceCorpusHome); assert corpusHomeDir.isDirectory(); FilenameFilter apfFileFilter = new FilenameFilter() { public boolean accept(File directory, String fileName) { <START> return ( new File(directory + "/" + fileName).isDirectory() || fileName.endsWith(".apf.xml") ); <END> } }; List<Pair<String, String>> fileNames = new ArrayList<>(); for (String section : sections) { File sectionDir = new File(this.aceCorpusHome + File.separator + section); String[] xmlFiles = IOUtils.lsFilesRecursive(sectionDir.getAbsolutePath(), apfFileFilter); if (xmlFiles.length == 0) { logger.error("No valid xml file found. Skipping section " + section); continue; } for (String fileName : xmlFiles) { fileNames.add(new Pair<>(section, fileName)); } } this.fileList = Collections.unmodifiableList(fileNames); }</code><technical_language>File.Separator</technical_language>

Target:
public ACEReader(String aceCorpusHome, String[] sections, boolean is2004mode) throws Exception { super(CorpusReaderConfigurator.buildResourceManager(aceCorpusHome)); this.aceCorpusHome = aceCorpusHome; this.corpusId = is2004mode ? "ACE2004" : "ACE2005"; this.is2004mode = is2004mode; if (sections == null || sections.length == 0) { sections = IOUtils.lsDirectories(this.aceCorpusHome); } File corpusHomeDir = new File(this.aceCorpusHome); assert corpusHomeDir.isDirectory(); FilenameFilter apfFileFilter = new FilenameFilter() { public boolean accept(File directory, String fileName) { return ( new File(directory + File.separator + fileName).isDirectory() || fileName.endsWith(".apf.xml") ); } }; List<Pair<String, String>> fileNames = new ArrayList<>(); for (String section : sections) { File sectionDir = new File(this.aceCorpusHome + File.separator + section); String[] xmlFiles = IOUtils.lsFilesRecursive(sectionDir.getAbsolutePath(), apfFileFilter); if (xmlFiles.length == 0) { logger.error("No valid xml file found. Skipping section " + section); continue; } for (String fileName : xmlFiles) { fileNames.add(new Pair<>(section, fileName)); } } this.fileList = Collections.unmodifiableList(fileNames); }
Source:
<code>private Builder visitContainer(Container container) { Builder builder = visitContent(container); ContentRefSerializer refSerializer = new ContentRefSerializer(container.getSource()); for (ItemRef child : container.getItemRefs()) { builder.addChildren(refSerializer.serialize(child)); } for (Map.Entry<ItemRef, Iterable<BroadcastRef>> upcomingContent : container.getUpcomingContent() .entrySet()) { builder.addUpcomingContent( itemAndBroadcastRefSerializer.serialize( upcomingContent.getKey(), upcomingContent.getValue() ) ); } for (Map.Entry<ItemRef, Iterable<LocationSummary>> availableContent : container.getAvailableContent() .entrySet()) { builder.addAvailableContent( itemAndLocationSummarySerializer.serialize( availableContent.getKey(), availableContent.getValue() ) ); } if (container.getItemSummaries() != null) { builder.addAllItemSummaries( container.getItemSummaries().stream() .map(is -> { try { return itemSummarySerializer.serialize(is).build(); } catch (Exception e) { <START> log.error("ItemSummary without title: {}", is.getItemRef().getId(), e); <END> return null; } }) .filter(Objects::nonNull) .collect(Collectors.toList()) ); } if (container.getCertificates() != null) { builder.addAllCertificates(container.getCertificates().stream() .map(certificateSerializer::serialize) .collect(MoreCollectors.toImmutableSet())); } if (container.getYear() != null) { builder.addReleaseYears(container.getYear()); } return builder; }</code><technical_language>do exception is title? I exception information is missing. catch specific exception is thrown</technical_language>

Target:
private Builder visitContainer(Container container) { Builder builder = visitContent(container); ContentRefSerializer refSerializer = new ContentRefSerializer(container.getSource()); for (ItemRef child : container.getItemRefs()) { builder.addChildren(refSerializer.serialize(child)); } for (Map.Entry<ItemRef, Iterable<BroadcastRef>> upcomingContent : container.getUpcomingContent() .entrySet()) { builder.addUpcomingContent( itemAndBroadcastRefSerializer.serialize( upcomingContent.getKey(), upcomingContent.getValue() ) ); } for (Map.Entry<ItemRef, Iterable<LocationSummary>> availableContent : container.getAvailableContent() .entrySet()) { builder.addAvailableContent( itemAndLocationSummarySerializer.serialize( availableContent.getKey(), availableContent.getValue() ) ); } if (container.getItemSummaries() != null) { builder.addAllItemSummaries( container.getItemSummaries().stream() .map(this::serializeItemSummary) .filter(Objects::nonNull) .collect(Collectors.toList()) ); } if (container.getCertificates() != null) { builder.addAllCertificates(container.getCertificates().stream() .map(certificateSerializer::serialize) .collect(MoreCollectors.toImmutableSet())); } if (container.getYear() != null) { builder.addReleaseYears(container.getYear()); } return builder; }
Source:
<code>public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) { for (@NonNull LSPDocumentInfo info : LanguageServiceAccessor.getLSPDocumentInfosFor(textViewer.getDocument(), capabilities -> capabilities.getDocumentLinkProvider() != null)) { try { DocumentLinkParams params = new DocumentLinkParams( new TextDocumentIdentifier(info.getFileUri().toString())); CompletableFuture<List<DocumentLink>> documentLink = info.getInitializedLanguageClient() <START> .get(500, TimeUnit.MILLISECONDS).getTextDocumentService() <END> .documentLink(params); List<DocumentLink> links = documentLink.get(2, TimeUnit.SECONDS); if (links == null || links.isEmpty()) { continue; } List<IHyperlink> hyperlinks = new ArrayList<IHyperlink>(links.size()); for (DocumentLink link : links) { int start = LSPEclipseUtils.toOffset(link.getRange().getStart(), textViewer.getDocument()); int end = LSPEclipseUtils.toOffset(link.getRange().getEnd(), textViewer.getDocument()); IRegion linkRegion = new Region(start, end - start); if (TextUtilities.overlaps(region, linkRegion)) { if (link.getTarget() != null) { hyperlinks.add(new DocumentHyperlink(link.getTarget(), linkRegion)); } } } if (hyperlinks.isEmpty()) { return null; } return hyperlinks.toArray(new IHyperlink[hyperlinks.size()]); } catch (BadLocationException | InterruptedException | ExecutionException | TimeoutException e) { LanguageServerPlugin.logError(e); } } return null; }</code><technical_language>in previous file. I need avoid multiple get(nnn, TimeUnit) in method. chaining calling get(...) future enough</technical_language>

Target:
public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) { for (@NonNull LSPDocumentInfo info : LanguageServiceAccessor.getLSPDocumentInfosFor(textViewer.getDocument(), capabilities -> capabilities.getDocumentLinkProvider() != null)) { try { DocumentLinkParams params = new DocumentLinkParams( new TextDocumentIdentifier(info.getFileUri().toString())); CompletableFuture<List<DocumentLink>> documentLink = info.getInitializedLanguageClient() .thenCompose(languageServer -> languageServer.getTextDocumentService().documentLink(params)); List<DocumentLink> links = documentLink.get(2, TimeUnit.SECONDS); if (links == null || links.isEmpty()) { continue; } List<IHyperlink> hyperlinks = new ArrayList<IHyperlink>(links.size()); for (DocumentLink link : links) { int start = LSPEclipseUtils.toOffset(link.getRange().getStart(), textViewer.getDocument()); int end = LSPEclipseUtils.toOffset(link.getRange().getEnd(), textViewer.getDocument()); IRegion linkRegion = new Region(start, end - start); if (TextUtilities.overlaps(region, linkRegion)) { if (link.getTarget() != null) { hyperlinks.add(new DocumentHyperlink(link.getTarget(), linkRegion)); } } } if (hyperlinks.isEmpty()) { return null; } return hyperlinks.toArray(new IHyperlink[hyperlinks.size()]); } catch (BadLocationException | InterruptedException | ExecutionException | TimeoutException e) { LanguageServerPlugin.logError(e); } } return null; }
Source:
<code>public synchronized CleanUpTabPageDescriptor[] getCleanUpTabPageDescriptors(int kind) { ensurePagesRegistered(); ArrayList<CleanUpTabPageDescriptor> result= new ArrayList<>(); for (CleanUpTabPageDescriptor <START> fPageDescriptor : <END> fPageDescriptors) { if (fPageDescriptor.getKind() == kind) { result.add(fPageDescriptor); } } return result.toArray(new CleanUpTabPageDescriptor[result.size()]); }</code><technical_language>rename descriptor</technical_language>

Target:
public synchronized CleanUpTabPageDescriptor[] getCleanUpTabPageDescriptors(int kind) { ensurePagesRegistered(); ArrayList<CleanUpTabPageDescriptor> result= new ArrayList<>(); for (CleanUpTabPageDescriptor descriptor : fPageDescriptors) { if (descriptor.getKind() == kind) { result.add(descriptor); } } return result.toArray(new CleanUpTabPageDescriptor[result.size()]); }
Source:
<code>public void checkFormMappingResolutionShouldNotAddProblemsIfThereIsNONE() throws Exception { ArrayList<Problem> problems = new ArrayList<>(); SFormMappingImpl sFormMappingTask = new SFormMappingImpl(321324, FormMappingType.TASK.getId(), "Step1", SFormMapping.TARGET_NONE); SFormMappingImpl sFormMappingProcessOverview = new SFormMappingImpl(321324, FormMappingType.PROCESS_OVERVIEW.getId(), null, SFormMapping.TARGET_NONE); SFormMappingImpl sFormMappingProcessStart = new SFormMappingImpl(321324, FormMappingType.PROCESS_START.getId(), null, SFormMapping.TARGET_NONE); formMappingAndPageDependencyDeployer.checkFormMappingResolution(tenantServiceAccessor, sFormMappingTask, problems); formMappingAndPageDependencyDeployer.checkFormMappingResolution(tenantServiceAccessor, sFormMappingProcessOverview, problems); formMappingAndPageDependencyDeployer.checkFormMappingResolution(tenantServiceAccessor, sFormMappingProcessStart, problems); <START> assertThat(problems).as("the problem list should contain three mapping problems").hasSize(0); <END> }</code><technical_language>change message "... mapping problem"</technical_language>

Target:
public void checkFormMappingResolutionShouldNotAddProblemsIfThereIsNONE() throws Exception { ArrayList<Problem> problems = new ArrayList<>(); SFormMappingImpl sFormMappingTask = new SFormMappingImpl(321324, FormMappingType.TASK.getId(), "Step1", SFormMapping.TARGET_NONE); SFormMappingImpl sFormMappingProcessOverview = new SFormMappingImpl(321324, FormMappingType.PROCESS_OVERVIEW.getId(), null, SFormMapping.TARGET_NONE); SFormMappingImpl sFormMappingProcessStart = new SFormMappingImpl(321324, FormMappingType.PROCESS_START.getId(), null, SFormMapping.TARGET_NONE); formMappingAndPageDependencyDeployer.checkFormMappingResolution(tenantServiceAccessor, sFormMappingTask, problems); formMappingAndPageDependencyDeployer.checkFormMappingResolution(tenantServiceAccessor, sFormMappingProcessOverview, problems); formMappingAndPageDependencyDeployer.checkFormMappingResolution(tenantServiceAccessor, sFormMappingProcessStart, problems); assertThat(problems).as("the problem list should not contain any mapping problem").hasSize(0); }
Source:
<code>public static void evaluateFinal(BooleanDistinctState state, BlockBuilder out) { switch (state.getInt()) { case 0: BIGINT.writeLong(out, 0); break; case 1: case 2: BIGINT.writeLong(out, 1); break; case 3: BIGINT.writeLong(out, 2); break; <START> } <END> }</code><technical_language>BIGINT.writeLong(out, Integer.bitCount( state.getInt() )) handle default case</technical_language>

Target:
public static void evaluateFinal(BooleanDistinctState state, BlockBuilder out) { BIGINT.writeLong(out, Integer.bitCount(state.getByte())); }
Source:
<code>private BtVodUpdater btVodUpdater() { return new BtVodUpdater( mergingContentWriter(), btVodData(btVodMpxProdFeedBaseUrl, btVodMpxProdFeedName, btVodMpxProdFeedQParam), URI_PREFIX, btVodContentGroupUpdater(Publisher.BT_VOD, URI_PREFIX, btVodMpxProdFeedBaseUrl, btVodMpxProdFeedQParam), Publisher.BT_VOD, oldContentDeactivator(Publisher.BT_VOD), noImageExtractor(), URI_PREFIX, noImageExtractor(), brandUriExtractor(URI_PREFIX), topicResolver, topicWriter, newFeedContentMatchingPredicate(btVodMpxProdFeedBaseUrl, btVodMpxProdFeedQParam), <START> topicFor(feedNamepaceFor("prod", "config1"), BT_VOD_NEW_FEED, Publisher.BT_VOD), <END> topicFor(btVodAppCategoryNamespaceFor("prod", "config1"), BT_VOD_KIDS_TOPIC, Publisher.BT_VOD), topicFor(btVodAppCategoryNamespaceFor("prod", "config1"), BT_VOD_TV_BOXSETS_TOPIC, Publisher.BT_VOD), topicFor(btVodAppCategoryNamespaceFor("prod", "config1"), BT_VOD_CATCHUP_TOPIC, Publisher.BT_VOD), staleTopicContentRemover(Publisher.BT_VOD, "prod", "config1"), seriesUriExtractor(URI_PREFIX), versionsExtractor(URI_PREFIX), describedFieldsExtractor(Publisher.BT_VOD,"prod", "config1", btVodMpxProdFeedBaseUrl, btVodMpxProdFeedQParam) ); }</code><technical_language>constant</technical_language>

Target:
private BtVodUpdater btVodUpdater() { return new BtVodUpdater( mergingContentWriter(), btVodData(btVodMpxProdFeedBaseUrl, btVodMpxProdFeedName, btVodMpxProdFeedQParam), URI_PREFIX, btVodContentGroupUpdater(Publisher.BT_VOD, URI_PREFIX, btVodMpxProdFeedBaseUrl, btVodMpxProdFeedQParam), Publisher.BT_VOD, oldContentDeactivator(Publisher.BT_VOD), noImageExtractor(), URI_PREFIX, noImageExtractor(), brandUriExtractor(URI_PREFIX), topicResolver, topicWriter, newFeedContentMatchingPredicate(btVodMpxProdFeedBaseUrl, btVodMpxProdFeedQParam), topicFor(feedNamepaceFor(BT_VOD_UPDATER_ENV, BT_VOD_UPDATER_CONFIG), BT_VOD_NEW_FEED, Publisher.BT_VOD), topicFor(btVodAppCategoryNamespaceFor(BT_VOD_UPDATER_ENV, BT_VOD_UPDATER_CONFIG), BT_VOD_KIDS_TOPIC, Publisher.BT_VOD), topicFor(btVodAppCategoryNamespaceFor(BT_VOD_UPDATER_ENV, BT_VOD_UPDATER_CONFIG), BT_VOD_TV_BOXSETS_TOPIC, Publisher.BT_VOD), topicFor(btVodAppCategoryNamespaceFor(BT_VOD_UPDATER_ENV, BT_VOD_UPDATER_CONFIG), BT_VOD_CATCHUP_TOPIC, Publisher.BT_VOD), staleTopicContentRemover(Publisher.BT_VOD, BT_VOD_UPDATER_ENV, BT_VOD_UPDATER_CONFIG), seriesUriExtractor(URI_PREFIX), versionsExtractor(URI_PREFIX, BT_VOD_UPDATER_ENV, BT_VOD_UPDATER_CONFIG), describedFieldsExtractor(Publisher.BT_VOD,BT_VOD_UPDATER_ENV, BT_VOD_UPDATER_CONFIG, btVodMpxProdFeedBaseUrl, btVodMpxProdFeedQParam) ); }
Source:
<code>public void triggerNow() { if <START> (updateTimerJobId != null) { <END> SchedulerUtil scheduler = Injector.get(SchedulerUtilQuartzImpl.class); scheduler.triggerJob(updateTimerJobId); } }</code><technical_language>if need it. of engine commands working correctly invoke commands backend initialization is done. I REST api GWT frontend accessible is properly initialized in backend depend it. @mperina is correct</technical_language>

Target:
public void triggerNow() { if (updateTimerJobId != null) { SchedulerUtil scheduler = getSchedulerInstance(); scheduler.triggerJob(updateTimerJobId); } }
Source:
<code>private void handleAuthError(AccountStore.AuthenticationErrorType error, String errorMessage) { switch (error) { case INCORRECT_USERNAME_OR_PASSWORD: case NOT_AUTHENTICATED: showError(getString(R.string.username_or_password_incorrect)); break; case INVALID_OTP: case INVALID_TOKEN: case AUTHORIZATION_REQUIRED: case NEEDS_2FA: if (mIsWpcom) { <START> mLoginListener.needs2fa(mRequestedUsername, mRequestedPassword); <END> } else { showError("2FA not supported for self-hosted sites. Please use an app-password."); } break; default: AppLog.e(T.NUX, "Server response: " + errorMessage); ToastUtils.showToast(getActivity(), errorMessage == null ? getString(R.string.error_generic) : errorMessage); break; } }</code><technical_language>mLoginListener need a null check</technical_language>

Target:
private void handleAuthError(AccountStore.AuthenticationErrorType error, String errorMessage) { switch (error) { case INCORRECT_USERNAME_OR_PASSWORD: case NOT_AUTHENTICATED: showError(getString(R.string.username_or_password_incorrect)); break; case INVALID_OTP: case INVALID_TOKEN: case AUTHORIZATION_REQUIRED: case NEEDS_2FA: if (mIsWpcom) { if (mLoginListener != null) { mLoginListener.needs2fa(mRequestedUsername, mRequestedPassword); } } else { showError("2FA not supported for self-hosted sites. Please use an app-password."); } break; default: AppLog.e(T.NUX, "Server response: " + errorMessage); ToastUtils.showToast(getActivity(), errorMessage == null ? getString(R.string.error_generic) : errorMessage); break; } }
Source:
<code>public static Map<String, Object> request(OP op, String uri, Map<String, String> payload, String body, ArrayList<HashMap<String, String>> postHeaders) throws Exception { HashMap<String, String> headers = new HashMap<>(); for (HashMap<String, String> map : postHeaders) { for (Map.Entry<String, String> entry : map.entrySet()) { headers.put(entry.getKey(), entry.getValue()); } } if (body == null) { return request(op, uri, headers, payload); } else { <START> return request(op,uri, headers, body, ContentType.DEFAULT_TEXT); <END> } }</code><technical_language>Inconsistent format! space comma</technical_language>

Target:
public static Map<String, Object> request(OP op, String uri, Map<String, String> payload, String body, ArrayList<HashMap<String, String>> postHeaders) throws Exception { HashMap<String, String> headers = new HashMap<>(); for (HashMap<String, String> map : postHeaders) { for (Map.Entry<String, String> entry : map.entrySet()) { headers.put(entry.getKey(), entry.getValue()); } } HashMap<String, Object> newPayload = new HashMap<>(); for (Map.Entry<String, String> entry : payload.entrySet()) { newPayload.put(entry.getKey(), entry.getValue()); } if (body == null) { return request(op, uri, headers, newPayload); } else { return request(op, uri, headers, body, ContentType.DEFAULT_TEXT); } }
Source:
<code>public Optional<IdentifiedVersion> lastKnownVersion() { <START> return Optional.empty(); <END> }</code><technical_language>I guess snapshotting right is cheap events, this lead unintended consequences on. safer return Optional.of(FAKE)? - a snapshot a leader election, uncommon</technical_language>

Target:
public Optional<IdentifiedVersion> lastKnownVersion() { return FAKE_OPTIONAL_VERSION; }
Source:
<code>public long countLocationsByType(final Integer type, final String programUUID) throws MiddlewareQueryException { <START> return this.countAllByMethod(this.getLocationDao(), COUNT_BY_TYPE, new Object[] { type, programUUID }, <END> new Class[] { Integer.class, String.class }); }</code><technical_language>replace LocationDataManagerImpl.COUNT_BY_TYPE</technical_language>

Target:
public long countLocationsByType(final Integer type, final String programUUID) throws MiddlewareQueryException { return this.countAllByMethod(this.getLocationDao(), LocationDataManagerImpl.COUNT_BY_TYPE, new Object[] { type, programUUID }, new Class[] { Integer.class, String.class }); }
Source:
<code>public void testGetUnit() { final String result = DlmsUnitTypeDto.getUnit(1); <START> Assert.assertTrue("Y".equals(result)); <END> }</code><technical_language>assertEquals</technical_language>

Target:
public void testGetUnit() { final String result = DlmsUnitTypeDto.getUnit(1); assertEquals("Y", result); }
Source:
<code>public OSBTreeCollectionManager getSBtreeCollectionManager() { try { return sbTreeCollectionManager; } catch (RuntimeException e) { throw logAndPrepareForRethrow(e); } catch (Error e) { throw logAndPrepareForRethrow(e); } catch (Throwable t) { throw logAndPrepareForRethrow(t); <START> } <END> }</code><technical_language>Try/catch removed</technical_language>

Target:
public OSBTreeCollectionManager getSBtreeCollectionManager() { return sbTreeCollectionManager; }
Source:
<code>public void onEvent(CordovaEvent event) { if (listener != null) { <START> if (event.getEventType().equals(CordovaEvent.CordovaEventType.PAGE_STARTED)) { <END> listener.onPageStarted(); } else if (event.getEventType().equals(CordovaEvent.CordovaEventType.PAGE_FINISHED)) { listener.onPageFinished(event.getParam()); } else if (event.getEventType().equals(CordovaEvent.CordovaEventType.ERROR)) { listener.onPageError(new Exception(event.getParam())); } } }</code><technical_language>invert extract variable</technical_language>

Target:
public void onEvent(CordovaEvent event) { if (listener != null) { CordovaEvent.CordovaEventType eventType = event.getEventType(); if (CordovaEvent.CordovaEventType.PAGE_STARTED.equals(eventType)) { listener.onPageStarted(); } else if (CordovaEvent.CordovaEventType.PAGE_FINISHED.equals(eventType)) { listener.onPageFinished(event.getParam()); } else if (CordovaEvent.CordovaEventType.ERROR.equals(eventType)) { listener.onPageError(new Exception(event.getParam())); } } }
Source:
<code>private List<ProblemMarkerFilterDesc> findEnabledFilters(IProject project) { <START> List<ProblemMarkerFilterDesc> result = filtersCache.get(project); <END> if (result == null) { result = new ArrayList<ProblemMarkerFilterDesc>(); for (ProblemMarkerFilterDesc filterDesc: filters) { if ( filterDesc.matches(project) ) { result.add(filterDesc); } } filtersCache.put(project, result); } return result; }</code><technical_language>I access filtersCache synchronized, no</technical_language>

Target:
private List<ProblemMarkerFilterDesc> findEnabledFilters(IProject project) { synchronized (filtersCache) { List<ProblemMarkerFilterDesc> result = filtersCache.get(project); if (result == null) { result = new ArrayList<ProblemMarkerFilterDesc>(); for (ProblemMarkerFilterDesc filterDesc: filters) { if ( filterDesc.matches(project) ) { result.add(filterDesc); } } filtersCache.put(project, result); } return result; } }
Source:
<code>public void run(BatchActionContext batchActionContext) throws Exception { <START> conf.substituteMacros(batchActionContext); <END> if (!conf.shouldRun(batchActionContext)) { return; } int retries = 0; Exception exception = null; do { HttpURLConnection conn = null; Map<String, List<String>> headers = conf.parseRequestProperties(); try { URL url = new URL(conf.url); conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod(conf.method); conn.setConnectTimeout(conf.connectTimeoutMillis); for (Map.Entry<String, List<String>> propertyEntry : headers.entrySet()) { String propertyKey = propertyEntry.getKey(); for (String propertyValue : propertyEntry.getValue()) { conn.addRequestProperty(propertyKey, propertyValue); } } if (conf.body != null) { conn.setDoOutput(true); try (OutputStream outputStream = conn.getOutputStream()) { outputStream.write(conf.body.getBytes(Charsets.UTF_8)); } } LOG.info("Request to resulted in response code {}.", conf.url, conn.getResponseCode()); break; } catch (MalformedURLException | ProtocolException e) { throw new IllegalStateException("Error opening url connection. Reason: " + e.getMessage(), e); } catch (Exception e) { LOG.warn("Error making request to url with headers {}.", conf.method, conf.url, headers); exception = e; } finally { if (conn != null) { conn.disconnect(); } } retries++; } while (retries < conf.numRetries); if (exception != null) { throw exception; } }</code><technical_language>substituteMacros if run Batch Action</technical_language>

Target:
public void run(BatchActionContext batchActionContext) throws Exception { if (!conf.shouldRun(batchActionContext)) { return; } conf.substituteMacros(batchActionContext); int retries = 0; Exception exception = null; do { HttpURLConnection conn = null; Map<String, List<String>> headers = conf.parseRequestProperties(); try { URL url = new URL(conf.url); conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod(conf.method); conn.setConnectTimeout(conf.connectTimeoutMillis); for (Map.Entry<String, List<String>> propertyEntry : headers.entrySet()) { String propertyKey = propertyEntry.getKey(); for (String propertyValue : propertyEntry.getValue()) { conn.addRequestProperty(propertyKey, propertyValue); } } if (conf.body != null) { conn.setDoOutput(true); try (OutputStream outputStream = conn.getOutputStream()) { outputStream.write(conf.body.getBytes(Charsets.UTF_8)); } } LOG.info("Request to resulted in response code {}.", conf.url, conn.getResponseCode()); break; } catch (MalformedURLException | ProtocolException e) { throw new IllegalStateException("Error opening url connection. Reason: " + e.getMessage(), e); } catch (Exception e) { LOG.warn("Error making request to url with headers {}.", conf.method, conf.url, headers); exception = e; } finally { if (conn != null) { conn.disconnect(); } } retries++; } while (retries < conf.numRetries); if (exception != null) { throw exception; } }
Source:
<code>public void eventFilterApplied(TmfFilterAppliedSignal signal) { if (signal.getSource() == this) { return; } <START> Display.getDefault().syncExec(() -> { <END> ITmfFilter eventFilter = signal.getFilter().getEventFilter(); if (eventFilter == null) { fTable.setData(Key.SEARCH_OBJ, null); fTable.refresh(); } else { fTable.setData(Key.SEARCH_OBJ, eventFilter); fTable.refresh(); searchNext(); } }); }</code><technical_language>I this deadlock if unrelated code running in UI thread attempts broadcast a signal. caller broadcast signal UI thread</technical_language>

Target:
public void eventFilterApplied(TmfFilterAppliedSignal signal) { if (signal.getSource() == this) { return; } Runnable runnable = () -> { ITmfFilter eventFilter = signal.getFilter().getEventFilter(); if (eventFilter == null) { fTable.setData(Key.SEARCH_OBJ, null); fTable.refresh(); } else { fTable.setData(Key.SEARCH_OBJ, eventFilter); fTable.refresh(); searchNext(); } }; Display display = PlatformUI.getWorkbench().getDisplay(); if (display == Display.getCurrent()) { runnable.run(); } else { Display.getDefault().asyncExec(runnable); } }
Source:
<code>private void handleSchedWakeup(ITmfEvent event) { String host = event.getTrace().getHostId(); Integer cpu = NonNullUtils.checkNotNull(TmfTraceUtils.resolveIntEventAspectOfClassForEvent(event.getTrace(), TmfCpuAspect.class, event)); IKernelAnalysisEventLayout eventLayout = getProvider().getEventLayout(event.getTrace()); LttngSystemModel system = getProvider().getSystem(); Integer tid = EventField.getInt(event, eventLayout.fieldTid()); HostThread targetHt = new HostThread(host, tid); LttngWorker target = system.findWorker(targetHt); LttngWorker current = system.getWorkerOnCpu(host, cpu); <START> System.out.println("wakeup tid=" + tid); END> if (target == null) { String name = EventField.getOrDefault(event, eventLayout.fieldComm(), NonNullUtils.checkNotNull(Messages.TraceEventHandlerSched_UnknownThreadName)); target = new LttngWorker(targetHt, name, event.getTimestamp().getValue()); system.addWorker(target); target.setStatus(ProcessStatus.WAIT_BLOCKED); } ProcessStatus status = target.getStatus(); if ((current != null && target.getHostThread().equals(current.getHostThread())) || status == ProcessStatus.WAIT_CPU) { return; } if (status == ProcessStatus.WAIT_BLOCKED || status == ProcessStatus.WAIT_FORK || status == ProcessStatus.UNKNOWN) { target.setStatus(ProcessStatus.WAIT_CPU); return; } }</code><technical_language>forgot remove this</technical_language>

Target:
private void handleSchedWakeup(ITmfEvent event) { String host = event.getTrace().getHostId(); Integer cpu = NonNullUtils.checkNotNull(TmfTraceUtils.resolveIntEventAspectOfClassForEvent(event.getTrace(), TmfCpuAspect.class, event)); IKernelAnalysisEventLayout eventLayout = getProvider().getEventLayout(event.getTrace()); LttngSystemModel system = getProvider().getSystem(); Integer tid = EventField.getInt(event, eventLayout.fieldTid()); HostThread targetHt = new HostThread(host, tid); LttngWorker target = system.findWorker(targetHt); LttngWorker current = system.getWorkerOnCpu(host, cpu); if (target == null) { String name = EventField.getOrDefault(event, eventLayout.fieldComm(), NonNullUtils.checkNotNull(Messages.TraceEventHandlerSched_UnknownThreadName)); target = new LttngWorker(targetHt, name, event.getTimestamp().getValue()); system.addWorker(target); target.setStatus(ProcessStatus.WAIT_BLOCKED); } ProcessStatus status = target.getStatus(); if ((current != null && target.getHostThread().equals(current.getHostThread())) || status == ProcessStatus.WAIT_CPU) { return; } if (status == ProcessStatus.WAIT_BLOCKED || status == ProcessStatus.WAIT_FORK || status == ProcessStatus.UNKNOWN) { target.setStatus(ProcessStatus.WAIT_CPU); return; } }
Source:
<code>public void readComments(HttpServletRequest request, HttpServletResponse response, @PathVariable("doi") String doi) throws IOException { <START> ArticleIdentifier id = ArticleIdentifier.create(DoiEscaping.resolve(doi)); <END> commentCrudService.readComments(id).respond(request, response, entityGson); }</code><technical_language>move DoiEscaping.resolve(doi) logic ArticleIdentifier constructor (and other similar identifiers) for clarity</technical_language>

Target:
public void readComments(HttpServletRequest request, HttpServletResponse response, @PathVariable("doi") String doi) throws IOException { ArticleIdentifier id = ArticleIdentifier.create(DoiEscaping.unescape(doi)); commentCrudService.readComments(id).respond(request, response, entityGson); }
Source:
<code>protected void populateEntities(List<GuestId> entities, List<String> guestIds) { if (entities == null) { throw new IllegalArgumentException("the guestId model entity is null"); } if (guestIds == null) { throw new IllegalArgumentException("the list of guestId is null"); } for (String guestId : guestIds) { if (guestId == null) { continue; } <START> GuestIdDTO guestIdDTO = new GuestIdDTO().guestId(guestId); GuestId guestIdEntity = new GuestId(); populateEntity(guestIdEntity, guestIdDTO); <END> entities.add(guestIdEntity); } }</code><technical_language>is String guestId, is need create redundant GuestIdDTO objects, call populateEntity. eliminated need for DTOs, this is enough: entities.add(new GuestId(guestId));</technical_language>

Target:
protected void populateEntities(List<GuestId> entities, List<String> guestIds) { if (entities == null) { throw new IllegalArgumentException("the guestId model entity is null"); } if (guestIds == null) { throw new IllegalArgumentException("the list of guestId is null"); } for (String guestId : guestIds) { if (guestId == null) { continue; } entities.add(new GuestId(guestId)); } }
Source:
<code>public CacheConfig putCacheConfigIfAbsent(CacheConfig config) { CacheConfig cacheConfig = asCacheConfig(config); CacheConfigFuture future = new CacheConfigFuture(nodeEngine, cacheConfig); CacheConfigFuture localConfigFuture = configs.putIfAbsent(cacheConfig.getNameWithPrefix(), future); CacheConfig localConfig = localConfigFuture == null ? null : localConfigFuture.join(); if (localConfigFuture == null) { try { if (cacheConfig.isStatisticsEnabled()) { setStatisticsEnabled(cacheConfig, cacheConfig.getNameWithPrefix(), true); } if (cacheConfig.isManagementEnabled()) { setManagementEnabled(cacheConfig, cacheConfig.getNameWithPrefix(), true); } logger.info("Added cache config: " + cacheConfig); additionalCacheConfigSetup(null, config); } finally { <START> future.complete(); <END> } } else { additionalCacheConfigSetup(localConfig, config); } return localConfig; }</code><technical_language>thinking error case here. This future is meant provide ordering cache config initialization usage. caller of getCacheConfig a config assumes this initialization process succeeded. I behavior change previous EE method overridden this running putIfAbsent above. I some gaps here. If exception is thrown additionalCacheConfigSetup, get NPE obtaining WAN publisher for cache</technical_language>

Target:
public CacheConfig putCacheConfigIfAbsent(CacheConfig config) { CacheConfig cacheConfig = asCacheConfig(config); CacheConfigFuture future = new CacheConfigFuture(nodeEngine, cacheConfig); CacheConfigFuture localConfigFuture = configs.putIfAbsent(cacheConfig.getNameWithPrefix(), future); CacheConfig localConfig = localConfigFuture == null ? null : localConfigFuture.join(); if (localConfigFuture == null) { try { if (cacheConfig.isStatisticsEnabled()) { setStatisticsEnabled(cacheConfig, cacheConfig.getNameWithPrefix(), true); } if (cacheConfig.isManagementEnabled()) { setManagementEnabled(cacheConfig, cacheConfig.getNameWithPrefix(), true); } logger.info("Added cache config: " + cacheConfig); additionalCacheConfigSetup(config, false); future.complete(); } catch (Throwable e) { configs.remove(cacheConfig.getNameWithPrefix(), future); future.complete(e); throw rethrow(e); } } else { additionalCacheConfigSetup(localConfig, true); } return localConfig; }
Source:
<code>private static Stream<Class<?>> getClasses(String packageName) { ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); assert classLoader != null; String path = packageName.replace('.', '/'); Enumeration<URL> resources; try { resources = classLoader.getResources(path); } catch (IOException e) { return Stream.empty(); } List<File> dirs = new ArrayList<>(); while (resources.hasMoreElements()) { URL resource = resources.nextElement(); dirs.add(new File(resource.getFile())); } List<Class<?>> classes = new ArrayList<>(); <START> for (File directory : dirs) { <END> addClasses(classes, directory, packageName); } return classes.stream(); }</code><technical_language>Files.walkTree work here? a problem this a jar</technical_language>

Target:
private static Stream<Class<?>> getClasses(String packageName) { ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); assert classLoader != null; Enumeration<URL> resources; try { String path = packageName.replace('.', '/'); resources = classLoader.getResources(path); } catch (IOException e) { return Stream.empty(); } final List<Class<?>> result = new ArrayList<>(); while (resources.hasMoreElements()) { URL resource = resources.nextElement(); try { Files.walkFileTree(new File(resource.getFile()).toPath(), EnumSet.noneOf(FileVisitOption.class), 1, getClassFileVisitor(packageName, result)); } catch (IOException e) { e.printStackTrace(); } } return result.stream(); }
Source:
<code>protected Map<String, Object> createDefaultContext(Object root, ClassResolver classResolver) { ClassResolver resolver = classResolver; if (resolver == null) { resolver = container.getInstance(CompoundRootAccessor.class); } SecurityMemberAccess memberAccess = new SecurityMemberAccess(allowStaticMethodAccess, allowStaticFieldAccess); <START> if (devMode) { <END> LOG.warn("Working in devMode, ignoring internal security"); } else { memberAccess.setExcludedClasses(excludedClasses); memberAccess.setExcludedPackageNamePatterns(excludedPackageNamePatterns); memberAccess.setExcludedPackageNames(excludedPackageNames); memberAccess.setDisallowProxyMemberAccess(disallowProxyMemberAccess); } return Ognl.createDefaultContext(root, memberAccess, resolver, defaultConverter); }</code><technical_language>@lukaszlenart. Allowing devMode disable exclusion processing a nervous. For thing, _it produce confusion_ works fine locally devMode true fails due default exclusions devMode is false for a deployed version. running devMode potentially _riskier_ currently is exclusion mechanism set/active. If a developer wants access classes blocked exclusion mechanism (even in devMode), modify local development struts.xml configuration override/set "struts.excludedClasses, struts.excludedPackageNames, struts.excludedPackageNamePatterns" necessary for purpose. done testing remove override. a compromise in introducing a concept of "devMode.excludedClasses, devMode.excludedPackageNames, devMode.excludedPackageNamePatterns" ? in devMode exclusion lists instead of standard struts.excludedXXX ones, defaults slightly more relaxed standard restrictive ? allow some flexibility modes, allow for explicit restrictions in devMode (as restrictive permissive developer chooses) show is restricted. do</technical_language>

Target:
protected Map<String, Object> createDefaultContext(Object root, ClassResolver classResolver) { ClassResolver resolver = classResolver; if (resolver == null) { resolver = container.getInstance(CompoundRootAccessor.class); } SecurityMemberAccess memberAccess = new SecurityMemberAccess(allowStaticMethodAccess, allowStaticFieldAccess); memberAccess.setDisallowProxyMemberAccess(disallowProxyMemberAccess); if (devMode) { LOG.warn("Working in devMode, using devMode excluded classes and packages!"); memberAccess.setExcludedClasses(devModeExcludedClasses); memberAccess.setExcludedPackageNamePatterns(devModeExcludedPackageNamePatterns); memberAccess.setExcludedPackageNames(devModeExcludedPackageNames); } else { memberAccess.setExcludedClasses(excludedClasses); memberAccess.setExcludedPackageNamePatterns(excludedPackageNamePatterns); memberAccess.setExcludedPackageNames(excludedPackageNames); } return Ognl.createDefaultContext(root, memberAccess, resolver, defaultConverter); }
Source:
<code>public static ByteRange getByteRangeFromKey(MutableObject<String> keyHolder) { String key = keyHolder.getValue(); int j = key.lastIndexOf(BYTE_RANGE_SEP); int i = key.lastIndexOf(BYTE_RANGE_SEP, j - 1); if (j > 0) { try { long start = Long.parseLong(key.substring(i + 1, j)); long end = Long.parseLong(key.substring(j + 1)); keyHolder.setValue(key.substring(0, i)); return ByteRange.inclusive(start, end); } catch (NumberFormatException e) { <START> log.debug(e, e); <END> } } return null; }</code><technical_language>Is putting key in log message debugging</technical_language>

Target:
public static ByteRange getByteRangeFromKey(MutableObject<String> keyHolder) { String key = keyHolder.getValue(); int j = key.lastIndexOf(BYTE_RANGE_SEP); int i = key.lastIndexOf(BYTE_RANGE_SEP, j - 1); if (j > 0) { try { long start = Long.parseLong(key.substring(i + 1, j)); long end = Long.parseLong(key.substring(j + 1)); keyHolder.setValue(key.substring(0, i)); return ByteRange.inclusive(start, end); } catch (NumberFormatException e) { log.debug("Cannot parse byte range in key: {}", key, e); } } return null; }