auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void validate_shouldFailIfStartDateTimeIsBeforeBirthDateWhereBirthDateIsNotEstimated() { Calendar calendar = Calendar.getInstance(); Visit visit = new Visit(); visit.setVisitType(visitService.getVisitType(1)); visit.setPatient(Context.getPatientService().getPatient(2)); Patient p = visit.getPatient(); p.setBirthdate(calendar.getTime()); calendar.set(2000, 9,8); visit.setStartDatetime(calendar.getTime()); assertTrue("BirthDate Cannot be after visit startDateTime for same patient", p.getBirthdate().after(visit.getStartDatetime()) && !p.getBirthdateEstimated()); }

Target:
public void validate_shouldFailIfStartDateTimeIsBeforeBirthDateWhereBirthDateIsNotEstimated() { Calendar calendar = Calendar.getInstance(); Visit visit = new Visit(); visit.setPatient(Context.getPatientService().getPatient(2)); visit.getPatient().setBirthdate(calendar.getTime()); calendar.set(2000, 9,8); visit.setStartDatetime(calendar.getTime()); Errors errors = new BindException(visit, "visit"); new VisitValidator().validateBirthDate(visit, errors); assertEquals(true, errors.hasFieldErrors("startDatetime")); }
Source:
public RecoveryApplier getRecoveryApplier( TransactionApplicationMode mode ) throws Exception { transactionsToApply = new TransactionQueue( 100, ( first, last ) -> storageEngine.apply( first, mode ) ); return new RecoveryVisitor( transactionsToApply ); }

Target:
public RecoveryApplier getRecoveryApplier( TransactionApplicationMode mode ) throws Exception { return new RecoveryVisitor( new TransactionQueue( 100, ( first, last ) -> storageEngine.apply( first, mode ) ) ); }
Source:
public Response updateChargeStatus(@PathParam("chargeId") String chargeId, Map newStatusMap) { if (invalidInput(newStatusMap)) { return fieldsMissingResponse(ImmutableList.of(NEW_STATUS)); } String chargeStatusString = newStatusMap.get(NEW_STATUS).toString(); if (!ChargeStatus.isValid(chargeStatusString)) { String msg = "charge status not recognized: " + chargeStatusString; logger.error(msg); return badRequestResponse(msg); } ChargeStatus newChargeStatus = ChargeStatus.fromString(newStatusMap.get(NEW_STATUS).toString()); if (!isValidStateTransition(newChargeStatus)) { return getInvalidStatusResponse(chargeId, newChargeStatus); } return chargeService.updateFromInitialStatus(chargeId, newChargeStatus) .map(chargeEntity -> Response.noContent().build()) .orElseGet(() -> getInvalidStatusResponse(chargeId, newChargeStatus)); }

Target:
public Response updateChargeStatus(@PathParam("chargeId") String chargeId, Map newStatusMap) { if (invalidInput(newStatusMap)) { return fieldsMissingResponse(ImmutableList.of(NEW_STATUS)); } ChargeStatus newChargeStatus; try { newChargeStatus = ChargeStatus.fromString(newStatusMap.get(NEW_STATUS).toString()); } catch (IllegalArgumentException e) { logger.error(e.getMessage(), e); return badRequestResponse(e.getMessage()); } if (!isValidStateTransition(newChargeStatus)) { return getInvalidStatusResponse(chargeId, newChargeStatus); } return chargeService.updateFromInitialStatus(chargeId, newChargeStatus) .map(chargeEntity -> Response.noContent().build()) .orElseGet(() -> getInvalidStatusResponse(chargeId, newChargeStatus)); }
Source:
public void testLocalTime() throws Exception { Session localSession = testSessionBuilder() .setSystemProperty("legacy_timestamp", "false") .setTimeZoneKey(TIME_ZONE_KEY) .setStartTime(new DateTime(2017, 3, 1, 10, 0, 0, 0, DateTimeZone.UTC).getMillis()) .build(); FunctionAssertions localAssertion = new FunctionAssertions(localSession); localAssertion.assertFunctionString("LOCALTIME", TimeType.TIME, "15:45:00.000"); }

Target:
public void testLocalTime() throws Exception { Session localSession = testSessionBuilder() .setSystemProperty("legacy_timestamp", "false") .setTimeZoneKey(TIME_ZONE_KEY) .setStartTime(new DateTime(2017, 3, 1, 10, 0, 0, 0, DateTimeZone.UTC).getMillis()) .build(); FunctionAssertions localAssertion = new FunctionAssertions(localSession); localAssertion.assertFunctionString("LOCALTIME", TimeType.TIME, "14:30:00.000"); }
Source:
public CacheContent build(HttpCacheServletResponseWrapper responseWrapper) throws HttpCacheDataStreamException { this.status = responseWrapper.getStatus(); this.charEncoding = responseWrapper.getCharacterEncoding(); this.contentType = responseWrapper.getContentType(); List<String> headerNames = new ArrayList<String>(); headerNames.addAll(responseWrapper.getHeaderNames()); for (String headerName: headerNames) { List<String> values = new ArrayList<String>(); values.addAll(responseWrapper.getHeaders(headerName)); headers.put(headerName, values); } this.tempSink = responseWrapper.getTempSink(); this.dataInputStream = responseWrapper.getTempSink().createInputStream(); this.writeMethod = responseWrapper.getWriteMethod(); return this; }

Target:
public CacheContent build(HttpCacheServletResponseWrapper responseWrapper) throws HttpCacheDataStreamException { Map<String, List<String>> extractedHeaders = responseWrapper.getHeaderNames().stream().collect( Collectors.toMap(headerName -> headerName, headerName -> new ArrayList<>(responseWrapper.getHeaders(headerName) ) )); return build(responseWrapper, responseWrapper.getStatus(), responseWrapper.getCharacterEncoding(), responseWrapper. getContentType(), extractedHeaders); }
Source:
private void deleteTempPacksIdx() { Path packDir = Paths.get(repo.getObjectsDirectory().getAbsolutePath(), "pack"); Instant threshold = Instant.now().minus(1, ChronoUnit.DAYS); try { Files.newDirectoryStream(packDir, "gc_*_tmp") .forEach(t -> { try { Instant lastModified = Files.getLastModifiedTime(t) .toInstant(); if (lastModified.isBefore(threshold)) { Files.deleteIfExists(t); } } catch (IOException e) { LOG.error(e.getMessage(), e); } }); } catch (IOException e) { LOG.error(e.getMessage(), e); } }

