auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private boolean ignoreRegionMoveFailure(ExecutionException e) { boolean ignoreFailure; if (e.getCause() instanceof UnknownRegionException) { ignoreFailure = true; } else if (e.getCause() instanceof DoNotRetryRegionException && e.getCause().getMessage() != null && e.getCause().getMessage() .contains(AssignmentManager.UNEXPECTED_STATE_REGION + "state=SPLIT,")) { ignoreFailure = true; } else { ignoreFailure = false; } return ignoreFailure; }

Target:
private boolean ignoreRegionMoveFailure(ExecutionException e) { boolean ignoreFailure = false; if (e.getCause() instanceof UnknownRegionException) { ignoreFailure = true; } else if (e.getCause() instanceof DoNotRetryRegionException && e.getCause().getMessage() != null && e.getCause().getMessage() .contains(AssignmentManager.UNEXPECTED_STATE_REGION + "state=SPLIT,")) { ignoreFailure = true; } return ignoreFailure; }
Source:
public void actionOpen(HomeActivity activity, IndexedItem with, IOnResult<Boolean> listener) { if (!(with instanceof IndexedFile)) { return; } IndexedFile file = (IndexedFile) with; Uri uri = Uri.fromFile(file.getUnlockedFile()); Intent newIntent = new Intent(android.content.Intent.ACTION_VIEW); MimeTypeMap myMime = MimeTypeMap.getSingleton(); String mimeType = myMime.getMimeTypeFromExtension(file.getExtension().substring(1)); newIntent.setDataAndType(uri, mimeType); newIntent.setFlags(newIntent.FLAG_ACTIVITY_NEW_TASK); try { activity.setRequestedActivity(true); activity.startActivity(newIntent); } catch (android.content.ActivityNotFoundException e) { Toast.makeText(activity, "No handler for file " + file.getUnlockedFilename(), 4000).show(); } finishActionMode(); if (listener != null) { listener.onResult(true); } }

Target:
public void actionOpen(HomeActivity activity, IndexedItem with, IOnResult<Boolean> listener) { if (!(with instanceof IndexedFile)) { return; } IndexedFile file = (IndexedFile) with; Uri uri = Uri.fromFile(file.getUnlockedFile()); Intent newIntent = new Intent(android.content.Intent.ACTION_VIEW); MimeTypeMap myMime = MimeTypeMap.getSingleton(); String mimeType = myMime.getMimeTypeFromExtension(file.getExtension().substring(1)); newIntent.setDataAndType(uri, mimeType); newIntent.setFlags(newIntent.FLAG_ACTIVITY_NEW_TASK); try { activity.setRequestedActivity(true); activity.startActivity(newIntent); } catch (android.content.ActivityNotFoundException e) { Toast.makeText(activity, "No handler for file " + file.getUnlockedFilename(), 4000).show(); activity.setRequestedActivity(false); } finishActionMode(); if (listener != null) { listener.onResult(true); } }
Source:
protected <T extends RassXmlObject, R extends PersistableBusinessObject> MaintenanceDocument createAndRouteMaintenanceDocument( Pair<R, R> businessObjects, String maintenanceAction, RassObjectTranslationDefinition<T, R> objectDefinition) { try { return GlobalVariables.doInNewGlobalVariables( buildSessionForSystemUser(), () -> createAndRouteMaintenanceDocumentInternal(businessObjects, maintenanceAction, objectDefinition)); } catch(ValidationException ve) { throw new RuntimeException(ve.getMessage()); } catch (Exception e) { throw new RuntimeException(e); } }

Target:
protected <T extends RassXmlObject, R extends PersistableBusinessObject> MaintenanceDocument createAndRouteMaintenanceDocument(Pair<R, R> businessObjects, String maintenanceAction, RassObjectTranslationDefinition<T, R> objectDefinition) { try { return GlobalVariables.doInNewGlobalVariables(buildSessionForSystemUser(), () -> createAndRouteMaintenanceDocumentInternal(businessObjects, maintenanceAction, objectDefinition)); } catch (ValidationException validationExceptionWithGlobalErrorMessages) { throw new RuntimeException(validationExceptionWithGlobalErrorMessages.getMessage()); } catch (Exception e) { throw new RuntimeException(e); } }
Source:
public void testGetLife() { levels.add(l); Player p = new Player(po); ArrayList<Player> list = new ArrayList<Player>(); list.add(p); Game game = new Game(levels, list); game.start(); assertTrue(game.isRunning()); assertTrue(p.getLives() == 3); p.setLives(2); assertTrue(p.getLives() == 2); p.loseLife(); assertTrue(p.getLives() == 1); p.addLife(); assertTrue(p.getLives() == 2); }

Target:
public void testGetLife() { levels.add(level); Player p = new Player(point, map); ArrayList<Player> list = new ArrayList<Player>(); list.add(p); Game game = new Game(levels, list); game.start(); assertTrue(game.isRunning()); assertEquals(p.getLives(), 3); p.setLives(2); assertEquals(p.getLives(), 2); p.loseLife(); assertEquals(p.getLives(), 1); p.addLife(); assertEquals(p.getLives(), 2); }
Source:
private void startLogin( StartActivityDelegate startActivityDelegate, LoginClient.Request request ) throws FacebookException { this.pendingLoginRequest = request; this.pendingLoggingExtras = new HashMap<>(); this.context = startActivityDelegate.getActivityContext(); logStartLogin(); CallbackManagerImpl.registerStaticCallback( CallbackManagerImpl.RequestCodeOffset.Login.toRequestCode(), new CallbackManagerImpl.Callback() { @Override public boolean onActivityResult(int resultCode, Intent data) { return LoginManager.this.onActivityResult(resultCode, data); } } ); boolean started = tryLoginActivity(startActivityDelegate, request); pendingLoggingExtras.put( LoginLogger.EVENT_EXTRAS_TRY_LOGIN_ACTIVITY, started ? AppEventsConstants.EVENT_PARAM_VALUE_YES : AppEventsConstants.EVENT_PARAM_VALUE_NO ); if (!started) { FacebookException exception = new FacebookException( "Log in attempt failed: FacebookActivity could not be started." + "Have you added FacebookActivity to your AndroidManifest?"); logCompleteLogin(LoginClient.Result.Code.ERROR, null, exception); this.pendingLoginRequest = null; throw exception; } }

