auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void makeLocationQualified(Database database) throws HiveException { if (database.isSetLocationUri()) { database.setLocationUri(Utilities.getQualifiedPath(conf, new Path(database.getLocationUri()))); } else { Path path = new Path(HiveConf.getVar(conf, HiveConf.ConfVars.METASTOREWAREHOUSE), database.getName().toLowerCase() + DATABASE_PATH_SUFFIX); String qualifiedPath = Utilities.getQualifiedPath(conf, path); <START> database.setLocationUri(qualifiedPath); <END> } }</code><technical_language>please this method work based locationUri instead of some operation Database</technical_language>

Target:
private void makeLocationQualified(Database database) throws HiveException { if (database.isSetLocationUri()) { database.setLocationUri(Utilities.getQualifiedPath(context.getConf(), new Path(database.getLocationUri()))); } else { Path path = new Path(HiveConf.getVar(context.getConf(), HiveConf.ConfVars.METASTOREWAREHOUSE), database.getName().toLowerCase() + DATABASE_PATH_SUFFIX); String qualifiedPath = Utilities.getQualifiedPath(context.getConf(), path); database.setLocationUri(qualifiedPath); } }
Source:
<code><START> private void afterVMsRefreshTreatment() { <END> for (Guid vm_guid : _vmsToRerun) { log.errorFormat("Rerun vm {0}. Called from vds {1}", vm_guid, _vds.getName()); ResourceManager.getInstance().RerunFailedCommand(vm_guid, _vds.getId()); } for (Guid vm_guid : _succededToRunVms) { _vdsManager.succededToRunVm(vm_guid); } _autoVmsToRun.removeAll(_vmsToRerun); getVdsEventListener().runFailedAutoStartVMs(_autoVmsToRun); for (Entry<VM, VmDynamic> pair : _vmsClientIpChanged.entrySet()) { getVdsEventListener().processOnClientIpChange(_vds, pair.getValue().getId()); } for (VmDynamic runningVm : _poweringUpVms) { ResourceManager .getInstance() .getEventListener() .processOnVmPoweringUp(_vds.getId(), runningVm.getId(), runningVm.getDisplayIp(), runningVm.getDisplay()); } for (Guid vm_guid : _vmsMovedToDown) { getVdsEventListener().processOnVmStop(vm_guid); } for (Guid vm_guid : _vmsToRemoveFromAsync) { ResourceManager.getInstance().RemoveAsyncRunningVm(vm_guid); } }</code><technical_language>originally in try..catch needed anymore</technical_language>

Target:
private void afterVMsRefreshTreatment() { for (Guid vm_guid : _vmsToRerun) { log.errorFormat("Rerun vm {0}. Called from vds {1}", vm_guid, _vds.getName()); ResourceManager.getInstance().RerunFailedCommand(vm_guid, _vds.getId()); } for (Guid vm_guid : _succededToRunVms) { _vdsManager.succededToRunVm(vm_guid); } _autoVmsToRun.removeAll(_vmsToRerun); getVdsEventListener().runFailedAutoStartVMs(_autoVmsToRun); for (Entry<VM, VmDynamic> pair : _vmsClientIpChanged.entrySet()) { getVdsEventListener().processOnClientIpChange(_vds, pair.getValue().getId()); } for (VmDynamic runningVm : _poweringUpVms) { ResourceManager .getInstance() .getEventListener() .processOnVmPoweringUp(_vds.getId(), runningVm.getId(), runningVm.getDisplayIp(), runningVm.getDisplay()); } getVdsEventListener().processOnVmStop(_vmsMovedToDown); for (Guid vm_guid : _vmsToRemoveFromAsync) { ResourceManager.getInstance().RemoveAsyncRunningVm(vm_guid); } }
Source:
<code>public List<T> executeAsBlocking() { final GetResolver<T> getResolver; if (explicitGetResolver != null) { getResolver = explicitGetResolver; } else { final ContentResolverTypeMapping<T> typeMapping = storIOContentResolver.internal().typeMapping(type); if (typeMapping == null) { throw new IllegalStateException("This type does not have type mapping: " + "type = " + type + "," + <START> "ContentProvider was not affected by this operation, please add type mapping for this type"); <END> } getResolver = typeMapping.getResolver(); } final Cursor cursor = getResolver.performGet(storIOContentResolver, query); try { final int count = cursor.getCount(); if (count == 0) { return EMPTY_LIST; } else { final List<T> list = new ArrayList<T>(count); while (cursor.moveToNext()) { list.add(getResolver.mapFromCursor(cursor)); } return unmodifiableList(list); } } finally { cursor.close(); } }</code><technical_language>affect contentProvider query</technical_language>

Target:
public List<T> executeAsBlocking() { final GetResolver<T> getResolver; if (explicitGetResolver != null) { getResolver = explicitGetResolver; } else { final ContentResolverTypeMapping<T> typeMapping = storIOContentResolver.internal().typeMapping(type); if (typeMapping == null) { throw new IllegalStateException("This type does not have type mapping: " + "type = " + type + "," + "ContentProvider was not touched by this operation, please add type mapping for this type"); } getResolver = typeMapping.getResolver(); } final Cursor cursor = getResolver.performGet(storIOContentResolver, query); try { final int count = cursor.getCount(); if (count == 0) { return EMPTY_LIST; } else { final List<T> list = new ArrayList<T>(count); while (cursor.moveToNext()) { list.add(getResolver.mapFromCursor(cursor)); } return unmodifiableList(list); } } finally { cursor.close(); } }
Source:
<code>public String resolveEval(String toResolve) { String str = ""; try { if ((specfile == null || toResolve.equals("")) && toResolve.length() > 2 && toResolve.substring(2, toResolve.length() - 1).equals(name)) { return toResolve; } str = RPMQuery.eval(UiUtils.resolveDefines(specfile, toResolve)).trim(); } catch (CoreException e) { <START> SpecfileLog.logError("Unable to evaluate " + toResolve, e); END> } return str; }</code><technical_language>String externalized</technical_language>