Target:
private void deleteTempPacksIdx() { Path packDir = repo.getObjectDatabase().getPackDirectory().toPath(); Instant threshold = Instant.now().minus(1, ChronoUnit.DAYS); try { Files.newDirectoryStream(packDir, "gc_*_tmp") .forEach(t -> { try { Instant lastModified = Files.getLastModifiedTime(t) .toInstant(); if (lastModified.isBefore(threshold)) { Files.deleteIfExists(t); } } catch (IOException e) { LOG.error(e.getMessage(), e); } }); } catch (IOException e) { LOG.error(e.getMessage(), e); } }
Source:
public MessageInfo(StoreKey key, long size, boolean deleted, boolean ttlUpdated, long expirationTimeInMs, short accountId, short containerId, long operationTimeMs) { this(key, size, deleted, ttlUpdated, expirationTimeInMs, null, accountId, containerId, operationTimeMs, (short) -1); }

Target:
public MessageInfo(StoreKey key, long size, boolean deleted, boolean ttlUpdated, long expirationTimeInMs, short accountId, short containerId, long operationTimeMs) { this(key, size, deleted, ttlUpdated, false, expirationTimeInMs, null, accountId, containerId, operationTimeMs, (short) 0); }
Source:
private static EventFiringWebDriver getChromeInstance() { String chromeBinaryName; String OSName = System.getProperty("os.name").toUpperCase(); if (OSName.contains("WINDOWS")) { chromeBinaryName = "chromedriver.exe"; File chromeBinary = new File ( "." + File.separator + "src" + File.separator + "test" + File.separator + "resources" + File.separator + "ChromeDriver" + File.separator + chromeBinaryName ); System.setProperty("webdriver.chrome.driver", chromeBinary.getAbsolutePath()); } if (browserName.equals("CHROMEMOBILE")) { ChromeOptions options = new ChromeOptions(); options.addArguments( "--user-agent="+ "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) " + "AppleWebKit/420+ (KHTML, like Gecko) " + "Version/3.0 Mobile/1A543a Safari/419.3" ); return new EventFiringWebDriver(new ChromeDriver(options)); } return new EventFiringWebDriver(new ChromeDriver(caps)); }

Target:
private static EventFiringWebDriver getChromeInstance() { String chromeBinaryName; String OSName = System.getProperty("os.name").toUpperCase(); if (OSName.contains("WINDOWS")) { chromeBinaryName = "chromedriver.exe"; File chromeBinary = new File ( "." + File.separator + "src" + File.separator + "test" + File.separator + "resources" + File.separator + "ChromeDriver" + File.separator + chromeBinaryName ); System.setProperty("webdriver.chrome.driver", chromeBinary.getAbsolutePath()); } if (browserName.equals("CHROMEMOBILE")) { chromeOptions.addArguments( "--user-agent=" + userAgentRegistry.getUserAgent("iPhone") ); return new EventFiringWebDriver(new ChromeDriver(chromeOptions)); } return new EventFiringWebDriver(new ChromeDriver(caps)); }
Source:
private Runnable insertNewDraft(final CodeMirror cm) { if (!Gerrit.isSignedIn()) { return new Runnable() { @Override public void run() { Gerrit.doSignIn(getToken()); } }; } return new Runnable() { public void run() { LineHandle handle = cm.getActiveLine(); int line = cm.getLineNumber(handle); CommentBox box = lineActiveBoxMap.get(handle); if (box == null) { lineActiveBoxMap.put(handle, addDraftBox(CommentInfo.createRange( path, getSideFromCm(cm), line + 1, null, null, cm.somethingSelected() ? CommentRange.create(cm.getSelectedRange()) : null))); } else if (box instanceof DraftBox) { ((DraftBox) box).setEdit(true); } else { ((PublishedBox) box).doReply(); } } }; }

Target:
private Runnable insertNewDraft(final CodeMirror cm) { if (!Gerrit.isSignedIn()) { return new Runnable() { @Override public void run() { Gerrit.doSignIn(getToken()); } }; } return new Runnable() { public void run() { LineHandle handle = cm.getActiveLine(); int line = cm.getLineNumber(handle); CommentBox box = lineActiveBoxMap.get(handle); FromTo fromTo = cm.getSelectedRange(); if (cm.somethingSelected()) { lineActiveBoxMap.put(handle, addNewDraft(cm, line, fromTo.getTo().getLine() == line ? fromTo : null)); } else if (box == null) { lineActiveBoxMap.put(handle, addNewDraft(cm, line, null)); } else if (box instanceof DraftBox) { ((DraftBox) box).setEdit(true); } else { ((PublishedBox) box).doReply(); } } }; }
Source:
public void stop(Runnable callback) { AggregatingCallback aggregatingCallback = new AggregatingCallback(this.integrationComponents.size(), callback); for (Object component : integrationComponents.keySet()) { if (component instanceof SmartLifecycle) { SmartLifecycle lifecycle = (SmartLifecycle) component; if (lifecycle.isRunning()) { lifecycle.stop(aggregatingCallback); continue; } } aggregatingCallback.run(); } this.running = false; }

Target:
public void stop(Runnable callback) { AggregatingCallback aggregatingCallback = new AggregatingCallback(this.integrationComponents.size(), callback); for (Object component : this.integrationComponents.keySet()) { if (component instanceof SmartLifecycle) { SmartLifecycle lifecycle = (SmartLifecycle) component; if (lifecycle.isRunning()) { lifecycle.stop(aggregatingCallback); continue; } } aggregatingCallback.run(); } this.running = false; }
Source:
public Response setEnabled(@HeaderParam(HttpHeaders.ACCEPT_LANGUAGE) String language, @PathParam("thingUID") @ApiParam(value = "thing") String thingUID, @ApiParam(value = "enabled") String enabled) throws IOException { final Locale locale = LocaleUtil.getLocale(language); ThingUID thingUIDObject = new ThingUID(thingUID); Thing thing = thingRegistry.get(thingUIDObject); if (null == thing) { logger.info("Received HTTP PUT request for disable thing at '{}' for the unknown thing '{}'.", uriInfo.getPath(), thingUID); return getThingNotFoundResponse(thingUID); } if (managedThingProvider.get(thingUIDObject) == null) { logger.info("Received HTTP PUT request for update configuration at '{}' for an unmanaged thing '{}'.", uriInfo.getPath(), thingUID); return getThingResponse(Status.CONFLICT, thing, locale, "Cannot update Thing " + thingUID + " as it is not editable."); } if(thingManager == null) { return getThingResponse(Status.INTERNAL_SERVER_ERROR, thing, locale, "Cannot edit Thing " + thingUID + " for unknown reasons."); } thingManager.enableThing(thingUIDObject, Boolean.valueOf(enabled)); return getThingResponse(Status.OK, thing, locale, null); }