Target:
private void startLogin( StartActivityDelegate startActivityDelegate, LoginClient.Request request ) throws FacebookException { this.pendingLoginRequest = request; this.pendingLoggingExtras = new HashMap<>(); this.context = startActivityDelegate.getActivityContext(); logStartLogin(); CallbackManagerImpl.registerStaticCallback( CallbackManagerImpl.RequestCodeOffset.Login.toRequestCode(), new CallbackManagerImpl.Callback() { @Override public boolean onActivityResult(int resultCode, Intent data) { return LoginManager.this.onActivityResult(resultCode, data); } } ); boolean started = tryLoginActivity(startActivityDelegate, request); pendingLoggingExtras.put( LoginLogger.EVENT_EXTRAS_TRY_LOGIN_ACTIVITY, started ? AppEventsConstants.EVENT_PARAM_VALUE_YES : AppEventsConstants.EVENT_PARAM_VALUE_NO ); if (!started) { FacebookException exception = new FacebookException( "Log in attempt failed: FacebookActivity could not be started." + " Please make sure you added FacebookActivity to the AndroidManifest."); logCompleteLogin(LoginClient.Result.Code.ERROR, null, exception); this.pendingLoginRequest = null; throw exception; } }
Source:
private void initCloudServiceTracking() { String selectedCloudServicePid = this.options.getCloudServicePid(); String filterString = String.format("(&(%s=%s)(kura.service.pid=%s))", Constants.OBJECTCLASS, CloudService.class.getName(), selectedCloudServicePid); Filter filter = null; try { filter = this.componentContext.getBundleContext().createFilter(filterString); } catch (InvalidSyntaxException e) { logger.error("Filter setup exception " + ThrowableUtil.stackTraceAsString(e)); } this.cloudServiceTracker = new ServiceTracker<CloudService, CloudService>( this.componentContext.getBundleContext(), filter, this.customizer); this.cloudServiceTracker.open(); }

Target:
private void initCloudServiceTracking() { String selectedCloudServicePid = this.cloudSubscriberOptions.getCloudServicePid(); String filterString = String.format("(&(%s=%s)(kura.service.pid=%s))", Constants.OBJECTCLASS, CloudService.class.getName(), selectedCloudServicePid); Filter filter = null; try { filter = this.bundleContext.createFilter(filterString); } catch (InvalidSyntaxException e) { logger.error("Filter setup exception " + ThrowableUtil.stackTraceAsString(e)); } this.cloudServiceTracker = new ServiceTracker<>(this.bundleContext, filter, this.cloudServiceTrackerCustomizer); this.cloudServiceTracker.open(); }
Source:
@Override public final int describeContents() { return 0; }

Target:
public final int describeContents() { return 0; }
Source:
public void testThrowingNullPointerExceptionOnNullGetWithClass() throws Exception { cache.get(null, (Class<Object>) null); }

Target:
public void testThrowingNullPointerExceptionOnNullGetWithClass() throws Exception { cache.get(null, (Class<?>) null); }
Source:
public Shell(String command) { this(command, 0); }

Target:
public Shell(String command) { this(command, null); }
Source:
private void assertCallbackFailure(@NonNull Call<RbPageSummary> call, @NonNull Callback cb) { verify(cb, never()).onSuccess(any(Call.class), any(PageTitle.class)); verify(cb).onError(eq(call), any(Throwable.class)); }

Target:
private void assertCallbackFailure(@NonNull Call<RbPageSummary> call, @NonNull Callback cb) { verify(cb, never()).onSuccess(any(Call.class), any(PageTitle.class)); verify(cb).onError(eq(call), isA(IOException.class)); }
Source:
public CompletableFuture<Void> unsubscribe() { logger.debug("Unsubscrbing.."); final OpcUaSubscriptionManager manager = client.getSubscriptionManager(); manager.removeSubscriptionListener(SubscriptionManager.this); for (final MonitoredItemHandler handler : monitoredItemHandlers.values()) { handler.close(); } monitoredItemHandlers.clear(); return manager.deleteSubscription(subscription.getSubscriptionId()).handle((ok, e) -> { if (e != null) { logger.debug("Failed to delete subscription", e); } logger.debug("Unsubscrbing..done"); synchronized (SubscriptionManager.this) { state = new Unsubscribed(); } return (Void) null; }); }

Target:
public CompletableFuture<Void> unsubscribe() { logger.debug("Unsubscribing.."); final OpcUaSubscriptionManager manager = client.getSubscriptionManager(); manager.removeSubscriptionListener(SubscriptionManager.this); for (final MonitoredItemHandler handler : monitoredItemHandlers.values()) { handler.close(); } monitoredItemHandlers.clear(); return manager.deleteSubscription(subscription.getSubscriptionId()).handle((ok, e) -> { if (e != null) { logger.debug("Failed to delete subscription", e); } logger.debug("Unsubscribing..done"); synchronized (SubscriptionManager.this) { state = new Unsubscribed(); } return (Void) null; }); }
Source:
public void onPartitionStateChangeToStandbyFromLeader(String partitionName) { logger.debug("Partition state change notification from Leader to Standby received for partition {}", partitionName); synchronized (notificationLock) { try { removeCloudReplica(partitionName); } catch (ReplicationException rex) { logger.error("Exception on removing Partition from {}: ", partitionName, dataNodeId, rex); } } }

Target:
public void onPartitionStateChangeToStandbyFromLeader(String partitionName) { logger.info("Partition state change notification from Leader to Standby received for partition {}", partitionName); synchronized (notificationLock) { removeCloudReplica(partitionName); } }
Source:
private static void assertWhitelistedUrlHost(String urlString) { URL url; try { url = new URL(urlString); } catch (MalformedURLException e) { throw new RuntimeException(urlString + " is not a valid URL."); } String host = url.getHost(); boolean isURLWhitelisted = false; for (Pattern urlPattern : WHITELISTED_URL_HOSTS_REGEX) { if (urlPattern.matcher(host).find()) { isURLWhitelisted = true; break; } } if (!isURLWhitelisted) { throw new RuntimeException(url + " is not an approved URL."); } }

Target:
private static void assertWhitelistedUrlHost(String urlString) { URL url; try { url = new URL(urlString); } catch (MalformedURLException e) { throw new RuntimeException(urlString + " is not a valid URL."); } String host = url.getHost(); if (!WHITELISTED_URL_HOSTS_REGEX.matcher(host).find()) { throw new DisallowedSMSInstallURLException(url + " is not an approved URL."); } }
Source:
public void testConstructorOrAnd() throws SearchException, IOException { final ExtendedSearchSequence searchSeq = new ExtendedSearchSequence(); final BodyTerm bodyTerm = new BodyTerm("test"); final AndTerm andTerm = new AndTerm(bodyTerm, bodyTerm); final OrTerm orTerm = new OrTerm(andTerm, andTerm); final Argument args = new Argument(); args.append(searchSeq.generateSequence(orTerm, null)); final String searchStr = args.toString(); Assert.assertEquals(searchStr, "OR (BODY test BODY test) (BODY test BODY test)", "result mismatched."); }