Target:
public String resolveEval(String toResolve) { String str = ""; try { if ((specfile == null || toResolve.equals("")) && toResolve.length() > 2 && toResolve.substring(2, toResolve.length() - 1).equals(name)) { return toResolve; } str = RPMQuery.eval(UiUtils.resolveDefines(specfile, toResolve)).trim(); } catch (CoreException e) { SpecfileLog.logError(NLS.bind(Messages.getString("SpecfileElement_unableToResolve"), toResolve), e); } return str; }
Source:
<code>public OverspeedEventHandler() { globalSpeedLimit = Context.getConfig().getInteger("event.globalspeedlimit", 0); suppressRepeated = Context.getConfig().getLong("event.suppressrepeated", 60); try { Server server = Context.getDataManager().getServer(); String speedUnit = server.getSpeedUnit(); if (speedUnit != null) { switch (speedUnit) { <START> case "kmh" : globalSpeedLimit = UnitsConverter.knotsFromKph(globalSpeedLimit); <END> break; case "mph" : globalSpeedLimit = UnitsConverter.knotsFromMph(globalSpeedLimit); default : break; } } } catch (SQLException error) { Log.warning(error); } }</code><technical_language>config depend server settings. pick unit (probably km/h more sense)</technical_language>

Target:
public OverspeedEventHandler() { globalSpeedLimit = UnitsConverter.knotsFromKph(Context.getConfig().getInteger("event.globalSpeedLimit", 0)); suppressRepeated = Context.getConfig().getInteger("event.suppressRepeated", 60); }
Source:
<code>public BlobServiceAsyncClient buildAsyncClient() { Objects.requireNonNull(endpoint); final List<HttpPipelinePolicy> policies = new ArrayList<>(); if (configuration == null) { configuration = ConfigurationManager.getConfiguration(); } policies.add(new UserAgentPolicy(BlobConfiguration.NAME, BlobConfiguration.VERSION, configuration)); policies.add(new RequestIdPolicy()); policies.add(new AddDatePolicy()); if (sharedKeyCredential != null) { policies.add(new SharedKeyCredentialPolicy(sharedKeyCredential)); } else if (tokenCredential != null) { policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, String.format("%s/.default", endpoint))); } else if (sasTokenCredential != null) { policies.add(new SASTokenCredentialPolicy(sasTokenCredential)); } policies.add(new RequestRetryPolicy(retryOptions)); HttpPolicyProviders.addBeforeRetryPolicies(policies); <START> policies.addAll(this.policies); <END> HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(logLevel)); HttpPipeline pipeline = new HttpPipelineBuilder() .policies(policies.toArray(new HttpPipelinePolicy[0])) .httpClient(httpClient) .build(); return new BlobServiceAsyncClient(new AzureBlobStorageBuilder() .url(endpoint) .pipeline(pipeline) .build()); }</code><technical_language>rename this.policies this.customerPolicies? This method is hard follow lists called "policies"</technical_language>

Target:
public BlobServiceAsyncClient buildAsyncClient() { Objects.requireNonNull(endpoint); final List<HttpPipelinePolicy> policies = new ArrayList<>(); if (configuration == null) { configuration = ConfigurationManager.getConfiguration(); } policies.add(new UserAgentPolicy(BlobConfiguration.NAME, BlobConfiguration.VERSION, configuration)); policies.add(new RequestIdPolicy()); policies.add(new AddDatePolicy()); if (sharedKeyCredential != null) { policies.add(new SharedKeyCredentialPolicy(sharedKeyCredential)); } else if (tokenCredential != null) { policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, String.format("%s/.default", endpoint))); } else if (sasTokenCredential != null) { policies.add(new SASTokenCredentialPolicy(sasTokenCredential)); } HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(new RequestRetryPolicy(retryOptions)); policies.addAll(this.additionalPolicies); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(logLevel)); HttpPipeline pipeline = new HttpPipelineBuilder() .policies(policies.toArray(new HttpPipelinePolicy[0])) .httpClient(httpClient) .build(); return new BlobServiceAsyncClient(new AzureBlobStorageBuilder() .url(endpoint) .pipeline(pipeline) .build()); }
Source:
<code>public SetOperatorPropertyEvent(String operatorName, String propertyName, String propertyValue) { <START> super(operatorName, LogLevel.INFO); <END> this.propertyName = propertyName; this.propertyValue = propertyValue; }</code><technical_language>this(...,..., LogLevel.INFO); apply pattern other constructors</technical_language>

Target:
public SetOperatorPropertyEvent(String operatorName, String propertyName, String propertyValue) { this(operatorName, propertyName, propertyValue, LogLevel.INFO); }
Source:
<code>public void testMatchSingleReg() throws Throwable { final String exprString = "=$esp"; final String[] children = new String[] { "esp" }; SyncUtil.runToLocation("foo"); MIStoppedEvent stoppedEvent = SyncUtil.step(5, StepType.STEP_OVER); IFrameDMContext frameDmc = SyncUtil.getStackFrame(stoppedEvent.getDMContext(), 0); final IExpressionDMContext exprDmc = SyncUtil.createExpression(frameDmc, exprString); checkChildrenCount(exprDmc, 1); <START> checkChildrenCount(exprDmc, children.length); <END> }</code><technical_language>I checks identical, 'checkChildren()' instead, right</technical_language>

Target:
public void testMatchSingleReg() throws Throwable { final String exprString = "=$esp"; final String[] children = new String[] { "$esp" }; SyncUtil.runToLocation("foo"); MIStoppedEvent stoppedEvent = SyncUtil.step(5, StepType.STEP_OVER); IFrameDMContext frameDmc = SyncUtil.getStackFrame(stoppedEvent.getDMContext(), 0); final IExpressionDMContext exprDmc = SyncUtil.createExpression(frameDmc, exprString); checkChildren(exprDmc, -1, -1, children); checkChildrenCount(exprDmc, children.length); }
Source:
<code><START> private Set<String> getNetworkLocations(Set<Node> bookieNodes) { <END> Set<String> networkLocs = new HashSet<String>(); for (Node bookieNode : bookieNodes) { networkLocs.add(bookieNode.getNetworkLocation()); } return networkLocs; }</code><technical_language>static</technical_language>