Target:
public Response setEnabled(@HeaderParam(HttpHeaders.ACCEPT_LANGUAGE) String language, @PathParam("thingUID") @ApiParam(value = "thing") String thingUID, @ApiParam(value = "enabled") String enabled) throws IOException { final Locale locale = localeService.getLocale(language); ThingUID thingUIDObject = new ThingUID(thingUID); Thing thing = thingRegistry.get(thingUIDObject); if (null == thing) { logger.info("Received HTTP PUT request for set enabled at '{}' for the unknown thing '{}'.", uriInfo.getPath(), thingUID); return getThingNotFoundResponse(thingUID); } thingManager.setEnabled(thingUIDObject, Boolean.valueOf(enabled)); return getThingResponse(Status.OK, thing, locale, null); }
Source:
public void testGetActiveReivew() { ReviewBehavior activeReview = new ReviewBehavior(null) { @Override public IStatus addTopic(IReviewItem fileItem, ITopic topic, IProgressMonitor monitor) { return null; } @Override public IFileRevision getFileRevision(IFileVersion reviewFileRevision) { return null; } }; ReviewUi.setActiveReview(activeReview); assertEquals(activeReview, ReviewUi.getActiveReview()); }

Target:
public void testGetActiveReivew() { ReviewBehavior activeReview = new ReviewBehavior(null) { @Override public IStatus addTopic(IReviewItem fileItem, ITopic topic, IProgressMonitor monitor) { return null; } @Override public IFileRevision getFileRevision(IFileVersion reviewFileVersion) { return null; } }; ReviewUi.setActiveReview(activeReview); assertEquals(activeReview, ReviewUi.getActiveReview()); }
Source:
public void testThatParsingErrorsIsNicelyReported() throws Exception { try { new Cucumber(LexerErrorFeature.class); fail("Expecting error"); } catch (CucumberException e) { assertThat(e.getCause().toString(), containsString("gherkin.ParserException$CompositeParserException: Parser errors:")); } }

Target:
public void testThatParsingErrorsIsNicelyReported() throws Exception { thrownException.expectCause(isA(CompositeParserException.class)); new Cucumber(LexerErrorFeature.class); }
Source:
public void closeIndex(String storageId, String repositoryId, String path) throws IOException { logger.debug("Removing " + storageId + ":" + repositoryId + ":" + path + "..."); Storage storage = getConfiguration().getStorage(storageId); Repository repository = storage.getRepository(repositoryId); RepositoryPath repositoryPath = resolve(repository).resolve(path); closeIndex(repositoryPath); }

Target:
public void closeIndex(String storageId, String repositoryId, String path) throws IOException { logger.debug("Closing " + storageId + ":" + repositoryId + ":" + path + "..."); Storage storage = getConfiguration().getStorage(storageId); Repository repository = storage.getRepository(repositoryId); RepositoryPath repositoryPath = resolve(repository).resolve(path); closeIndex(repositoryPath); }
Source:
public boolean addParent(Set<Context> contexts, Subject parent) { contexts = ImmutableSet.copyOf(contexts); while (true) { Map.Entry<String, String> newEnt = new AbstractMap.SimpleEntry<String, String>(parent.getContainingCollection().getIdentifier(), parent.getIdentifier()); List<Map.Entry<String, String>> oldParents = parents.get(contexts); List<Map.Entry<String, String>> newParents = ImmutableList.<Map.Entry<String, String>>builder() .addAll(oldParents == null ? Collections.<Map.Entry<String, String>>emptyList() : oldParents) .add(newEnt) .build(); if (oldParents != null && oldParents.contains(newEnt)) { return false; } if (updateCollection(parents, contexts, oldParents, newParents)) { return true; } } }

Target:
public boolean addParent(Set<Context> contexts, Subject parent) { contexts = ImmutableSet.copyOf(contexts); while (true) { Map.Entry<String, String> newEnt = Maps.immutableEntry(parent.getContainingCollection().getIdentifier(), parent.getIdentifier()); List<Map.Entry<String, String>> oldParents = parents.get(contexts); List<Map.Entry<String, String>> newParents = ImmutableList.<Map.Entry<String, String>>builder() .addAll(oldParents == null ? Collections.<Map.Entry<String, String>>emptyList() : oldParents) .add(newEnt) .build(); if (oldParents != null && oldParents.contains(newEnt)) { return false; } if (updateCollection(parents, contexts, oldParents, newParents)) { return true; } } }
Source:
private Mono<ShouldRetryResult> shouldRetryQueryPlanAndAddress() { if (this.queryplanAddressRefreshCount++ > MAX_QUERYPLAN_ADDRESS_RETRY_COUNT) { logger .warn("shouldRetryQueryPlanAndAddress() Not retrying. Retry count = {}", this.serviceUnavailableRetryCount); return Mono.just(ShouldRetryResult.noRetry()); } logger .warn("shouldRetryQueryPlanAndAddress() Retrying on endpoint {}, operationType = {}, count = {}", this.locationEndpoint, operationType, this.queryplanAddressRefreshCount); Duration retryDelay = Duration.ZERO; return Mono.just(ShouldRetryResult.retryAfter(retryDelay)); }

Target:
private Mono<ShouldRetryResult> shouldRetryQueryPlanAndAddress() { if (this.queryPlanAddressRefreshCount++ > MAX_QUERY_PLAN_AND_ADDRESS_RETRY_COUNT) { logger .warn( "shouldRetryQueryPlanAndAddress() No more retrying on endpoint {}, operationType = {}, count = {}, " + "isAddressRefresh = {}", this.locationEndpoint, this.request.getOperationType(), this.queryPlanAddressRefreshCount, this.request.isAddressRefresh()); return Mono.just(ShouldRetryResult.noRetry()); } logger .warn("shouldRetryQueryPlanAndAddress() Retrying on endpoint {}, operationType = {}, count = {}, " + "isAddressRefresh = {}", this.locationEndpoint, this.request.getOperationType(), this.queryPlanAddressRefreshCount, this.request.isAddressRefresh()); Duration retryDelay = Duration.ZERO; return Mono.just(ShouldRetryResult.retryAfter(retryDelay)); }
Source:
public static void afterClass() throws Exception { if (sLocalAlluxioJobCluster != null) { sLocalAlluxioJobCluster.stop(); } sFileSystem.close(); }