Target:
public void testConstructorOrAnd() throws SearchException, IOException { final ExtendedSearchSequence searchSeq = new ExtendedSearchSequence(); final BodyTerm bodyTerm = new BodyTerm("test"); final AndTerm andTerm = new AndTerm(bodyTerm, bodyTerm); final OrTerm orTerm = new OrTerm(andTerm, andTerm); final Argument args = new Argument(); args.append(searchSeq.generateSequence(orTerm, null)); final String searchStr = args.toString(); Assert.assertEquals(searchStr, "OR (BODY test BODY test) (BODY test BODY test)", "generateSequence() mismatched."); }
Source:
public void run(String... args) throws Exception { List<ModuleLaunchRequest> launchRequests = generateModuleLaunchRequests(); if (log.isInfoEnabled()) { StringBuilder sb = new StringBuilder("Launching\n"); for (ModuleLaunchRequest moduleLaunchRequest : launchRequests) { sb.append('\t').append(moduleLaunchRequest).append('\n'); } log.info(sb.toString()); } this.moduleLauncher.launch(launchRequests, moduleLauncherProperties.isAggregate(), filterSpringProperties(args)); }

Target:
public void run(String... args) throws Exception { List<ModuleLaunchRequest> launchRequests = generateModuleLaunchRequests(); if (log.isInfoEnabled()) { StringBuilder sb = new StringBuilder("Launching\n"); for (ModuleLaunchRequest moduleLaunchRequest : launchRequests) { sb.append('\t').append(moduleLaunchRequest).append('\n'); } log.info(sb.toString()); } this.moduleLauncher.launch(launchRequests, moduleLauncherProperties.isAggregate(), moduleLauncherProperties.isAggregate() ? extractAggregateProperties(args) : new String[0]); }
Source:
protected void encode(ChannelHandlerContext ctx, DefaultDnsQuery msg, List<Object> out) throws Exception { ByteBuf byteBuf = ctx.alloc().buffer(); encoder.encode(msg, byteBuf); FullHttpRequest fullHttpRequest; if (get) { ByteBuf encodedDNS = Base64.encode(byteBuf); fullHttpRequest = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, url.getPath() + "?dns=" + encodedDNS.toString(CharsetUtil.UTF_8)); encodedDNS.release(); } else { fullHttpRequest = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.POST, url.getPath(), byteBuf); fullHttpRequest.headers().add(HttpHeaderNames.CONTENT_LENGTH, byteBuf.readableBytes()); } fullHttpRequest.headers() .add(HttpHeaderNames.HOST, url.getHost()) .add(HttpHeaderNames.CONTENT_TYPE, "application/dns-message") .add(HttpHeaderNames.ACCEPT, "application/dns-message"); if (http2) { fullHttpRequest.headers().add(HttpConversionUtil.ExtensionHeaderNames.SCHEME.text(), HttpScheme.HTTPS.name()); } out.add(fullHttpRequest); }

Target:
protected void encode(ChannelHandlerContext ctx, DefaultDnsQuery msg, List<Object> out) throws Exception { ByteBuf byteBuf = ctx.alloc().buffer(); encoder.encode(msg, byteBuf); FullHttpRequest fullHttpRequest; if (get) { ByteBuf encodedDNS = Base64.encode(byteBuf, Base64Dialect.URL_SAFE); fullHttpRequest = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, url.getPath() + "?dns=" + encodedDNS.toString(CharsetUtil.UTF_8)); encodedDNS.release(); } else { fullHttpRequest = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.POST, url.getPath(), byteBuf); fullHttpRequest.headers().add(HttpHeaderNames.CONTENT_LENGTH, byteBuf.readableBytes()); } fullHttpRequest.headers() .add(HttpHeaderNames.HOST, url.getHost()) .add(HttpHeaderNames.CONTENT_TYPE, "application/dns-message") .add(HttpHeaderNames.ACCEPT, "application/dns-message"); if (http2) { fullHttpRequest.headers().add(HttpConversionUtil.ExtensionHeaderNames.SCHEME.text(), HttpScheme.HTTPS.name()); } out.add(fullHttpRequest); }
Source:
public static void cleanupStaleTestDatabases(DatabaseManager client) { logger.info("Cleaning stale test databases ..."); List<SqlParameter> sqlParameterList = new ArrayList<>(); sqlParameterList.add(new SqlParameter("@PREFIX", CosmosDatabaseForTest.SHARED_DB_ID_PREFIX)); List<CosmosDatabaseProperties> dbs = client.queryDatabases( new SqlQuerySpec("SELECT * FROM c WHERE STARTSWITH(c.id, @PREFIX)", sqlParameterList)).collectList().block(); for (CosmosDatabaseProperties db : dbs) { assertThat(ModelBridgeInternal.getResource(db).getId()).startsWith(CosmosDatabaseForTest.SHARED_DB_ID_PREFIX); CosmosDatabaseForTest dbForTest = CosmosDatabaseForTest.from(client.getDatabase(ModelBridgeInternal.getResource(db).getId())); if (db != null && dbForTest.isStale()) { logger.info("Deleting database {}", ModelBridgeInternal.getResource(db).getId()); dbForTest.deleteDatabase(ModelBridgeInternal.getResource(db).getId()); } } }

Target:
public static void cleanupStaleTestDatabases(DatabaseManager client) { logger.info("Cleaning stale test databases ..."); List<SqlParameter> sqlParameterList = new ArrayList<>(); sqlParameterList.add(new SqlParameter("@PREFIX", CosmosDatabaseForTest.SHARED_DB_ID_PREFIX)); List<CosmosDatabaseProperties> dbs = client.queryDatabases( new SqlQuerySpec("SELECT * FROM c WHERE STARTSWITH(c.id, @PREFIX)", sqlParameterList)).collectList().block(); for (CosmosDatabaseProperties db : dbs) { assertThat(db.getId()).startsWith(CosmosDatabaseForTest.SHARED_DB_ID_PREFIX); CosmosDatabaseForTest dbForTest = CosmosDatabaseForTest.from(client.getDatabase(db.getId())); if (db != null && dbForTest.isStale()) { logger.info("Deleting database {}", db.getId()); dbForTest.deleteDatabase(db.getId()); } } }
Source:
static Iterator<Double> rangeBy(double from, double toExclusive, double step) { final BigDecimal fromDecimal = asDecimal(from), toDecimal = asDecimal(toExclusive), stepDecimal = asDecimal(step); return rangeBy(fromDecimal, toDecimal, stepDecimal); }

Target:
static Iterator<Double> rangeBy(double from, double toExclusive, double step) { final BigDecimal fromDecimal = asDecimal(from), toDecimal = asDecimal(toExclusive), stepDecimal = asDecimal(step); return rangeBy(fromDecimal, toDecimal, stepDecimal).map(BigDecimal::doubleValue); }
Source:
public org.ovirt.engine.api.model.Cluster update(org.ovirt.engine.api.model.Cluster incoming) { MacPool macPool = incoming.getMacPool(); macPool.setId(MacPoolIdByIdOrName.get(macPool.getId(), macPool.getName(), this)); return performUpdate(incoming, new QueryIdResolver<>(VdcQueryType.GetClusterById, IdQueryParameters.class), VdcActionType.UpdateCluster, new UpdateParametersProvider()); }