Target:
private static Set<String> getNetworkLocations(Set<Node> bookieNodes) { Set<String> networkLocs = new HashSet<>(); for (Node bookieNode : bookieNodes) { networkLocs.add(bookieNode.getNetworkLocation()); } return networkLocs; }
Source:
<code>public CompletableFuture<T> get(DataFetchingEnvironment environment) { return CompletableFuture.supplyAsync(() -> wrappedDataFetcher.get(environment)); <START> } <END></code><technical_language>In principle I aspects of this PR accept is a ForkJoinPool ability for some another ExecutorService. code Threading ability control underlying ExecutorService is super important. Managing threadlocals security managers important some some people (it is Atlassian I work) need a inject ExecutorService mix. For example notice graphql.execution.ExecutorServiceExecutionStrategy takes executor service say. This is done for reason. this code require ExecutorService, default ForkJoinPool.defaultPool() static methods ExecutorService</technical_language>

Target:
public CompletableFuture<T> get(DataFetchingEnvironment environment) { return CompletableFuture.supplyAsync(() -> wrappedDataFetcher.get(environment), executor); }
Source:
<code>private void testGeneralQuestionOperations() throws Exception { testCancelNewOrEditQuestion(); testNewQuestionLink(); testInputValidationForQuestion(); testAddQuestionAction(); testEditQuestionLink(); testEditQuestionAction(); <START> testEditVisibilityAction(); <END> testGetQuestionLink(); testCopyQuestion(); testChangeFeedbackRecipient(); testEditQuestionNumberAction(); testAjaxOnVisibilityMessageButton(); testDeleteQuestionAction(2); testDeleteQuestionAction(1); testEditNonExistentQuestion(); }</code><technical_language>check, is else in this file edit visibility of question</technical_language>

Target:
private void testGeneralQuestionOperations() throws Exception { testCancelNewOrEditQuestion(); testNewQuestionLink(); testInputValidationForQuestion(); testAddQuestionAction(); testEditQuestionLink(); testEditQuestionAction(); testGetQuestionLink(); testCopyQuestion(); testChangeFeedbackRecipient(); testEditQuestionNumberAction(); testAjaxOnVisibilityMessageButton(); testDeleteQuestionAction(2); testDeleteQuestionAction(1); testEditNonExistentQuestion(); testResponseRate(); }
Source:
<code>public synchronized IOException enterErrorState(final IOException ex) { Preconditions.checkArgument(ex != null, "Null exception"); switch (state) { case Open: case Closed: <START> exception = ex; <END> state = State.Error; break; case Error: break; } return exception; }</code><technical_language>making reasoning this correctly. if call resulted in a state transition check returned exception is reference-equality I passed in</technical_language>

Target:
public synchronized IOException enterErrorState(final IOException ex) { Preconditions.checkArgument(ex != null, "Null exception"); switch (state.get()) { case Open: case Closed: exception = ex; state.set(State.Error); break; case Error: break; } return exception; }
Source:
<code>private boolean isUserSearchUsingTags() { return getSearchObjectStr() != null <START> && getSearchObjectStr().equals(SearchObjects.VDC_USER_OBJ_NAME) <END> && origText.contains("vm"); }</code><technical_language>If revert operands in condition, remove null check: return SearchObjects.VDC_USER_OBJ_NAME.equals(getSearchObjectStr()) && origText.contains("vm");</technical_language>

Target:
private boolean isUserSearchUsingTags() { return SearchObjects.VDC_USER_OBJ_NAME.equals(getSearchObjectStr()) && origText.contains("vm"); }
Source:
<code>public void onMessage(HTTPCarbonMessage httpResponseMessage) { Util.setupTransferEncodingForResponse(httpResponseMessage, requestDataHolder); sourceContext.channel().eventLoop().execute(() -> { boolean connectionCloseAfterResponse = shouldConnectionClose(httpResponseMessage); if (HTTPTransportContextHolder.getInstance().getHandlerExecutor() != null) { HTTPTransportContextHolder.getInstance().getHandlerExecutor() .executeAtSourceResponseReceiving(httpResponseMessage); } final HttpResponse response = Util .createHttpResponse(httpResponseMessage, connectionCloseAfterResponse); sourceContext.write(response); httpResponseMessage.getHttpContentAsync().setMessageListener(httpContent -> this.sourceContext.channel().eventLoop().execute(() -> { <START> if (httpContent instanceof LastHttpContent) { <END> ChannelFuture future = sourceContext.writeAndFlush(httpContent); if (connectionCloseAfterResponse) { future.addListener(ChannelFutureListener.CLOSE); } if (HTTPTransportContextHolder.getInstance().getHandlerExecutor() != null) { HTTPTransportContextHolder.getInstance().getHandlerExecutor(). executeAtSourceResponseSending(httpResponseMessage); } } else { sourceContext.write(httpContent); } })); }); Util.prepareBuiltMessageForTransfer(httpResponseMessage); }</code><technical_language>Move this logic a separate private function, "isLastHTTPContent". This logic in multiple places, a single common place is useful consistent everywhere</technical_language>

Target:
public void onMessage(HTTPCarbonMessage httpResponseMessage) { Util.setupTransferEncodingForResponse(httpResponseMessage, requestDataHolder); sourceContext.channel().eventLoop().execute(() -> { boolean connectionCloseAfterResponse = shouldConnectionClose(httpResponseMessage); if (handlerExecutor != null) { handlerExecutor.executeAtSourceResponseReceiving(httpResponseMessage); } final HttpResponse response = Util .createHttpResponse(httpResponseMessage, connectionCloseAfterResponse); sourceContext.write(response); httpResponseMessage.getHttpContentAsync().setMessageListener(httpContent -> this.sourceContext.channel().eventLoop().execute(() -> { if (Util.isLastHttpContent(httpContent)) { ChannelFuture future = sourceContext.writeAndFlush(httpContent); if (connectionCloseAfterResponse) { future.addListener(ChannelFutureListener.CLOSE); } if (handlerExecutor != null) { handlerExecutor.executeAtSourceResponseSending(httpResponseMessage); } } else { sourceContext.write(httpContent); } })); }); Util.prepareBuiltMessageForTransfer(httpResponseMessage); }
Source:
<code>private static boolean isVisibleEventColumn(TableColumn column) { if (column.getData(Key.ASPECT) == TmfMarginColumn.MARGIN_ASPECT) { return false; } <START> return (column.getResizable() && column.getWidth() > 0); <END> }</code><technical_language>This is equivalent</technical_language>