Target:
public static void afterClass() throws Exception { if (sLocalAlluxioJobCluster != null) { sLocalAlluxioJobCluster.stop(); } }
Source:
SafeServerShutdownToolConfig(VerifiableProperties verifiableProperties) { hardwareLayoutFilePath = verifiableProperties.getString("hardware.layout.file.path", ""); partitionLayoutFilePath = verifiableProperties.getString("partition.layout.file.path", ""); hostname = verifiableProperties.getString("hostname", "localhost"); port = verifiableProperties.getIntInRange("port", 6667, 1, 65535); logGrowthPauseLagThresholdBytes = verifiableProperties.getLongInRange("log.growth.pause.lag.threshold.bytes", 20 * 1024 * 1024, 0, Long.MAX_VALUE); timeoutSecs = verifiableProperties.getLongInRange("timeout.secs", Long.MAX_VALUE, 0, Long.MAX_VALUE); }

Target:
SafeServerShutdownToolConfig(VerifiableProperties verifiableProperties) { hardwareLayoutFilePath = verifiableProperties.getString("hardware.layout.file.path", ""); partitionLayoutFilePath = verifiableProperties.getString("partition.layout.file.path", ""); hostname = verifiableProperties.getString("hostname", "localhost"); port = verifiableProperties.getIntInRange("port", Integer.valueOf(DEFAULT_PORT_STRING), Utils.MIN_PORT_NUM, Utils.MAX_PORT_NUM); logGrowthPauseLagThresholdBytes = verifiableProperties.getLongInRange("log.growth.pause.lag.threshold.bytes", DEFAULT_LOG_GROWTH_PAUSE_THRESHOLD, 0, Long.MAX_VALUE); timeoutSecs = verifiableProperties.getLongInRange("timeout.secs", Long.MAX_VALUE, 0, Long.MAX_VALUE); checkRepeatDelaySecs = verifiableProperties.getLongInRange("check.repeat.delay.secs", Long.valueOf(DEFAULT_CHECK_REPEAT_DELAY_SECS_STRING), 0, Long.MAX_VALUE); }
Source:
protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) { String title = sign.getLine(1) + " " + sign.getLine(2) + " " + sign.getLine(3); if (title.trim().isEmpty()) { title = tl("disposal"); } player.getBase().openInventory(ess.getServer().createInventory(player.getBase(), 36, title.trim())); return true; }

Target:
protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) { String title = (sign.getLine(1) + " " + sign.getLine(2) + " " + sign.getLine(3)).trim(); if (title.isEmpty()) { title = tl("disposal"); } player.getBase().openInventory(ess.getServer().createInventory(player.getBase(), 36, title)); return true; }
Source:
public ListenableFuture<?> reserveMemory(String allocationTag, long delta, boolean enforceBroadcastMemoryLimit) { if (enforceBroadcastMemoryLimit) { updateBroadcastMemoryFunction.accept(delta); } return reserveMemoryFunction.apply(allocationTag, delta); }

Target:
public ListenableFuture<?> reserveMemory(String allocationTag, long delta, boolean enforceBroadcastMemoryLimit) { ListenableFuture<?> future = reserveMemoryFunction.apply(allocationTag, delta); if (enforceBroadcastMemoryLimit) { updateBroadcastMemoryFunction.accept(delta); } return future; }
Source:
public Map<?, ListenableFuture<Void>> execute(String group, int count, Template template, Set<NodeMetadata> goodNodes, Map<NodeMetadata, Exception> badNodes, Multimap<NodeMetadata, CustomizationResponse> customizationResponses) { AzureTemplateOptions options = template.getOptions().as(AzureTemplateOptions.class); ResourceGroupApi resourceGroupApi = api.getResourceGroupApi(); ResourceGroup resourceGroup = resourceGroupApi.get(azureGroupName); final String location = template.getLocation().getId(); if (resourceGroup == null){ final Map<String, String> tags = ImmutableMap.of("description", "jClouds managed VMs"); resourceGroupApi.create(azureGroupName, location, tags).name(); } this.vnetName = this.azureGroupName + "virtualnetwork"; this.subnetName = this.azureGroupName + "subnet"; if (options.getVirtualNetworkName() != null) { this.vnetName = options.getVirtualNetworkName(); } this.getOrCreateVirtualNetworkWithSubnet(this.vnetName, this.subnetName, location, options); Map<?, ListenableFuture<Void>> responses = super.execute(group, count, template, goodNodes, badNodes, customizationResponses); return responses; }

Target:
public Map<?, ListenableFuture<Void>> execute(String group, int count, Template template, Set<NodeMetadata> goodNodes, Map<NodeMetadata, Exception> badNodes, Multimap<NodeMetadata, CustomizationResponse> customizationResponses) { String azureGroupName = this.azureComputeConstants.azureResourceGroup(); AzureTemplateOptions options = template.getOptions().as(AzureTemplateOptions.class); ResourceGroupApi resourceGroupApi = api.getResourceGroupApi(); ResourceGroup resourceGroup = resourceGroupApi.get(azureGroupName); final String location = template.getLocation().getId(); if (resourceGroup == null){ final Map<String, String> tags = ImmutableMap.of("description", "jClouds managed VMs"); resourceGroupApi.create(azureGroupName, location, tags).name(); } String vnetName = azureGroupName + "virtualnetwork"; String subnetName = azureGroupName + "subnet"; if (options.getVirtualNetworkName() != null) { vnetName = options.getVirtualNetworkName(); } this.getOrCreateVirtualNetworkWithSubnet(vnetName, subnetName, location, options, azureGroupName); Map<?, ListenableFuture<Void>> responses = super.execute(group, count, template, goodNodes, badNodes, customizationResponses); return responses; }
Source:
public String getCommandScript() { return "".equals(largeScriptContent) ? largeScriptContent : getTxtOutput().getText(); }