Target:
public org.ovirt.engine.api.model.Cluster update(org.ovirt.engine.api.model.Cluster incoming) { return performUpdate(incoming, new QueryIdResolver<>(VdcQueryType.GetClusterById, IdQueryParameters.class), VdcActionType.UpdateCluster, new UpdateParametersProvider(this)); }
Source:
public void initializeCapacityUsedMetric(final Log log, final long capacityInBytes) { currentCapacityUsed = new Gauge<Long>() { @Override public Long getValue() { return log.getLogEndOffset(); } }; registry.register(MetricRegistry.name(Log.class, name + "-currentCapacityUsed"), currentCapacityUsed); ratioOfCurrentToTotalCapacity = new Gauge<Double>() { @Override public Double getValue() { return ((double) log.getLogEndOffset() / capacityInBytes); } }; registry.register(MetricRegistry.name(Log.class, name + "-ratioOfCurrentToTotalCapacity"), ratioOfCurrentToTotalCapacity); }

Target:
public void initializeCapacityUsedMetric(final Log log, final long capacityInBytes) { currentCapacityUsed = new Gauge<Long>() { @Override public Long getValue() { return log.getLogEndOffset(); } }; registry.register(MetricRegistry.name(Log.class, name + "-currentCapacityUsed"), currentCapacityUsed); precentageUsedCapacity = new Gauge<Double>() { @Override public Double getValue() { return ((double) log.getLogEndOffset() / capacityInBytes) * 100; } }; registry.register(MetricRegistry.name(Log.class, name + "-precentageUsedCapacity"), precentageUsedCapacity); }
Source:
public ExecutorService get() { if (executorService == null) { super.get(); executorService = ExecutorServiceMetrics.monitor( meterRegistry, super.get(), CheMinorWebSocketEndpointConfiguration.EXECUTOR_NAME, Tags.empty()); } return executorService; }

Target:
public synchronized ExecutorService get() { if (executorService == null) { executorService = ExecutorServiceMetrics.monitor( meterRegistry, super.get(), CheMinorWebSocketEndpointConfiguration.EXECUTOR_NAME, Tags.empty()); } return executorService; }
Source:
public void executeScaffolder(List<File> ramlFiles, File appDir, File domainDir, String muleVersion) { List<String> ramlsWithExtensionEnabledPaths = processDataModelFiles(ramlFiles); List<String> ramlFilePaths = ramlsWithExtensionEnabledPaths; List<String> muleXmlFiles = retrieveFilePaths(appDir, appExtensions); SystemStreamLog log = new SystemStreamLog(); String domain = null; if (domainDir != null) { List<String> domainFiles = retrieveFilePaths(domainDir, appExtensions); if (domainFiles.size() > 0) { domain = domainFiles.get(0); if (domainFiles.size() > 1) { log.info("There is more than one domain file inside of the domain folder. The domain: " + domain + " will be used."); } } } Scaffolder scaffolder; try { scaffolder = Scaffolder.createScaffolder(log, appDir, ramlFilePaths, muleXmlFiles, domain, muleVersion, null, ramlsWithExtensionEnabledPaths); } catch (Exception e) { throw new RuntimeException("Error executing scaffolder", e); } scaffolder.run(); }

Target:
public void executeScaffolder(List<File> ramlFiles, File appDir, File domainDir, String muleVersion) { List<String> ramlsWithExtensionEnabledPaths = processDataModelFiles(ramlFiles); List<String> ramlFilePaths = ramlsWithExtensionEnabledPaths; List<String> muleXmlFiles = retrieveFilePaths(appDir, appExtensions); SystemStreamLog log = new SystemStreamLog(); String domain = null; if (domainDir != null) { List<String> domainFiles = retrieveFilePaths(domainDir, appExtensions); if (domainFiles.size() > 0) { domain = domainFiles.get(0); if (domainFiles.size() > 1) { log.info("There is more than one domain file inside of the domain folder. The domain: " + domain + " will be used."); } } } Scaffolder scaffolder; try { scaffolder = Scaffolder.createScaffolder(log, appDir, ramlFilePaths, muleXmlFiles, domain, muleVersion, null, ramlsWithExtensionEnabledPaths, ParserType.defaultType()); } catch (Exception e) { throw new RuntimeException("Error executing scaffolder", e); } scaffolder.run(); }
Source:
public void VideosPageTest_003() { SpecialVideosPageObject specialVideos = new SpecialVideosPageObject(driver); YoutubeVideo video = YoutubeVideoProvider.getLatestVideoForQuery(VIDEO_QUERY); specialVideos.addVideoViaAjax(video.getUrl()); specialVideos.isNewVideoAdded(); ADDED_VIDEO_TITLE = specialVideos.getNewestVideoTitle(); specialVideos.deleteNewestVideo(); Assertion.assertTrue(specialVideos.getBannerNotifications().isNotificationMessageVisible(), "Banner notification is not visible"); Assertion.assertNotEquals(specialVideos.getNewestVideoTitle(), ADDED_VIDEO_TITLE, "Video is still visible as newest video"); }

Target:
public void VideosPageTest_003() { SpecialVideosPageObject specialVideos = new SpecialVideosPageObject(driver); YoutubeVideo video = YoutubeVideoProvider.getLatestVideoForQuery(VIDEO_QUERY); specialVideos.addVideoViaAjax(video.getUrl()); specialVideos.isNewVideoAdded(); String addedVideoTitle = specialVideos.getNewestVideoTitle(); specialVideos.deleteNewestVideo(); Assertion.assertTrue(specialVideos.getBannerNotifications().isNotificationMessageVisible(), "Banner notification is not visible"); Assertion.assertNotEquals(specialVideos.getNewestVideoTitle(), addedVideoTitle, "Video is still visible as newest video"); }
Source:
public void filterTextFieldColor_invalidFilter_invalidFilterStyleApplied(){ FilterTextField field = getFirstPanelField(); clearField(); type("is:-open"); assertTrue(field.getStyle().contains(INVALID_FILTER_STYLE)); clearField(); type("--"); assertTrue(field.getStyle().contains(INVALID_FILTER_STYLE)); clearField(); type("is:-open & has:assignee"); assertTrue(field.getStyle().contains(INVALID_FILTER_STYLE)); clearField(); type("(is:closed"); assertTrue(field.getStyle().contains(INVALID_FILTER_STYLE)); clearField(); type("is:invalid").push(KeyCode.ENTER); assertTrue(field.getStyle().contains(INVALID_FILTER_STYLE)); clearField(); type("is:invalid & hello").push(KeyCode.ENTER); assertTrue(field.getStyle().contains(INVALID_FILTER_STYLE)); }