Target:
private static boolean isVisibleEventColumn(TableColumn column) { if (column.getData(Key.ASPECT) == TmfMarginColumn.MARGIN_ASPECT) { return false; } return (!column.getResizable() && column.getWidth() == 0); }
Source:
<code>public LayerMemoryReport getMemoryReport(InputType inputType) { InputType outputType = getOutputType(-1, inputType); int numParams = initializer().numParams(this); int updaterStateSize = (int) getIUpdater().stateSize(numParams); int trainSizeFixed = 0; int trainSizeVariable = 0; <START> if (getDropOut() > 0) { <END> if (false) { trainSizeVariable += 0; } else { trainSizeVariable += inputType.arrayElementsPerExample(); } } trainSizeVariable += outputType.arrayElementsPerExample(); return new LayerMemoryReport.Builder(layerName, ElementWiseMultiplicationLayer.class, inputType, outputType) .standardMemory(numParams, updaterStateSize) .workingMemory(0, 0, trainSizeFixed, trainSizeVariable) .cacheMemory(MemoryReport.CACHE_MODE_ALL_ZEROS, MemoryReport.CACHE_MODE_ALL_ZEROS) .build(); }</code><technical_language>Method longer exists. Replace condition if (getIDropout() != null) {</technical_language>

Target:
public LayerMemoryReport getMemoryReport(InputType inputType) { InputType outputType = getOutputType(-1, inputType); int numParams = initializer().numParams(this); int updaterStateSize = (int) getIUpdater().stateSize(numParams); int trainSizeFixed = 0; int trainSizeVariable = 0; if (getIDropout() != null) { if (false) { trainSizeVariable += 0; } else { trainSizeVariable += inputType.arrayElementsPerExample(); } } trainSizeVariable += outputType.arrayElementsPerExample(); return new LayerMemoryReport.Builder(layerName, ElementWiseMultiplicationLayer.class, inputType, outputType) .standardMemory(numParams, updaterStateSize) .workingMemory(0, 0, trainSizeFixed, trainSizeVariable) .cacheMemory(MemoryReport.CACHE_MODE_ALL_ZEROS, MemoryReport.CACHE_MODE_ALL_ZEROS) .build(); }
Source:
<code>public ConcurAccountInfo findAccountingInfoForCashAdvanceLine(ConcurStandardAccountingExtractDetailLine cashAdvanceLine, List<ConcurStandardAccountingExtractDetailLine> saeLines) { LOG.debug("findAccountingInfoForCashAdvanceLine, entering"); ConcurAccountInfo info = new ConcurAccountInfo(); String cashAdvanceReportEntryId = cashAdvanceLine.getReportEntryId(); if (LOG.isDebugEnabled()) { LOG.debug("findAccountingInfoForCashAdvanceLine, cashAdvanceReportEntryId: " + cashAdvanceReportEntryId); } for (ConcurStandardAccountingExtractDetailLine line : saeLines) { if (StringUtils.equalsIgnoreCase(line.getReportEntryId(), cashAdvanceReportEntryId) && !isCashAdvanceLine(line)) { if (LOG.isDebugEnabled()) { LOG.debug("findAccountingInfoForCashAdvanceLine, setting accountNumber to " + line.getAccountNumber() + " and chart to " + line.getChartOfAccountsCode()); } <START> info.setAccountNumber(line.getAccountNumber()); <END> info.setChart(line.getChartOfAccountsCode()); break; } } return info; }</code><technical_language>do need set subAccount, object code, object code, orgRefId project code here</technical_language>

Target:
public ConcurAccountInfo findAccountingInfoForCashAdvanceLine(ConcurStandardAccountingExtractDetailLine cashAdvanceLine, List<ConcurStandardAccountingExtractDetailLine> saeLines) { LOG.debug("findAccountingInfoForCashAdvanceLine, entering"); ConcurAccountInfo info = new ConcurAccountInfo(); String cashAdvanceReportEntryId = cashAdvanceLine.getReportEntryId(); if (LOG.isDebugEnabled()) { LOG.debug("findAccountingInfoForCashAdvanceLine, cashAdvanceReportEntryId: " + cashAdvanceReportEntryId); } for (ConcurStandardAccountingExtractDetailLine line : saeLines) { if (StringUtils.equalsIgnoreCase(line.getReportEntryId(), cashAdvanceReportEntryId) && !isCashAdvanceLine(line)) { info.setChart(line.getChartOfAccountsCode()); info.setAccountNumber(line.getAccountNumber()); info.setSubAccountNumber(line.getSubAccountNumber()); info.setObjectCode(line.getJournalAccountCode()); info.setSubObjectCode(line.getSubObjectCode()); info.setProjectCode(line.getProjectCode()); info.setOrgRefId(line.getOrgRefId()); if (LOG.isDebugEnabled()) { LOG.debug("findAccountingInfoForCashAdvanceLine, returning Concur account info: " + info.toString()); } break; } } return info; }
Source:
<code>boolean systemConditionsAvailable() { if (ActivityLifecycleHandler.curActivity == null) { <START> OneSignal.onesignalLog(OneSignal.LOG_LEVEL.DEBUG, "OSSystemConditionObserver curActivity null"); <END> return false; } if (isDialogFragmentVisible(ActivityLifecycleHandler.curActivity)) { OneSignal.onesignalLog(OneSignal.LOG_LEVEL.DEBUG, "OSSystemConditionObserver dialog fragment detected"); return false; } boolean keyboardUp = OSViewUtils.isKeyboardUp(new WeakReference<>(ActivityLifecycleHandler.curActivity)); if (keyboardUp) { ActivityLifecycleHandler.setSystemConditionObserver(TAG, systemConditionObserver); OneSignal.onesignalLog(OneSignal.LOG_LEVEL.DEBUG, "OSSystemConditionObserver keyboard up detected"); } return !keyboardUp; }</code><technical_language>Change WARNING explain IAMs shown</technical_language>

Target:
boolean systemConditionsAvailable() { if (ActivityLifecycleHandler.curActivity == null) { OneSignal.onesignalLog(OneSignal.LOG_LEVEL.WARN, "OSSystemConditionObserver curActivity null"); return false; } if (isDialogFragmentShowing(ActivityLifecycleHandler.curActivity)) { OneSignal.onesignalLog(OneSignal.LOG_LEVEL.WARN, "OSSystemConditionObserver dialog fragment detected"); return false; } boolean keyboardUp = OSViewUtils.isKeyboardUp(new WeakReference<>(ActivityLifecycleHandler.curActivity)); if (keyboardUp) { ActivityLifecycleHandler.setSystemConditionObserver(TAG, systemConditionObserver); OneSignal.onesignalLog(OneSignal.LOG_LEVEL.WARN, "OSSystemConditionObserver keyboard up detected"); } return !keyboardUp; }
Source:
<code>public PageForm(final String themeId, final String title, final String hostId, final TemplateLayout layout, final Map<String, ContainerUUIDChanged> changes, Map<String, String> newlyContainersUUID) { this.themeId = themeId; this.title = title; this.hostId = hostId; this.layout = layout; this.changes = ImmutableMap.<String, ContainerUUIDChanged> builder().putAll(changes).build(); <START> this.newlyContainersUUID = ImmutableMap.<String, String> builder().putAll(newlyContainersUUID).build(); <END> }</code><technical_language>ImmutableMap.copyOf (newlyContainersUUID); easier</technical_language>

Target:
public PageForm(final String themeId, final String title, final String hostId, final TemplateLayout layout, final Map<String, ContainerUUIDChanged> changes, Map<String, String> newlyContainersUUID) { this.themeId = themeId; this.title = title; this.hostId = hostId; this.layout = layout; this.changes = ImmutableMap.<String, ContainerUUIDChanged> builder().putAll(changes).build(); this.newlyContainersUUID = ImmutableMap.copyOf(newlyContainersUUID); }
Source:
<code>protected void openIntentChooser() throws ActivityNotFoundException { Activity activity = this.reactContext.getCurrentActivity(); if (activity == null) { TargetChosenReceiver.sendCallback(false, "Something went wrong"); return; } Intent chooser; IntentSender intentSender = null; if (TargetChosenReceiver.isSupported()) { intentSender = TargetChosenReceiver.getSharingSenderIntent(this.reactContext); chooser = Intent.createChooser(this.getIntent(), this.chooserTitle, intentSender); } else { chooser = Intent.createChooser(this.getIntent(), this.chooserTitle); } chooser.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY); if (ShareIntent.hasValidKey("showAppsToView", options) && ShareIntent.hasValidKey("url", options)) { Intent viewIntent = new Intent(Intent.ACTION_VIEW); viewIntent.setType(this.fileShare.getType()); Intent[] viewIntents = this.getIntentsToViewFile(viewIntent, this.fileShare.getURI()); chooser.putExtra(Intent.EXTRA_INITIAL_INTENTS, viewIntents); } <START> if (ShareIntent.hasValidKey("excludedActivityTypes", options)) { <END> activity.startActivityForResult(excludeChooserIntent(this.getIntent(),options), RNShareModule.SHARE_REQUEST_CODE); } else { activity.startActivityForResult(chooser, RNShareModule.SHARE_REQUEST_CODE); } if (intentSender == null) { TargetChosenReceiver.sendCallback(true, true, "OK"); } }</code><technical_language>suggestion if (ShareIntent.hasValidKey("excludedActivityTypes", options)) {</technical_language>

Target:
protected void openIntentChooser() throws ActivityNotFoundException { Activity activity = this.reactContext.getCurrentActivity(); if (activity == null) { TargetChosenReceiver.sendCallback(false, "Something went wrong"); return; } Intent chooser; IntentSender intentSender = null; if (TargetChosenReceiver.isSupported()) { intentSender = TargetChosenReceiver.getSharingSenderIntent(this.reactContext); chooser = Intent.createChooser(this.getIntent(), this.chooserTitle, intentSender); } else { chooser = Intent.createChooser(this.getIntent(), this.chooserTitle); } chooser.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY); if (ShareIntent.hasValidKey("showAppsToView", options) && ShareIntent.hasValidKey("url", options)) { Intent viewIntent = new Intent(Intent.ACTION_VIEW); viewIntent.setType(this.fileShare.getType()); Intent[] viewIntents = this.getIntentsToViewFile(viewIntent, this.fileShare.getURI()); chooser.putExtra(Intent.EXTRA_INITIAL_INTENTS, viewIntents); } if (ShareIntent.hasValidKey("excludedActivityTypes", options)) { if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N) { chooser.putExtra(Intent.EXTRA_EXCLUDE_COMPONENTS, options.getArray("excludedActivityTypes").toString()); activity.startActivityForResult(chooser, RNShareModule.SHARE_REQUEST_CODE); }else { activity.startActivityForResult(excludeChooserIntent(this.getIntent(),options), RNShareModule.SHARE_REQUEST_CODE); } } else { activity.startActivityForResult(chooser, RNShareModule.SHARE_REQUEST_CODE); } if (intentSender == null) { TargetChosenReceiver.sendCallback(true, true, "OK"); } }
Source:
<code>public Collection<Team> getCurrentTeams(Authentication auth) { <START> User currentUser = (User) auth.getPrincipal(); <END> return teamService.getTeamsByEmail(currentUser.getEmail()); }</code><technical_language>I plug in User a method argument. @MatthijsKok figured this out somewhere. a Class field method in this Controller needs User object</technical_language>