Target:
public String getCommandScript() { return largeScriptContentSet ? largeScriptContent : getTxtOutput().getText(); }
Source:
public static BandwidthLimit detectBandwidthLimits(FredPluginBandwidthIndicator bwIndicator) throws Exception { if (bwIndicator == null) throw new Exception("The node does not have a bandwidthIndicator."); int downstreamBits = bwIndicator.getDownstreamMaxBitRate(); int upstreamBits = bwIndicator.getUpstramMaxBitRate(); Logger.normal(bwIndicator, "bandwidthIndicator reports downstream " + downstreamBits + " bits/s and upstream "+upstreamBits+" bits/s."); if (downstreamBits < 0 || upstreamBits < 0) throw new Exception("Reported unavailable."); final int KiB = 8192; if (downstreamBits < 8*KiB) throw new Exception("Detected downstream of "+downstreamBits+" bits/s is nonsensically slow, ignoring."); if (upstreamBits < KiB) throw new Exception("Detected upstream of "+upstreamBits+" bits/s is nonsensically slow, ignoring."); int downstreamBytes = downstreamBits/8; int upstreamBytes = upstreamBits/8; return new BandwidthLimit(downstreamBytes, upstreamBytes, "bandwidthDetected", false); }

Target:
public static BandwidthLimit detectBandwidthLimits(FredPluginBandwidthIndicator bwIndicator) throws PluginNotFoundException, IllegalValueException { if (bwIndicator == null) { throw new PluginNotFoundException("The node does not have a bandwidthIndicator."); } int downstreamBits = bwIndicator.getDownstreamMaxBitRate(); int upstreamBits = bwIndicator.getUpstramMaxBitRate(); Logger.normal(bwIndicator, "bandwidthIndicator reports downstream " + downstreamBits + " bits/s and upstream " + upstreamBits + " bits/s."); if (downstreamBits < 0 || upstreamBits < 0) { throw new IllegalValueException("Reported unavailable."); } final int KiB = 8192; if (downstreamBits < 8 * KiB) { throw new IllegalValueException("Detected downstream of " + downstreamBits + " bits/s is nonsensically slow, ignoring."); } if (upstreamBits < KiB) { throw new IllegalValueException("Detected upstream of " + upstreamBits + " bits/s is nonsensically slow, ignoring."); } int downstreamBytes = downstreamBits / 8; int upstreamBytes = upstreamBits / 8; return new BandwidthLimit(downstreamBytes, upstreamBytes, "bandwidthDetected", false); }
Source:
TaskAppDeploymentRequestCreator taskAppDeploymentRequestCreator( CommonApplicationProperties commonApplicationProperties, ApplicationConfigurationMetadataResolver metadataResolver) { return new TaskAppDeploymentRequestCreator(commonApplicationProperties, metadataResolver, dataflowServerUri); }

Target:
public TaskAppDeploymentRequestCreator taskAppDeploymentRequestCreator( CommonApplicationProperties commonApplicationProperties, ApplicationConfigurationMetadataResolver metadataResolver) { return new TaskAppDeploymentRequestCreator(commonApplicationProperties, metadataResolver, dataflowServerUri); }
Source:
public double[] toDoubleArray(String colName) throws IllegalArgumentException { List<Comparable<? extends Object>> col = values(colName); double[] colArray = new double[col.size()]; int conversionMethod = 0; for (int i = 0; i < col.size(); i++) { if (i == 0) { if (col.get(i) instanceof Integer) { conversionMethod = INTEGER_CONVERSION_METHOD; } else if (col.get(i) instanceof Double) { conversionMethod = DOUBLE_CONVERSION_METHOD; } else if (col.get(i) instanceof Float) { conversionMethod = FLOAT_CONVERSION_METHOD; } else { throw new IllegalArgumentException(); } } if (conversionMethod == INTEGER_CONVERSION_METHOD) { colArray[i] = (double) ((Integer) col.get(i)).intValue(); } if (conversionMethod == DOUBLE_CONVERSION_METHOD) { colArray[i] = (double) ((Double) col.get(i)); } if (conversionMethod == FLOAT_CONVERSION_METHOD) { colArray[i] = (double) ((Float) col.get(i)).floatValue(); } } return colArray; }

Target:
private double[] toDoubleArray(String colName) throws IllegalArgumentException { List<Comparable<? extends Object>> col = values(colName); double[] colArray = new double[col.size()]; Conversions conversionMethod = null; for (int i = 0; i < col.size(); i++) { if (i == 0) { conversionMethod = getConversion(col.get(i)); } switch (conversionMethod) { case DOUBLE: colArray[i] = (double) ((Double) col.get(i)); break; case INTEGER: colArray[i] = (double) ((Integer) col.get(i)).intValue(); break; case FLOAT: colArray[i] = (double) ((Float) col.get(i)).floatValue(); break; case BYTE: colArray[i] = (double) ((Byte) col.get(i)).byteValue(); break; case SHORT: colArray[i] = (double) ((Short) col.get(i)).shortValue(); break; case LONG: colArray[i] = (double) ((Long) col.get(i)).longValue(); break; } } return colArray; }
Source:
public Mono<Void> saveAuthorizedClient(OAuth2AuthorizedClient authorizedClient, Authentication principal) { Assert.notNull(authorizedClient, "authorizedClient cannot be null"); Assert.notNull(principal, "principal cannot be null"); return this .loadAuthorizedClient(authorizedClient.getClientRegistration().getRegistrationId(), principal.getName()) .flatMap(dbAuthorizedClient -> { return updateAuthorizedClient(authorizedClient, principal); }).switchIfEmpty(Mono.defer(() -> insertAuthorizedClient(authorizedClient, principal))).then(); }

Target:
public Mono<Void> saveAuthorizedClient(OAuth2AuthorizedClient authorizedClient, Authentication principal) { Assert.notNull(authorizedClient, "authorizedClient cannot be null"); Assert.notNull(principal, "principal cannot be null"); return this .loadAuthorizedClient(authorizedClient.getClientRegistration().getRegistrationId(), principal.getName()) .flatMap((dbAuthorizedClient) -> updateAuthorizedClient(authorizedClient, principal)) .switchIfEmpty(Mono.defer(() -> insertAuthorizedClient(authorizedClient, principal))).then(); }
Source:
protected void postProcessModuleInternal(Module module) { ChannelRegistry registry = findRegistry(module); if (registry != null) { MessageChannel channel = module.getComponent("input", MessageChannel.class); if (channel != null) { registry.inbound(module.getDeploymentMetadata().getGroup() + "." + (module.getDeploymentMetadata().getIndex() - 1), channel); } channel = module.getComponent("output", MessageChannel.class); if (channel != null) { registry.inbound(module.getDeploymentMetadata().getGroup() + "." + module.getDeploymentMetadata().getIndex(), channel); } } }