Target:
public void filterTextFieldColor_invalidFilter_invalidFilterStyleApplied(){ testInvalidFilterStyleApplied("is:-open"); testInvalidFilterStyleApplied("--"); testInvalidFilterStyleApplied("("); testInvalidFilterStyleApplied("incomplete &"); testInvalidFilterStyleAppliedAfterEnter("is:invalid"); }
Source:
public void subscribeToConnection(ConnectionSubscriber subscriber) { BufferedReader receiver = null; try { receiver = new BufferedReader( new InputStreamReader(mSocket.getInputStream())); } catch (IOException e) { subscriber.updateOnConnectionProblem(e); } if(receiver != null) { while (!mSocket.isInputShutdown()) { try { String pushMessage = receiver.readLine(); Response response = new Response(pushMessage); subscriber.updateOn(response); } catch (IOException e) { subscriber.updateOnConnectionProblem(e); Log.d("DEBUG", e.getMessage()); } catch (JSONException e) { subscriber.updateOnParsingProblem(e); Log.d("DEBUG", e.getMessage()); } } } }

Target:
public void subscribeToConnection(ConnectionSubscriber subscriber) { BufferedReader receiver = null; try { receiver = new BufferedReader( new InputStreamReader(mSocket.getInputStream())); } catch (IOException e) { subscriber.updateOnConnectionProblem(e); } if(receiver != null) { while (!mSocket.isInputShutdown()) { try { String pushMessage = receiver.readLine(); Response response = new Response(pushMessage); subscriber.updateOn(response); } catch (IOException e) { subscriber.updateOnConnectionProblem(e); } catch (JSONException e) { subscriber.updateOnParsingProblem(e); } } } }
Source:
public void clickOpenPinTitle() { waitForElementVisibleByElement(mapFrame); driver.switchTo().frame(mapFrame); poiArticleLink.click(); }

Target:
public void clickOpenPinTitle() { waitForElementVisibleByElement(mapFrame); driver.switchTo().frame(mapFrame); poiArticleLink.click(); driver.switchTo().defaultContent(); }
Source:
public PagedResources<JobDefinitionResource> list(Pageable pageable, PagedResourcesAssembler<JobDefinition> assembler) { PagedResources<JobDefinitionResource> pagedResources = listValues(pageable, assembler); final List<JobDefinitionResource> maskedContents = new ArrayList<JobDefinitionResource>( pagedResources.getContent().size()); for (JobDefinitionResource jobDefinitionResource : pagedResources.getContent()) { jobDefinitionResource.getDefinition(); JobDefinitionResource maskedJobDefinitionResource = new JobDefinitionResource(jobDefinitionResource.getName(), StreamUtils.maskPasswordsInStreamDefinition(jobDefinitionResource.getDefinition())); maskedJobDefinitionResource.setDeployed(jobDefinitionResource.isDeployed()); maskedContents.add(maskedJobDefinitionResource); } return new PagedResources<JobDefinitionResource>(maskedContents, pagedResources.getMetadata(), pagedResources.getLinks()); }

Target:
public PagedResources<JobDefinitionResource> list(Pageable pageable, PagedResourcesAssembler<JobDefinition> assembler) { PagedResources<JobDefinitionResource> pagedResources = listValues(pageable, assembler); final List<JobDefinitionResource> maskedContents = new ArrayList<JobDefinitionResource>( pagedResources.getContent().size()); for (JobDefinitionResource jobDefinitionResource : pagedResources.getContent()) { jobDefinitionResource.getDefinition(); JobDefinitionResource maskedJobDefinitionResource = new JobDefinitionResource(jobDefinitionResource.getName(), PasswordUtils.maskPasswordsInDefinition(jobDefinitionResource.getDefinition())); maskedJobDefinitionResource.setDeployed(jobDefinitionResource.isDeployed()); maskedContents.add(maskedJobDefinitionResource); } return new PagedResources<JobDefinitionResource>(maskedContents, pagedResources.getMetadata(), pagedResources.getLinks()); }
Source:
protected void acceptRows( List<T> rows ) { try { acceptingRowsSemaphore.acquire(); waitForSubscribers(); for ( T row : rows ) { streamStep.getSubtransExecutor().acquireBufferPermit(); streamStep.incrementLinesInput(); publishProcessor.onNext( row ); } } catch ( InterruptedException e ) { logChannel .logError( getString( PKG, "BlockingQueueStream.AcceptRowsInterrupt", Arrays.toString( rows.toArray() ) ) ); } finally { acceptingRowsSemaphore.release(); } }

Target:
protected void acceptRows( List<T> rows ) { try { acceptingRowsSemaphore.acquire(); waitForSubscribers(); for ( T row : rows ) { streamStep.getSubtransExecutor().acquireBufferPermit(); streamStep.incrementLinesInput(); publishProcessor.onNext( row ); } } catch ( InterruptedException e ) { logChannel .logError( getString( PKG, "BlockingQueueStream.AcceptRowsInterrupt", Arrays.toString( rows.toArray() ) ) ); Thread.currentThread().interrupt(); } finally { acceptingRowsSemaphore.release(); } }
Source:
public MarketDataRequirements requirements() { CalculationRequirements calculationRequirements = function.requirements(target); MarketDataRequirementsBuilder requirementsBuilder = MarketDataRequirements.builder(); calculationRequirements.getTimeSeriesRequirements().stream() .map(marketDataMappings::getIdForObservableKey) .forEach(requirementsBuilder::timeSeries); for (MarketDataKey<?> key : calculationRequirements.getSingleValueRequirements()) { MarketDataId<?> id; if (key instanceof ObservableKey) { id = marketDataMappings.getIdForObservableKey((ObservableKey) key); } else { id = marketDataMappings.getIdForKey(key); } requirementsBuilder.values(id); } return requirementsBuilder.build(); }