Target:
public Collection<Team> getCurrentTeams(Authentication auth) { User currentUser = (User) auth.getPrincipal(); return teamService.getTeamsByMemberEmail(currentUser.getEmail()); }
Source:
<code>protected void doExtraDependenciesProcessing(T o) { for (Dependency dependency : dependencies) { try { Field field = ClassReflection.getDeclaredField(o.getClass(), dependency.getField()); field.setAccessible(true); String fileValue = (String) field.get(o); if (fileValue != null) { assets.addDependency(fileValue, dependency.getClazz()); } } catch (ReflectionException e) { <START> e.printStackTrace(); <END> } } }</code><technical_language>Exceptions logged Gdx.app.error</technical_language>

Target:
protected void doExtraDependenciesProcessing(T o) { for (Dependency dependency : dependencies) { try { Field field = ClassReflection.getDeclaredField(o.getClass(), dependency.getField()); field.setAccessible(true); String fileValue = (String) field.get(o); if (fileValue != null) { assets.addDependency(fileValue, dependency.getClazz()); } } catch (ReflectionException e) { Gdx.app.error( "SimpleSerializer", "Reflection exception on #doExtraDependenciesProcessing: Object class=" + o.getClass() + " List of dependencies=" + Dependency .dependencyListToString(dependencies), e); } } }
Source:
<code>public static QueryInfo parseQuery(String sql) { Pattern insertIntoSqlPattern = Pattern.compile("insert into (.*) (select .* from (.*))", Pattern.CASE_INSENSITIVE); Matcher m = insertIntoSqlPattern.matcher(sql); if (!m.matches()) { throw new SamzaException("Invalid query format"); } Planner planner = createPlanner(); SqlNode sqlNode; try { sqlNode = planner.parse(sql); } catch (SqlParseException e) { throw new SamzaException(e); } String outputSource; String selectQuery; ArrayList<String> inputSources; if (sqlNode instanceof SqlInsert) { SqlInsert sqlInsert = ((SqlInsert) sqlNode); outputSource = sqlInsert.getTargetTable().toString(); if (sqlInsert.getSource() instanceof SqlSelect) { SqlSelect sqlSelect = (SqlSelect) sqlInsert.getSource(); selectQuery = m.group(2); <START> inputSources = getInputFromSelectQuery(sqlSelect); <END> } else { throw new SamzaException("Sql query is not of the expected format"); } } else { throw new SamzaException("Sql query is not of the expected format"); } return new QueryInfo(selectQuery, inputSources, outputSource); }</code><technical_language>minor nit: Do change name of function getInputs..</technical_language>