Target:
protected void postProcessModuleInternal(Module module) { ChannelRegistry registry = findRegistry(module); if (registry != null) { MessageChannel channel = module.getComponent("input", MessageChannel.class); if (channel != null) { registry.inbound(module.getDeploymentMetadata().getGroup() + "." + (module.getDeploymentMetadata().getIndex() - 1), channel); } channel = module.getComponent("output", MessageChannel.class); if (channel != null) { registry.outbound(module.getDeploymentMetadata().getGroup() + "." + module.getDeploymentMetadata().getIndex(), channel); } } }
Source:
private boolean isReteoo(WorkingMemoryLog log) { try { Method m = log.getClass().getMethod( "getEngine" ); return ((String)m.invoke( log )).equalsIgnoreCase("RETEOO"); } catch (Exception e) { return false; } }

Target:
private boolean isReteoo(WorkingMemoryLog log) { try { Method m = log.getClass().getMethod( "getEngine" ); return ((String)m.invoke( log )).equalsIgnoreCase("RETEOO"); } catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException e) { return false; } }
Source:
private static void buildReadRowsSettings(Builder builder, BigtableOptions options) { RetryOptions retryOptions = options.getRetryOptions(); RetrySettings.Builder retryBuilder = builder.readRowsSettings().getRetrySettings().toBuilder() .setInitialRetryDelay(ofMillis(retryOptions.getInitialBackoffMillis())) .setRetryDelayMultiplier(retryOptions.getBackoffMultiplier()) .setMaxRetryDelay(ofMillis(retryOptions.getMaxElapsedBackoffMillis())) .setMaxAttempts(retryOptions.getMaxScanTimeoutRetries()); Duration readPartialRowTimeout = ofMillis(retryOptions.getReadPartialRowTimeoutMillis()); retryBuilder .setInitialRpcTimeout(readPartialRowTimeout) .setMaxRpcTimeout(readPartialRowTimeout) .setTotalTimeout(ofMillis(options.getCallOptionsConfig().getLongRpcTimeoutMs())); builder.readRowsSettings() .setRetrySettings(retryBuilder.build()) .setRetryableCodes(buildRetryCodes(options.getRetryOptions())); }

Target:
private static void buildReadRowsSettings(Builder builder, BigtableOptions options) { RetryOptions retryOptions = options.getRetryOptions(); CallOptionsConfig callOptions = options.getCallOptionsConfig(); RetrySettings.Builder retryBuilder = builder.readRowsSettings().getRetrySettings().toBuilder(); Duration rpcTimeout = ofMillis(retryOptions.getReadPartialRowTimeoutMillis()); Duration totalTimeout = ofMillis(callOptions.isUseTimeout() ? callOptions.getLongRpcTimeoutMs() : retryOptions.getMaxElapsedBackoffMillis()); retryBuilder .setInitialRetryDelay(ofMillis(retryOptions.getInitialBackoffMillis())) .setRetryDelayMultiplier(retryOptions.getBackoffMultiplier()) .setMaxRetryDelay(ofMillis(MAX_RETRY_TIMEOUT_MS)) .setMaxAttempts(retryOptions.getMaxScanTimeoutRetries()) .setInitialRpcTimeout(rpcTimeout) .setMaxRpcTimeout(rpcTimeout) .setTotalTimeout(totalTimeout); builder.readRowsSettings() .setRetrySettings(retryBuilder.build()) .setRetryableCodes(buildRetryCodes(options.getRetryOptions())); }
Source:
public static UploadFileResponse create(String fileId, String fileName, String accountId, String bucketId, long contentLength, String contentSha1, String contentType, Map<String, String> fileInfo) { return new AutoValue_UploadFileResponse(fileId, fileName, accountId, bucketId, contentLength, contentSha1, contentType, fileInfo); }

Target:
public static UploadFileResponse create(String fileId, String fileName, String accountId, String bucketId, long contentLength, String contentSha1, String contentType, Map<String, String> fileInfo) { return new AutoValue_UploadFileResponse(fileId, fileName, accountId, bucketId, contentLength, contentSha1, contentType, ImmutableMap.copyOf(fileInfo)); }
Source:
protected void checkRename(String newName) throws Failure { Jenkins.get().getProjectNamingStrategy().checkName(newName); if (isBuilding()) { throw new Failure(Messages.Job_NoRenameWhileBuilding()); } }

Target:
protected void checkRename(String newName) throws Failure { if (isBuilding()) { throw new Failure(Messages.Job_NoRenameWhileBuilding()); } }
Source:
public ActionResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String studentEmailAddress = getNonNullRequestParamValue(Const.ParamsNames.STUDENT_EMAIL); StudentAttributes student = logic.getStudentForEmail(courseId, studentEmailAddress); if (student == null) { return new JsonResult(new RegenerateStudentCourseLinksData("The student with the email " + studentEmailAddress + " could not be found in the course with ID [" + courseId + "].", null)); } try { StudentAttributes updatedStudent = logic.regenerateStudentRegistrationKey(student); boolean emailSent = sendEmail(updatedStudent); String statusMessage = emailSent ? SUCCESSFUL_UPDATE_WITH_EMAIL : SUCCESSFUL_UPDATE_BUT_EMAIL_FAILED; return new JsonResult( new RegenerateStudentCourseLinksData(statusMessage, StringHelper.encrypt(updatedStudent.key))); } catch (EntityDoesNotExistException ex) { return new JsonResult(ex.getMessage(), HttpStatus.SC_NOT_FOUND); } }

Target:
public ActionResult execute() { String studentEmailAddress = getNonNullRequestParamValue(Const.ParamsNames.STUDENT_EMAIL); String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); StudentAttributes updatedStudent; try { updatedStudent = logic.regenerateStudentRegistrationKey(courseId, studentEmailAddress); } catch (EntityDoesNotExistException ex) { return new JsonResult( String.format(STUDENT_NOT_FOUND, studentEmailAddress, courseId), HttpStatus.SC_NOT_FOUND); } catch (RegenerateStudentException ex) { return new JsonResult(UNSUCCESSFUL_REGENERATION, HttpStatus.SC_INTERNAL_SERVER_ERROR); } boolean emailSent = sendEmail(updatedStudent); String statusMessage = emailSent ? SUCCESSFUL_REGENERATION_WITH_EMAIL_SENT : SUCCESSFUL_REGENERATION_BUT_EMAIL_FAILED; return new JsonResult( new RegenerateStudentCourseLinksData(statusMessage, StringHelper.encrypt(updatedStudent.key))); }
Source:
public void add(Config config) { if (getByName(config.getName()) != null) { throw new ConfigurationAlreadyExistsException(config.getName()); } String openMrsUrl = config.getOpenMrsUrl(); if (openMrsUrl.charAt(openMrsUrl.length() - 1) == '/') { config.setOpenMrsUrl(openMrsUrl.substring(0, openMrsUrl.length()-1)); } configs.add(config); if (defaultConfigName == null) { defaultConfigName = config.getName(); } }