Target:
public MarketDataRequirements requirements() { CalculationRequirements calculationRequirements = function.requirements(target); MarketDataRequirementsBuilder requirementsBuilder = MarketDataRequirements.builder(); calculationRequirements.getTimeSeriesRequirements().stream() .map(marketDataMappings::getIdForObservableKey) .forEach(requirementsBuilder::timeSeries); for (MarketDataKey<?> key : calculationRequirements.getSingleValueRequirements()) { requirementsBuilder.values(marketDataMappings.getIdForKey(key)); } return requirementsBuilder.build(); }
Source:
public Point computeSize (int wHint, int hHint, boolean changed) { checkWidget (); boolean visible = getVisible(); if (OS.GTK3 && !visible) { setVisible(true); } int width = 0, height = 0; String[] items = list.getItems (); GC gc = new GC (text); int spacer = gc.stringExtent (" ").x; int textWidth = gc.stringExtent (text.getText ()).x; for (int i = 0; i < items.length; i++) { textWidth = Math.max (gc.stringExtent (items[i]).x, textWidth); } gc.dispose (); Point textSize = text.computeSize (SWT.DEFAULT, SWT.DEFAULT, changed); Point arrowSize = arrow.computeSize (SWT.DEFAULT, SWT.DEFAULT, changed); Point listSize = list.computeSize (SWT.DEFAULT, SWT.DEFAULT, changed); int borderWidth = getBorderWidth (); height = Math.max (textSize.y, arrowSize.y); width = Math.max (textWidth + 2*spacer + arrowSize.x + 2*borderWidth, listSize.x); if (wHint != SWT.DEFAULT) width = wHint; if (hHint != SWT.DEFAULT) height = hHint; if (OS.GTK3) { setVisible(visible); } return new Point (width + 2*borderWidth, height + 2*borderWidth); }

Target:
public Point computeSize (int wHint, int hHint, boolean changed) { checkWidget (); boolean visible = getVisible(); if (SWT.getPlatform().equals("gtk") && !visible) { setVisible(true); } int width = 0, height = 0; String[] items = list.getItems (); GC gc = new GC (text); int spacer = gc.stringExtent (" ").x; int textWidth = gc.stringExtent (text.getText ()).x; for (int i = 0; i < items.length; i++) { textWidth = Math.max (gc.stringExtent (items[i]).x, textWidth); } gc.dispose (); Point textSize = text.computeSize (SWT.DEFAULT, SWT.DEFAULT, changed); Point arrowSize = arrow.computeSize (SWT.DEFAULT, SWT.DEFAULT, changed); Point listSize = list.computeSize (SWT.DEFAULT, SWT.DEFAULT, changed); int borderWidth = getBorderWidth (); height = Math.max (textSize.y, arrowSize.y); width = Math.max (textWidth + 2*spacer + arrowSize.x + 2*borderWidth, listSize.x); if (wHint != SWT.DEFAULT) width = wHint; if (hHint != SWT.DEFAULT) height = hHint; if (SWT.getPlatform().equals("gtk")) { setVisible(visible); } return new Point (width + 2*borderWidth, height + 2*borderWidth); }
Source:
private List<DiscoveryEnabledServer> loadListOfServers() { if (Eureka2Clients.isPreferEureka2()) { return eureka2ServerList.getUpdatedListOfServers(); } return eureka1ServerList.getUpdatedListOfServers(); }

Target:
private List<DiscoveryEnabledServer> loadListOfServers() { if (Eureka2Clients.isUseEureka2()) { if (eureka2ServerListRef.get() == null) { synchronized (eureka2ServerListRef) { Eureka2EnabledNIWSServerList eureka2ServerList = new Eureka2EnabledNIWSServerList(); eureka2ServerList.initWithNiwsConfig(clientConfig); eureka2ServerListRef.set(eureka2ServerList); } } return eureka2ServerListRef.get().getUpdatedListOfServers(); } Eureka2EnabledNIWSServerList eureka2ServerList = eureka2ServerListRef.getAndSet(null); if (eureka2ServerList != null) { eureka2ServerList.shutdown(); } return eureka1ServerList.getUpdatedListOfServers(); }
Source:
public long getPositionsSizeInBytes(boolean[] positions) { checkValidPositions(positions, getPositionCount()); int usedPositionCount = 0; long sizeInBytes = 0; for (int i = 0; i < positions.length; i++) { if (positions[i]) { usedPositionCount++; int startFieldBlockOffset = getFieldBlockOffset(i); int endFieldBlockOffset = getFieldBlockOffset(i + 1); int fieldBlockLength = endFieldBlockOffset - startFieldBlockOffset; for (int j = 0; j < numFields; j++) { sizeInBytes += getRawFieldBlocks()[j].getRegionSizeInBytes(startFieldBlockOffset, fieldBlockLength); } } } return sizeInBytes + (Integer.BYTES + Byte.BYTES) * (long) usedPositionCount; }

Target:
public long getPositionsSizeInBytes(boolean[] positions) { checkValidPositions(positions, getPositionCount()); int usedPositionCount = 0; boolean[] fieldPositions = new boolean[getRawFieldBlocks()[0].getPositionCount()]; for (int i = 0; i < positions.length; i++) { if (positions[i]) { usedPositionCount++; int startFieldBlockOffset = getFieldBlockOffset(i); int endFieldBlockOffset = getFieldBlockOffset(i + 1); for (int j = startFieldBlockOffset; j < endFieldBlockOffset; j++) { fieldPositions[j] = true; } } } long sizeInBytes = 0; for (int j = 0; j < numFields; j++) { sizeInBytes += getRawFieldBlocks()[j].getPositionsSizeInBytes(fieldPositions); } return sizeInBytes + (Integer.BYTES + Byte.BYTES) * (long) usedPositionCount; }
Source:
protected void onStart() { super.onStart(); subscription = LifecycleObservable.bindActivityLifecycle(this, ViewObservable.clicks(button)) .subscribe(new Action1<OnClickEvent>() { @Override public void call(OnClickEvent onClickEvent) { Toast.makeText(LifecycleObservableActivityComposition.this, "Clicked button!", Toast.LENGTH_SHORT) .show(); } }); }

Target:
protected void onStart() { super.onStart(); subscription = LifecycleObservable.bindActivityUntilLifecycle(this, ViewObservable.clicks(button), LifecycleEvent.STOP) .subscribe(new Action1<OnClickEvent>() { @Override public void call(OnClickEvent onClickEvent) { Toast.makeText(LifecycleObservableActivityComposition.this, "Clicked button!", Toast.LENGTH_SHORT) .show(); } }); }
Source:
public @ResponseBody Map<String, String> getStatus() { if(updateSearchIndexAsync == null) throw new APIException("There was a problem rebuilding the search index"); Map<String, String> results = new HashMap<>(); if (updateSearchIndexAsync.isDone()) { results.put("status", updateSearchIndexAsync.isCancelled() ? "error" : "success"); updateSearchIndexAsync = null; } else results.put("status", "inProgress"); return results; }

Target:
public @ResponseBody Map<String, String> getStatus() { if (updateSearchIndexAsync == null) { throw new APIException("There was a problem rebuilding the search index"); } Map<String, String> results = new HashMap<>(); if (updateSearchIndexAsync.isDone()) { results.put("status", updateSearchIndexAsync.isCancelled() ? "error" : "success"); updateSearchIndexAsync = null; } else { results.put("status", "inProgress"); } return results; }
Source:
public void setUp() throws IOException, RyaDAOException{ client = MockMongoSingleton.getInstance(); client.dropDatabase(DB_NAME); conf = new MongoDBRdfConfiguration(); conf.set(MongoDBRdfConfiguration.MONGO_DB_NAME, DB_NAME); conf.set(MongoDBRdfConfiguration.MONGO_COLLECTION_PREFIX, "rya_"); conf.set(RdfCloudTripleStoreConfiguration.CONF_TBL_PREFIX, "rya_"); conf.setAuths("A", "B", "C"); conf.setMongoClient(client); dao = new MongoDBRyaDAO(conf, client); }