Target:
public static QueryInfo parseQuery(String sql) { Pattern insertIntoSqlPattern = Pattern.compile("insert into (.*) (select .* from (.*))", Pattern.CASE_INSENSITIVE); Matcher m = insertIntoSqlPattern.matcher(sql); if (!m.matches()) { throw new SamzaException("Invalid query format"); } Planner planner = createPlanner(); SqlNode sqlNode; try { sqlNode = planner.parse(sql); } catch (SqlParseException e) { throw new SamzaException(e); } String outputSource; String selectQuery; ArrayList<String> inputSources; if (sqlNode instanceof SqlInsert) { SqlInsert sqlInsert = ((SqlInsert) sqlNode); outputSource = sqlInsert.getTargetTable().toString(); if (sqlInsert.getSource() instanceof SqlSelect) { SqlSelect sqlSelect = (SqlSelect) sqlInsert.getSource(); selectQuery = m.group(2); inputSources = getInputsFromSelectQuery(sqlSelect); } else { throw new SamzaException("Sql query is not of the expected format"); } } else { throw new SamzaException("Sql query is not of the expected format"); } return new QueryInfo(selectQuery, inputSources, outputSource); }
Source:
<code>protected void executeCommand() { Guid macPoolId = getParameters().getId(); MacPool macPool = macPoolPerCluster.getMacPoolById(macPoolId, getContext()); org.ovirt.engine.core.common.businessentities.MacPool dbMacPool = macPoolDao.get(macPoolId); Collection<Pair<String, String>> dbRangePairs = <START> dbMacPool.getRanges() <END> .stream() .map(range -> new Pair<>(range.getMacFrom(), range.getMacTo())) .collect(Collectors.toList()); getReturnValue().setActionReturnValue(macPool.getAvailableMacsFromAllRanges(dbRangePairs)); getReturnValue().setSucceeded(true); }</code><technical_language>this null? e.g. null macPoolId</technical_language>

Target:
protected void executeCommand() { Guid macPoolId = getParameters().getId(); MacPool macPool = macPoolPerCluster.getMacPoolById(macPoolId, getContext()); org.ovirt.engine.core.common.businessentities.MacPool dbMacPool = macPoolDao.get(macPoolId); getReturnValue().setActionReturnValue(macPool.getAvailableMacsFromAllRanges(dbMacPool.getRanges())); getReturnValue().setSucceeded(true); }
Source:
<code>public void hflush() throws IOException { <START> hsync(); <END> }</code><technical_language>need put this flag, especially if want back-port older GCS connector versions. enable default in master branch though</technical_language>

Target:
public void hflush() throws IOException { long startTimeNs = System.nanoTime(); if (!options.isSyncOnFlushEnabled()) { logger.atWarning().log( "hflush(): No-op: readers will *not* yet see flushed data for %s", finalGcsPath); throwIfNotOpen(); return; } if (syncRateLimiter == null || syncRateLimiter.tryAcquire()) { logger.atFine().log("hflush() uses hsync() for %s", finalGcsPath); hsyncInternal(startTimeNs); return; } logger.atWarning().log( "hflush(): No-op due to rate limit (%s): readers will *not* yet see flushed data for %s", syncRateLimiter, finalGcsPath); throwIfNotOpen(); }
Source:
<code>private LockService createStickyLockService() throws InterruptedException { AtomicLong lockToken = new AtomicLong(0); <START> ConcurrentHashSet<LockRequest> requestedLocks = new ConcurrentHashSet<>(); <END> LockService stickyLockService = mock(LockService.class); doAnswer((invocation) -> { LockRequest request = (LockRequest) invocation.getArguments()[1]; if (requestedLocks.add(request)) { return new LockRefreshToken(BigInteger.valueOf(lockToken.getAndIncrement()), 1L); } else { return null; } }).when(stickyLockService).lock(any(), any()); return stickyLockService; }</code><technical_language>nit: I declare Set<LockRequest></technical_language>

Target:
private TimelockService createStickyLockService() throws InterruptedException { AtomicLong lockToken = new AtomicLong(0); Set<LockDescriptor> requestedLocks = new ConcurrentHashSet<>(); TimelockService stickyLockService = mock(TimelockService.class); doAnswer((invocation) -> { LockRequest request = (LockRequest) invocation.getArguments()[0]; if (requestedLocks.add(Iterables.getOnlyElement(request.getLockDescriptors()))) { return (LockResponse) () -> Optional.of(LockToken.of(new UUID(lockToken.getAndIncrement(), 0L))); } else { return (LockResponse) Optional::empty; } }).when(stickyLockService).lock(any()); return stickyLockService; }
Source:
<code>public void populateOptions(WidgetConfig config, CodedWidget widget) { List<PatientDataDefinition> l = null; String tag = config.getAttributeValue("tag", null); if (tag != null) { l = Context.getService(PatientDataService.class).getDefinitionsByTag(tag); } else { l = Context.getService(PatientDataService.class).getAllDefinitions(false); } for (PersonDataDefinition d : Context.getService(PersonDataService.class).getAllDefinitions(false)) { if (!isJoined(d)) { PatientDataDefinition pd = new PersonToPatientDataDefinition(d); <START> Context.getService(PatientDataService.class).saveDefinition(pd); <END> l.add(pd); } } for (PatientDataDefinition d : l) { widget.addOption(new Option(d.getUuid(), d.getName(), null, d), config); } }</code><technical_language>This need saved (and saved explicitly in database). This saved appropriately data definition data definition is saved</technical_language>