Target:
public void add(Config config) { if (getByName(config.getName()) != null) { throw new ConfigurationAlreadyExistsException(config.getName()); } configs.add(config); if (defaultConfigName == null) { defaultConfigName = config.getName(); } }
Source:
public void shouldRemoveHeaderIfTheValueIsNull() throws Exception { Map<String, Object> header = new HashMap<String, Object>(); header.put("test", null); header.put("test2", "isSet"); String signed = JWTCreator.init() .withClaim("test", 123) .withHeader(header) .sign(Algorithm.HMAC256("secret")); assertThat(signed, is(notNullValue())); String[] parts = signed.split("\\."); String headerJson = new String(Base64.decodeBase64(parts[0]), StandardCharsets.UTF_8); assertThat(headerJson, JsonMatcher.hasEntry("test", null)); assertThat(headerJson, JsonMatcher.hasEntry("test2", "isSet")); }

Target:
public void shouldRemoveHeaderIfTheValueIsNull() throws Exception { Map<String, Object> header = new HashMap<String, Object>(); header.put(PublicClaims.KEY_ID, null); header.put("test2", "isSet"); String signed = JWTCreator.init() .withKeyId("test") .withHeader(header) .sign(Algorithm.HMAC256("secret")); assertThat(signed, is(notNullValue())); String[] parts = signed.split("\\."); String headerJson = new String(Base64.decodeBase64(parts[0]), StandardCharsets.UTF_8); assertThat(headerJson, JsonMatcher.isNotPresent(PublicClaims.KEY_ID)); assertThat(headerJson, JsonMatcher.hasEntry("test2", "isSet")); }
Source:
public <R extends RestResponse<?, ?>, C> R getSingleResponse(String digitalExchangeName, DigitalExchangeCall<R, C> call) { return getSingleResponse(digitalExchangesManager.findByName(digitalExchangeName).get(), call); }

Target:
public <R extends RestResponse<?, ?>, C> R getSingleResponse(String digitalExchangeName, DigitalExchangeCall<R, C> call) { DigitalExchange digitalExchange = digitalExchangesManager.findByName(digitalExchangeName). orElseThrow(() -> new IllegalArgumentException("DigitalExchange " + digitalExchangeName + " not found")); return getSingleResponse(digitalExchange, call); }
Source:
public void testBaselineAutoAdjustmentSettings() throws Exception { Ignite ignite = startGrid(); ignite.cluster().active(true); DistributedBaselineConfiguration bc = ignite.cluster().baselineConfiguration(); assertFalse(bc.isBaselineAutoAdjustEnabled()); long softTimeout = bc.getBaselineAutoAdjustTimeout(); assertEquals(EXIT_CODE_OK, execute( "--baseline", "auto_adjust", "enable", "timeout", Long.toString(softTimeout + 1) )); assertTrue(bc.isBaselineAutoAdjustEnabled()); assertEquals(softTimeout + 1, bc.getBaselineAutoAdjustTimeout()); assertEquals(EXIT_CODE_OK, execute("--baseline", "auto_adjust", "disable")); assertFalse(bc.isBaselineAutoAdjustEnabled()); assertEquals(EXIT_CODE_INVALID_ARGUMENTS, execute("--baseline", "auto_adjust")); assertEquals(EXIT_CODE_INVALID_ARGUMENTS, execute("--baseline", "auto_adjust", "true")); assertEquals(EXIT_CODE_INVALID_ARGUMENTS, execute("--baseline", "auto_adjust", "enable", "x")); assertEquals(EXIT_CODE_INVALID_ARGUMENTS, execute("--baseline", "auto_adjust", "disable", "x")); log.info("================================================"); System.out.println(testOut.toString()); log.info("================================================"); }

Target:
public void testBaselineAutoAdjustmentSettings() throws Exception { Ignite ignite = startGrid(); ignite.cluster().active(true); IgniteCluster cl = ignite.cluster(); assertFalse(cl.isBaselineAutoAdjustEnabled()); long timeout = cl.baselineAutoAdjustTimeout(); assertEquals(EXIT_CODE_OK, execute( "--baseline", "auto_adjust", "enable", "timeout", Long.toString(timeout + 1) )); assertTrue(cl.isBaselineAutoAdjustEnabled()); assertEquals(timeout + 1, cl.baselineAutoAdjustTimeout()); assertEquals(EXIT_CODE_OK, execute("--baseline", "auto_adjust", "disable")); assertFalse(cl.isBaselineAutoAdjustEnabled()); assertEquals(EXIT_CODE_INVALID_ARGUMENTS, execute("--baseline", "auto_adjust")); assertEquals(EXIT_CODE_INVALID_ARGUMENTS, execute("--baseline", "auto_adjust", "true")); assertEquals(EXIT_CODE_INVALID_ARGUMENTS, execute("--baseline", "auto_adjust", "enable", "x")); assertEquals(EXIT_CODE_INVALID_ARGUMENTS, execute("--baseline", "auto_adjust", "disable", "x")); log.info("================================================"); System.out.println(testOut.toString()); log.info("================================================"); }
Source:
private List<SimpleDivision> getSupremeChamberDivisionList(String supremeChamberId) { int intChamberId = 0; try { intChamberId = Integer.parseInt(supremeChamberId); } catch (NumberFormatException e) { return Lists.newArrayList(); } return simpleDivisionConverter.convertScChamberDivisions(scChamberDivisionRepository.findAllByScChamberId(intChamberId)); }