Target:
public void setUp() throws IOException, RyaDAOException{ conf.setAuths("A", "B", "C"); client = super.getMongoClient(); dao = new MongoDBRyaDAO(conf, client); }
Source:
private String getBrowserColorDepth(EpdqOrderRequestBuilder.EpdqTemplateData templateData) { String browserColorDepth = templateData.getAuthCardDetails().getJsScreenColorDepth().orElse("24"); return VALID_SCREEN_COLOR_DEPTHS.contains(browserColorDepth) ? browserColorDepth : "24"; }

Target:
private String getBrowserColorDepth(EpdqOrderRequestBuilder.EpdqTemplateData templateData) { return templateData.getAuthCardDetails().getJsScreenColorDepth() .filter(VALID_SCREEN_COLOR_DEPTHS::contains).orElse(DEFAULT_BROWSER_COLOR_DEPTH); }
Source:
public void trade() { Set<String> set = buyOrders.keySet(); for(String key: set){ Collections.sort( buyOrders.get(key)); } Set<String> set2 = sellOrders.keySet(); for(String key: set2){ Collections.sort( sellOrders.get(key)); } for(String bkey:set){ if(set2.contains(bkey)){ ArrayList<Order> bl = buyOrders.get(bkey); ArrayList<Order> temp = new ArrayList<Order>(); for(Order o : bl){ if(o.isMarketOrder()){ temp.add(o); }else{ break; } } for(Order o: temp){ bl.remove(o); bl.add(o); } int sellCumulative = 0; int buyCumulative = 0; double sellPrice = 0; ArrayList<Order> sl = sellOrders.get(bkey); for (int i = 0; i < sl.size(); i++){ sellCumulative += sl.get(i).getSize(); buyCumulative += bl.get(bl.size()-i-1).getSize(); if (buyCumulative >= sellCumulative ){ sellPrice = sl.get(i).getPrice(); break; } } PriceSetter ps = null; if(sellPrice != 0){ ps = new PriceSetter(); m.getMarketHistory().setSubject(ps); ps.registerObserver(m.getMarketHistory()); ps.setNewPrice(m, set2.toArray()[0].toString(), sellPrice); }else{ return; } for(Order order : sl){ try { order.getTrader().tradePerformed(order, sellPrice); } catch (StockMarketExpection e) { e.printStackTrace(); } } sl.clear(); for(Order order : bl){ try { order.getTrader().tradePerformed(order, sellPrice); } catch (StockMarketExpection e) { e.printStackTrace(); } } bl.clear(); ps.unRegisterObserver(m.getMarketHistory()); } } }

Target:
public void trade() { Set<String> buySet = buyOrders.keySet(); for(String key: buySet){ Collections.sort( buyOrders.get(key)); } Set<String> set2 = sellOrders.keySet(); for(String key: set2){ Collections.sort( sellOrders.get(key)); } for(String bkey:buySet){ if(set2.contains(bkey)){ ArrayList<Order> bl = buyOrders.get(bkey); ArrayList<Order> temp = new ArrayList<Order>(); for(Order o : bl){ if(o.isMarketOrder()){ temp.add(o); }else{ break; } } for(Order o: temp){ bl.remove(o); bl.add(o); } int sellCumulative = 0; int buyCumulative = 0; double sellPrice = 0; ArrayList<Order> sl = sellOrders.get(bkey); for (int i = 0; i < sl.size(); i++){ sellCumulative += sl.get(i).getSize(); buyCumulative += bl.get(bl.size()-i-1).getSize(); if (buyCumulative >= sellCumulative ){ sellPrice = sl.get(i).getPrice(); break; } } PriceSetter ps = null; if(sellPrice != 0){ ps = new PriceSetter(); market.getMarketHistory().setSubject(ps); ps.registerObserver(market.getMarketHistory()); ps.setNewPrice(m, set2.toArray()[0].toString(), sellPrice); }else{ return; } for(Order order : sl){ try { order.getTrader().tradePerformed(order, sellPrice); } catch (StockMarketExpection e) { e.printStackTrace(); } } sl.clear(); for(Order order : bl){ try { order.getTrader().tradePerformed(order, sellPrice); } catch (StockMarketExpection e) { e.printStackTrace(); } } bl.clear(); ps.unRegisterObserver(market.getMarketHistory()); } } }
Source:
public static File getPhotoCacheDir(Context context, String cacheName) { File cacheDir = context.getCacheDir(); if (cacheDir != null) { File result = new File(cacheDir, cacheName); if (!result.mkdirs() && (!result.exists() || !result.isDirectory())) { throw new IllegalStateException("Cannot create cache directory structure for " + result); } return result; } if (Log.isLoggable(TAG, Log.ERROR)) { Log.e(TAG, "default disk cache dir is null"); } return null; }

Target:
public static File getPhotoCacheDir(Context context, String cacheName) { File cacheDir = context.getCacheDir(); if (cacheDir != null) { File result = new File(cacheDir, cacheName); if (!result.mkdirs() && (!result.exists() || !result.isDirectory())) { return null; } return result; } if (Log.isLoggable(TAG, Log.ERROR)) { Log.e(TAG, "default disk cache dir is null"); } return null; }
Source:
public Block getBlock(int[] positions, int positionCount) { checkArgument(outputPositionCount > 0, "outputPositionCount must be greater than zero"); checkState(outputRequired, "This stream reader doesn't produce output"); checkState(positionCount <= outputPositionCount, "Not enough values"); if (allNulls) { return new RunLengthEncodedBlock(outputType.createBlockBuilder(null, 1).appendNull().build(), outputPositionCount); } boolean includeNulls = nullsAllowed && presentStream != null; if (positionCount == outputPositionCount) { Block block = new VariableWidthBlock(positionCount, slice, offsetVector, Optional.ofNullable(includeNulls ? nulls : null)); nulls = null; offsetVector = null; data = null; slice = null; return block; } boolean[] nullsCopy = null; if (includeNulls) { nullsCopy = new boolean[positionCount]; } compactData(positions, positionCount, includeNulls, nullsCopy); Block block = new VariableWidthBlock(positionCount, slice, offsetVector, Optional.ofNullable(includeNulls ? nullsCopy : null)); nulls = null; offsetVector = null; return block; }