Target:
public void populateOptions(WidgetConfig config, CodedWidget widget) { List<PatientDataDefinition> l = null; String tag = config.getAttributeValue("tag", null); if (tag != null) { l = Context.getService(PatientDataService.class).getDefinitionsByTag(tag); } else { l = Context.getService(PatientDataService.class).getAllDefinitions(false); } for (PatientDataDefinition d : l) { widget.addOption(new Option(d.getUuid(), d.getName(), null, d), config); } for (PersonDataDefinition d : Context.getService(PersonDataService.class).getAllDefinitions(false)) { if (!isJoined(d)) { widget.addOption(new Option(d.getUuid(), d.getName(), null, d), config); } } }
Source:
<code>private Segment getAdapter(final DataSegment segment) throws SegmentLoadingException { final Segment adapter; <START> synchronized (segmentLoader) { <END> try { adapter = segmentLoader.getSegment(segment); } catch (SegmentLoadingException e) { segmentLoader.cleanup(segment); throw e; } } if (adapter == null) { throw new SegmentLoadingException("Null adapter from loadSpec[%s]", segment.getLoadSpec()); } return adapter; }</code><technical_language>This is synchronization - parallel segment loading impossible</technical_language>

Target:
private Segment getAdapter(final DataSegment segment) throws SegmentLoadingException { final Segment adapter; try { adapter = segmentLoader.getSegment(segment); } catch (SegmentLoadingException e) { segmentLoader.cleanup(segment); throw e; } if (adapter == null) { throw new SegmentLoadingException("Null adapter from loadSpec[%s]", segment.getLoadSpec()); } return adapter; }
Source:
<code>public static List<String> filterDataOnRetentionHCat(int time, String interval, String dataType, DateTime endDate, List<String> inputData) throws JAXBException { String locationType = ""; String appender = ""; DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyy/MM/dd/HH/mm"); List<String> finalData = new ArrayList<String>(); if (dataType.equalsIgnoreCase("monthly")) { appender = "/01/00/01"; } else if (locationType .equalsIgnoreCase("daily")) { <START> appender = "/01"; END> } else if (locationType .equalsIgnoreCase("hourly")) { appender = "/01"; } else if (locationType.equalsIgnoreCase("yearly")) { appender = "/01/01/00/01"; } formatter.print(endDate); String startLimit = ""; if (interval.equalsIgnoreCase("minutes")) { startLimit = formatter.print(new DateTime(endDate, DateTimeZone.UTC).minusMinutes(time)); } else if (interval.equalsIgnoreCase("hours")) { startLimit = formatter.print(new DateTime(endDate, DateTimeZone.UTC).minusHours(time)); } else if (interval.equalsIgnoreCase("days")) { startLimit = formatter.print(new DateTime(endDate, DateTimeZone.UTC).minusDays(time)); } else if (interval.equalsIgnoreCase("months")) { startLimit = formatter.print(new DateTime(endDate, DateTimeZone.UTC).minusDays(31 * time)); } for (String testDate : inputData) { if (!testDate.equalsIgnoreCase("somethingRandom")) { if ((testDate + appender).compareTo(startLimit) > 0) { finalData.add(testDate); } } else { finalData.add(testDate); } } return finalData; }</code><technical_language>sholdnt this appender /00/01</technical_language>

Target:
public static List<String> filterDataOnRetentionHCat(int time, String interval, String dataType, DateTime endDate, List<String> inputData) throws JAXBException { String locationType = ""; String appender = ""; DateTime today; DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyy/MM/dd/HH/mm"); List<String> finalData = new ArrayList<String>(); if (dataType.equalsIgnoreCase("monthly")) { appender = "/01/00/01"; } else if (locationType .equalsIgnoreCase("daily")) { appender = "/01"; } else if (locationType .equalsIgnoreCase("hourly")) { appender = "/01"; } else if (locationType.equalsIgnoreCase("yearly")) { appender = "/01/01/00/01"; } formatter.print(endDate); String startLimit = ""; today = new DateTime(endDate, DateTimeZone.UTC); if (interval.equalsIgnoreCase("minutes")) { startLimit = formatter.print(today.minusMinutes(time)); } else if (interval.equalsIgnoreCase("hours")) { startLimit = formatter.print(today.minusHours(time)); } else if (interval.equalsIgnoreCase("days")) { startLimit = formatter.print(today.minusDays(time)); } else if (interval.equalsIgnoreCase("months")) { startLimit = formatter.print(today.minusDays(31 * time)); } for (String testDate : inputData) { if (!testDate.equalsIgnoreCase("somethingRandom")) { if ((testDate + appender).compareTo(startLimit) > 0) { finalData.add(testDate); } } else { finalData.add(testDate); } } return finalData; }
Source:
<code>@Override public <T> T service(String name) { if (!enterBusy()) return null; try { ctx.security().authorize(name, SecurityPermission.SERVICE_INVOKE, null); Collection<ServiceContextImpl> ctxs = serviceContexts(name); <START> if (F.isEmpty(ctxs)) <END> return null; synchronized (ctxs) { for (ServiceContextImpl ctx : ctxs) { Service srvc = ctx.service(); if (srvc != null) return (T)srvc; } return null; } } finally { leaveBusy(); } }</code><technical_language>This check happen synchronization. a done in GridServiceProcessor</technical_language>

Target:
@Override public <T> T service(String name) { if (!enterBusy()) return null; try { ctx.security().authorize(name, SecurityPermission.SERVICE_INVOKE, null); Collection<ServiceContextImpl> ctxs = serviceContexts(name); if (ctxs == null) return null; synchronized (ctxs) { if (F.isEmpty(ctxs)) return null; for (ServiceContextImpl ctx : ctxs) { Service srvc = ctx.service(); if (srvc != null) return (T)srvc; } return null; } } finally { leaveBusy(); } }
Source:
<code>public RepositoryFile getFile(String filePath, Integer projectId, String ref) throws GitLabApiException { if (isApiVersion(ApiVersion.V3)) { return (getFileV3(filePath, projectId, ref)); } Form form = new Form(); addFormParam(form, "ref", ref, true); Response response = get(Response.Status.OK, form.asMap(), <START> "projects", projectId, "repository", "files", urlEncodeForPath(filePath)); <END> return (response.readEntity(RepositoryFile.class)); }</code><technical_language>Change urlEncode(filePath) fix AbstractApi.urlEncode(String s)</technical_language>

Target:
public RepositoryFile getFile(String filePath, Integer projectId, String ref) throws GitLabApiException { if (isApiVersion(ApiVersion.V3)) { return (getFileV3(filePath, projectId, ref)); } Form form = new Form(); addFormParam(form, "ref", ref, true); Response response = get(Response.Status.OK, form.asMap(), "projects", projectId, "repository", "files", urlEncode(filePath)); return (response.readEntity(RepositoryFile.class)); }
Source:
<code>public void testEndToEnd() throws IOException { final File tempFile = File.createTempFile("IntervalListWriterTest.", ".interval_list"); tempFile.deleteOnExit(); final IntervalList expectedList = new IntervalList(this.dict); expectedList.add(new Interval("chr1", 50, 150)); expectedList.add(new Interval("chr1", 150, 250)); expectedList.add(new Interval("chr2", 50, 150)); expectedList.add(new Interval("chr3", 50, 150)); expectedList.add(new Interval("chr1", 50, 150, true, "number-5")); expectedList.add(new Interval("chr1", 150, 250, false, "number-6")); final IntervalListWriter writer = new IntervalListWriter(tempFile, new SAMFileHeader(this.dict)); for (final Interval interval : expectedList.getIntervals()) { writer.write(interval); } writer.close(); final IntervalList actualList = IntervalList.fromFile(tempFile); <START> Assert.assertEquals( <END> actualList.getIntervals(), expectedList.getIntervals() ); }</code><technical_language>This assert header is correct well</technical_language>

Target:
public void testEndToEnd() throws IOException { final File tempFile = File.createTempFile("IntervalListWriterTest.", ".interval_list"); tempFile.deleteOnExit(); final IntervalList expectedList = new IntervalList(this.dict); expectedList.add(new Interval("chr1", 50, 150)); expectedList.add(new Interval("chr1", 150, 250)); expectedList.add(new Interval("chr2", 50, 150)); expectedList.add(new Interval("chr3", 50, 150)); expectedList.add(new Interval("chr1", 50, 150, true, "number-5")); expectedList.add(new Interval("chr1", 150, 250, false, "number-6")); final IntervalListWriter writer = new IntervalListWriter(tempFile.toPath(), new SAMFileHeader(this.dict)); for (final Interval interval : expectedList.getIntervals()) { writer.write(interval); } writer.close(); final IntervalList actualList = IntervalList.fromFile(tempFile); final SAMSequenceDictionary actualDict = actualList.getHeader().getSequenceDictionary(); final SAMSequenceDictionary expectedDict = expectedList.getHeader().getSequenceDictionary(); Assert.assertTrue(actualDict.isSameDictionary(expectedDict)); Assert.assertEquals( actualList.getIntervals(), expectedList.getIntervals() ); }
Source:
<code>public void onActivityResult(int requestCode, int resultCode, Intent intent) { if (requestCode == REQUEST_FILE) { if (resultCode == RESULT_OK && intent != null) { Uri uri = intent.getData(); String filePath = UriToFilePath.getPathFromUri(CommCareApplication.instance(), uri); if (filePath != null) { File f = new File(filePath); if (f != null && f.exists()) { mEditText.setText(filePath); } else { <START> Toast.makeText(getActivity(), "File does not exit", Toast.LENGTH_SHORT).show(); <END> } } } else { Toast.makeText(getActivity(), "No file selected...", Toast.LENGTH_SHORT).show(); } } }</code><technical_language>This string added android_translatable_strings instead of hard-coded. a small typo here- "exit" "exist"</technical_language>

Target:
public void onActivityResult(int requestCode, int resultCode, Intent intent) { if (requestCode == REQUEST_FILE) { if (resultCode == RESULT_OK && intent != null) { Uri uri = intent.getData(); String filePath = UriToFilePath.getPathFromUri(CommCareApplication.instance(), uri); validateFile(filePath); } else { Toast.makeText(getActivity(), Localization.get("file.not.selected"), Toast.LENGTH_LONG).show(); } } }
Source:
<code>public ClientAuthProvider newProvider(ClientConnectionPeer connection, AuthCallbacks.GenericCallback<Void> completeCb) { return new ClientAuthProvider() { @Override public void process(AuthToken m, AuthCallbacks.GenericCallback<AuthToken> cb) { } @Override public void close() { closeCountersOnConnections.incrementAndGet(); } <START> <END> public void init(AuthCallbacks.GenericCallback<AuthToken> cb) { initCountersOnConnections.incrementAndGet(); completeCb.operationComplete(BKException.Code.OK, null); } }; }</code><technical_language>do need '@Override' here</technical_language>

Target:
public ClientAuthProvider newProvider(ClientConnectionPeer connection, AuthCallbacks.GenericCallback<Void> completeCb) { return new ClientAuthProvider() { @Override public void process(AuthToken m, AuthCallbacks.GenericCallback<AuthToken> cb) { } @Override public void close() { closeCountersOnConnections.incrementAndGet(); } @Override public void init(AuthCallbacks.GenericCallback<AuthToken> cb) { initCountersOnConnections.incrementAndGet(); completeCb.operationComplete(BKException.Code.OK, null); } }; }
Source:
<code>public String getBlobUrl() { if (!this.isSnapshot()) { return azureBlobStorage.getUrl(); } else { <START> return String.format("%s?snapshot=%s", azureBlobStorage.getUrl(), snapshot); <END> } }</code><technical_language>a check query parameters attached URL, check for a ? I is a reserved URL character</technical_language>

Target:
public String getBlobUrl() { if (!this.isSnapshot()) { return azureBlobStorage.getUrl(); } else { if (azureBlobStorage.getUrl().contains("?")) { return String.format("%s&snapshot=%s", azureBlobStorage.getUrl(), snapshot); } else { return String.format("%s?snapshot=%s", azureBlobStorage.getUrl(), snapshot); } } }