Target:
private List<SimpleDivision> getSupremeChamberDivisionList(String supremeChamberId) { try { int intChamberId = Integer.parseInt(supremeChamberId); return simpleDivisionConverter.convertScChamberDivisions(scChamberDivisionRepository.findAllByScChamberId(intChamberId)); } catch (NumberFormatException e) { return Lists.newArrayList(); } }
Source:
public void run() { try { if(requesterEndPoint==null) throw new Exception("Not valid endpoint provided"); servletContext.setAttribute("integrityDataGenerationStatus", ProcessStatus.PROCESSING); IntegrityUtil integrityUtil = new IntegrityUtil(); integrityUtil.generateDataToCheckZip(requesterEndPoint.getId()); } catch (Exception e) { if ( e instanceof InterruptedException ) { servletContext.setAttribute( "integrityDataGenerationStatus", ProcessStatus.CANCELED ); servletContext.setAttribute( "integrityDataGenerationError", e.getMessage() ); Logger.debug( IntegrityDataGeneratorThread.class, "Requested interruption of generation of data to check by the user.", e ); throw new RuntimeException( "Requested interruption of generation of data to check by the user.", e ); } Logger.error(IntegrityDataGeneratorThread.class, "Error generating data to check", e); servletContext.setAttribute("integrityDataGenerationStatus", ProcessStatus.ERROR); servletContext.setAttribute("integrityDataGenerationError", e.getMessage()); } finally { servletContext.setAttribute("integrityDataGenerationStatus", ProcessStatus.FINISHED); try { HibernateUtil.closeSession(); } catch (DotHibernateException e) { Logger.warn(this, e.getMessage(), e); } } }

Target:
public void run() { try { if(requesterEndPoint==null) throw new Exception("Not valid endpoint provided"); servletContext.setAttribute("integrityDataGenerationStatus", ProcessStatus.PROCESSING); IntegrityUtil integrityUtil = new IntegrityUtil(); integrityUtil.generateDataToCheckZip(requesterEndPoint.getId()); } catch (Exception e) { if ( e instanceof InterruptedException ) { servletContext.setAttribute( "integrityDataGenerationStatus", ProcessStatus.CANCELED ); servletContext.setAttribute( "integrityDataGenerationError", e.getMessage() ); Logger.debug( IntegrityDataGeneratorThread.class, "Requested interruption of generation of data to check by the user.", e ); throw new RuntimeException( "Requested interruption of generation of data to check by the user.", e ); } Logger.error(IntegrityDataGeneratorThread.class, "Error generating data to check", e); servletContext.setAttribute("integrityDataGenerationStatus", ProcessStatus.ERROR); servletContext.setAttribute("integrityDataGenerationError", e.getMessage()); } finally { servletContext.setAttribute("integrityDataGenerationStatus", ProcessStatus.FINISHED); } }
Source:
public void setUp() { filterConfig = new FilterConfig() { @Override public ServletContext getServletContext() { return null; } @Override public Enumeration<String> getInitParameterNames() { return null; } @Override public String getInitParameter(String arg0) { return null; } @Override public String getFilterName() { return null; } }; Rule ruleA = new RuleBuilder() .withId("0") .withActivated(true) .withPosition(3) .withParameter("cql_filter") .withTransform("CFCC='$2'") .build(); RulesDao.saveOrUpdateRule(ruleA); Filter.USE_AS_SERVLET_FILTER = false; }

Target:
public void setUp() { filterConfig = new MockFilterConfig(); Rule ruleA = new RuleBuilder() .withId("0") .withActivated(true) .withPosition(3) .withParameter("cql_filter") .withTransform("CFCC='$2'") .build(); RulesDao.saveOrUpdateRule(ruleA); Filter.USE_AS_SERVLET_FILTER = false; }
Source:
public void onUserLoginFailure(Exception ex, String accessToken, String backend) { tryToSetUIInteraction(true); if (ex != null && ex instanceof LoginException) { LoginErrorMessage errorMessage = (((LoginException) ex).getLoginErrorMessage()); showAlertDialog( errorMessage.getMessageLine1(), (errorMessage.getMessageLine2() != null) ? errorMessage.getMessageLine2() : getString(R.string.login_failed)); } else if (ex != null && ex instanceof HttpStatusException) { switch (((HttpStatusException) ex).getStatusCode()) { case HttpStatus.UPGRADE_REQUIRED: LoginActivity.this.showAlertDialog(null, getString(R.string.app_version_unsupported_login_msg), getString(R.string.label_update), (dialog, which) -> AppStoreUtils .openAppInAppStore(LoginActivity.this), getString(android.R.string.cancel), null); break; case HttpStatus.FORBIDDEN: LoginActivity.this.showAlertDialog(getString(R.string.login_error), getString(R.string.auth_provider_disabled_user_error), getString(R.string.CUSTOMER_SUPPORT), (dialog, which) -> environment.getRouter() .showFeedbackScreen(LoginActivity.this, getString(R.string.email_subject)), getString(android.R.string.cancel), null); break; default: showAlertDialog(getString(R.string.login_error), ErrorUtils.getErrorMessage(ex, LoginActivity.this)); logger.error(ex); } } else { showAlertDialog(getString(R.string.login_error), ErrorUtils.getErrorMessage(ex, LoginActivity.this)); logger.error(ex); } }

Target:
public void onUserLoginFailure(Exception ex, String accessToken, String backend) { tryToSetUIInteraction(true); if (ex != null && ex instanceof LoginException) { LoginErrorMessage errorMessage = (((LoginException) ex).getLoginErrorMessage()); showAlertDialog( errorMessage.getMessageLine1(), (errorMessage.getMessageLine2() != null) ? errorMessage.getMessageLine2() : getString(R.string.login_failed)); } else if (ex != null && ex instanceof HttpStatusException) { switch (((HttpStatusException) ex).getStatusCode()) { case HttpStatus.UPGRADE_REQUIRED: LoginActivity.this.showAlertDialog(null, getString(R.string.app_version_unsupported_login_msg), getString(R.string.label_update), (dialog, which) -> AppStoreUtils .openAppInAppStore(LoginActivity.this), getString(android.R.string.cancel), null); break; case HttpStatus.FORBIDDEN: LoginActivity.this.showAlertDialog(getString(R.string.login_error), getString(R.string.auth_provider_disabled_user_error), getString(R.string.label_customer_support), (dialog, which) -> environment.getRouter() .showFeedbackScreen(LoginActivity.this, getString(R.string.email_subject_account_disabled)), getString(android.R.string.cancel), null); break; default: showAlertDialog(getString(R.string.login_error), ErrorUtils.getErrorMessage(ex, LoginActivity.this)); logger.error(ex); } } else { showAlertDialog(getString(R.string.login_error), ErrorUtils.getErrorMessage(ex, LoginActivity.this)); logger.error(ex); } }