Target:
public Block getBlock(int[] positions, int positionCount) { checkArgument(outputPositionCount > 0, "outputPositionCount must be greater than zero"); checkState(outputRequired, "This stream reader doesn't produce output"); checkState(positionCount <= outputPositionCount, "Not enough values"); checkState(!valuesInUse, "BlockLease hasn't been closed yet"); if (allNulls) { return new RunLengthEncodedBlock(outputType.createBlockBuilder(null, 1).appendNull().build(), outputPositionCount); } boolean includeNulls = nullsAllowed && presentStream != null; if (positionCount != outputPositionCount) { compactValues(positions, positionCount, includeNulls); } Block block = new VariableWidthBlock(positionCount, dataAsSlice, offsets, Optional.ofNullable(includeNulls ? nulls : null)); dataAsSlice = null; data = null; offsets = null; nulls = null; return block; }
Source:
protected CONNECTCXFClient(ServicePortDescriptor<T> portDescriptor, String url, AssertionType assertion, ServicePortBuilder<T> portBuilder) { serviceEndpoint = super.configureBasePort(portBuilder.createPort(), url, assertion != null ? assertion.getTransactionTimeout() : null); configCNCheck(); }

Target:
protected CONNECTCXFClient(ServicePortDescriptor<T> portDescriptor, String url, AssertionType assertion, ServicePortBuilder<T> portBuilder) { serviceEndpoint = super.configureBasePort(portBuilder.createPort(), url, assertion != null ? assertion.getTransactionTimeout() : null); }
Source:
private void configureTimeSlotParametersStartingFromIndex(int index, Object[] policyParameters) { try { this.acquireTime = policyParameters[index++].toString(); this.releaseTime = policyParameters[index++].toString(); DATE_FORMAT.parse(this.acquireTime); DATE_FORMAT.parse(this.releaseTime); if (policyParameters[index++].toString().length() > 0) { this.period = Long.parseLong(policyParameters[index - 1].toString()); if (this.period < 0) { throw new RMException("Period cannot be less than zero"); } } else { this.period = 0L; } this.preemptive = Boolean.parseBoolean(policyParameters[index].toString()); } catch (Throwable t) { throw new IllegalArgumentException(t); } }

Target:
private void configureTimeSlotParametersStartingFromIndex(int index, Object[] policyParameters) { try { this.acquireTime = policyParameters[index++].toString(); this.releaseTime = policyParameters[index++].toString(); DATE_FORMAT.parse(this.acquireTime); DATE_FORMAT.parse(this.releaseTime); if (!policyParameters[index++].toString().isEmpty()) { this.period = Long.parseLong(policyParameters[index - 1].toString()); if (this.period < 0) { throw new RMException("Period cannot be less than zero"); } } else { this.period = 0L; } this.preemptive = Boolean.parseBoolean(policyParameters[index].toString()); } catch (Throwable t) { throw new IllegalArgumentException(t); } }
Source:
public void onResponse(ReplicaId replicaId, TrackedRequestFinalState trackedRequestFinalState) { if (respondedReplicas.contains(replicaId)) { return; } respondedReplicas.add(replicaId); inflightCount--; if (trackedRequestFinalState == TrackedRequestFinalState.SUCCESS) { succeededCount++; } else { failedCount++; if (trackedRequestFinalState == TrackedRequestFinalState.NOT_FOUND && replicaId.getDataNodeId() .getDatacenterName() .equals(this.originatingDcName)) { originatingDcNotFoundCount++; } } }

Target:
public void onResponse(ReplicaId replicaId, TrackedRequestFinalState trackedRequestFinalState) { inflightCount--; if (trackedRequestFinalState == TrackedRequestFinalState.SUCCESS) { succeededCount++; } else { failedCount++; if (trackedRequestFinalState == TrackedRequestFinalState.NOT_FOUND && replicaId.getDataNodeId() .getDatacenterName() .equals(originatingDcName)) { originatingDcNotFoundCount++; } } }
Source:
public void addSteps(MigrationStepRegistry registry) { registry .add(1700, "Drop table AUTHORS", DropTableAuthors.class) .add(1701, "Clean orphans from USER_ROLES", CleanOrphanRowsInUserRoles.class) .add(1702, "Clean orphans from GROUP_ROLES", CleanOrphanRowsInGroupRoles.class) .add(1703, "Populate EVENTS.COMPONENT_UUID", PopulateEventsComponentUuid.class) .add(1704, "Drop index EVENTS_COMPONENT_UUID", DropIndexEventsComponentUuid.class) .add(1705, "Make EVENTS.COMPONENT_UUID not nullable", MakeEventsComponentUuidNotNullable.class) .add(1706, "Recreate index EVENTS_COMPONENT_UUID", RecreateIndexEventsComponentUuid.class) .add(1707, "Ensure ISSUE.PROJECT_UUID is consistent", EnsureIssueProjectUuidConsistencyOnIssues.class) .add(1708, "Clean orphans from PROJECT_LINKS", CleanOrphanRowsInProjectLinks.class) .add(1709, "Clean orphans from SETTINGS", CleanOrphanRowsInProperties.class); }

Target:
public void addSteps(MigrationStepRegistry registry) { registry .add(1700, "Drop table AUTHORS", DropTableAuthors.class) .add(1701, "Clean orphans from USER_ROLES", CleanOrphanRowsInUserRoles.class) .add(1702, "Clean orphans from GROUP_ROLES", CleanOrphanRowsInGroupRoles.class) .add(1703, "Populate EVENTS.COMPONENT_UUID", PopulateEventsComponentUuid.class) .add(1704, "Drop index EVENTS_COMPONENT_UUID", DropIndexEventsComponentUuid.class) .add(1705, "Make EVENTS.COMPONENT_UUID not nullable", MakeEventsComponentUuidNotNullable.class) .add(1706, "Recreate index EVENTS_COMPONENT_UUID", RecreateIndexEventsComponentUuid.class) .add(1707, "Ensure ISSUE.PROJECT_UUID is consistent", EnsureIssueProjectUuidConsistencyOnIssues.class) .add(1708, "Clean orphans from PROJECT_LINKS", CleanOrphanRowsInProjectLinks.class) .add(1709, "Clean orphans from SETTINGS", CleanOrphanRowsInProperties.class) .add(1710, "Clean orphans from MANUAL_MEASURES", CleanOrphanRowsInManualMeasures.class) .add(1711, "Drop index MANUAL_MEASURES.COMPONENT_UUID", DropIndexManualMeasuresComponentUuid.class) .add(1712, "Make MANUAL_MEASURES.COMPONENT_UUID not nullable", MakeManualMeasuresComponentUuidNotNullable.class) .add(1713, "Recreate index MANUAL_MEASURES.COMPONENT_UUID", RecreateIndexManualMeasuresComponentUuid.class) ; }