auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testDeepCloning() { FridgeDTO in = createFridgeDTO(); FridgeDTO out = CloningMapper.INSTANCE.clone( in ); assertThat( out ).isNotNull(); assertThat( out.getShelve() ).isNotNull(); assertThat( out.getShelve() ).isNotEqualTo( in.getShelve() ); assertThat( out.getShelve().getCoolBeer() ).isNotEqualTo( in.getShelve().getCoolBeer() ); assertThat( out.getShelve().getCoolBeer().getBeerCount() ).isEqualTo( "5" ); }

Target:
public void testDeepCloning() { FridgeDTO in = createFridgeDTO(); FridgeDTO out = CloningMapper.INSTANCE.clone( in ); assertThat( out ).isNotNull(); assertThat( out.getShelve() ).isNotNull(); assertThat( out.getShelve() ).isNotSameAs( in.getShelve() ); assertThat( out.getShelve().getCoolBeer() ).isNotSameAs( in.getShelve().getCoolBeer() ); assertThat( out.getShelve().getCoolBeer().getBeerCount() ).isEqualTo( "5" ); }
Source:
private void removeImageFromDB() { final DiskImage diskImage = getDiskImage(); final List<Snapshot> updatedSnapshots; final boolean shouldPerformOpOnVmSnapshots = !diskImage.isShareable(); try { if (shouldPerformOpOnVmSnapshots) { VM vm = getVmForNonShareableDiskImage(diskImage); lockVmSnapshotsWithWait(vm); updatedSnapshots = prepareSnapshotConfigWithoutImage(diskImage.getId()); } else { updatedSnapshots = Collections.emptyList(); } TransactionSupport.executeInScope(TransactionScopeOption.Required, new TransactionMethod<Object>() { @Override public Object runInTransaction() { getDiskImageDynamicDAO().remove(diskImage.getImageId()); Guid imageTemplate = diskImage.getit_guid(); Guid currentGuid = diskImage.getImageId(); while (!currentGuid.equals(imageTemplate) && !currentGuid.equals(Guid.Empty)) { RemoveChildren(currentGuid); DiskImage image = getDiskImageDao().getSnapshotById(currentGuid); if (image != null) { RemoveSnapshot(image); currentGuid = image.getParentId(); } else { currentGuid = Guid.Empty; log.warnFormat( "'image' (snapshot of image '{0}') is null, cannot remove it.", diskImage.getImageId()); } } getBaseDiskDao().remove(diskImage.getId()); getVmDeviceDAO().remove(new VmDeviceId(diskImage.getId(), null)); for (Snapshot s : updatedSnapshots) { getSnapshotDao().update(s); } return null; } }); } finally { if (shouldPerformOpOnVmSnapshots) { freeVmSnapshotsLock(); } } }

Target:
private void removeImageFromDB() { final DiskImage diskImage = getDiskImage(); final List<Snapshot> updatedSnapshots; final boolean shouldPerformOpOnVmSnapshots = !diskImage.isShareable() && getParameters().getParentCommand() != VdcActionType.RemoveVm; try { if (shouldPerformOpOnVmSnapshots) { VM vm = getVmForNonShareableDiskImage(diskImage); lockVmSnapshotsWithWait(vm); updatedSnapshots = prepareSnapshotConfigWithoutImage(diskImage.getId()); } else { updatedSnapshots = Collections.emptyList(); } TransactionSupport.executeInScope(TransactionScopeOption.Required, new TransactionMethod<Object>() { @Override public Object runInTransaction() { getDiskImageDynamicDAO().remove(diskImage.getImageId()); Guid imageTemplate = diskImage.getit_guid(); Guid currentGuid = diskImage.getImageId(); while (!currentGuid.equals(imageTemplate) && !currentGuid.equals(Guid.Empty)) { RemoveChildren(currentGuid); DiskImage image = getDiskImageDao().getSnapshotById(currentGuid); if (image != null) { RemoveSnapshot(image); currentGuid = image.getParentId(); } else { currentGuid = Guid.Empty; log.warnFormat( "'image' (snapshot of image '{0}') is null, cannot remove it.", diskImage.getImageId()); } } getBaseDiskDao().remove(diskImage.getId()); getVmDeviceDAO().remove(new VmDeviceId(diskImage.getId(), null)); for (Snapshot s : updatedSnapshots) { getSnapshotDao().update(s); } return null; } }); } finally { if (snapshotsEngineLock != null) { getLockManager().releaseLock(snapshotsEngineLock); } } }
Source:
public boolean flush(K key, ValueHolder<V> valueHolder, CachingTier<K, V> cachingTier) { int hash = hash(key.hashCode()); return segmentFor(hash).flush(key, hash, (DiskValueHolder<V>) valueHolder, cachingTier); }

Target:
public boolean flush(K key, ValueHolder<V> valueHolder, CachingTier<K, V> cachingTier) { if (valueHolder instanceof DiskValueHolder) { throw new IllegalArgumentException("Value holder must be of a class coming from the caching tier"); } int hash = hash(key.hashCode()); return segmentFor(hash).flush(key, hash, valueHolder, cachingTier); }
Source:
public InstallPackageDialog( PackageInstallContext installContext, PackageInstallOptions defaultInstallOptions, PackagesServerOperations server, GlobalDisplay globalDisplay, OperationWithInput<PackageInstallRequest> operation) { super("Install Packages", operation); installContext_ = installContext; defaultInstallOptions_ = defaultInstallOptions; server_ = server; globalDisplay_ = globalDisplay; RStudioThemes.disableDarkMenus(); setOkButtonCaption("Install"); }

Target:
public InstallPackageDialog( PackageInstallContext installContext, PackageInstallOptions defaultInstallOptions, PackagesServerOperations server, GlobalDisplay globalDisplay, OperationWithInput<PackageInstallRequest> operation) { super("Install Packages", operation); installContext_ = installContext; defaultInstallOptions_ = defaultInstallOptions; server_ = server; globalDisplay_ = globalDisplay; setOkButtonCaption("Install"); }
Source:
AssignmentConfigs(final Long acceptableRecoveryLag, final Integer maxWarmupReplicas, final Integer numStandbyReplicas, final Long probingRebalanceIntervalMs) { if (maxWarmupReplicas < 1) { throw new IllegalArgumentException("must configure at least one warmup replica"); } this.acceptableRecoveryLag = acceptableRecoveryLag; this.maxWarmupReplicas = maxWarmupReplicas; this.numStandbyReplicas = numStandbyReplicas; this.probingRebalanceIntervalMs = probingRebalanceIntervalMs; }

Target:
AssignmentConfigs(final Long acceptableRecoveryLag, final Integer maxWarmupReplicas, final Integer numStandbyReplicas, final Long probingRebalanceIntervalMs) { this.acceptableRecoveryLag = validated(StreamsConfig.ACCEPTABLE_RECOVERY_LAG_CONFIG, acceptableRecoveryLag); this.maxWarmupReplicas = validated(StreamsConfig.MAX_WARMUP_REPLICAS_CONFIG, maxWarmupReplicas); this.numStandbyReplicas = validated(StreamsConfig.NUM_STANDBY_REPLICAS_CONFIG, numStandbyReplicas); this.probingRebalanceIntervalMs = validated(StreamsConfig.PROBING_REBALANCE_INTERVAL_MS_CONFIG, probingRebalanceIntervalMs); }
Source:
private List<ExecutionState> evaluateCondition(ExecutionState executionState, ExpressionTree tree) { List<ExecutionState> result = new ArrayList<>(); ExpressionTree expressionTree = removeCastAndParenthesis(tree); if (expressionTree.is(Tree.Kind.CONDITIONAL_AND)) { evaluateConditionConditionalAnd(result, executionState, (BinaryExpressionTree) expressionTree); } else if (expressionTree.is(Tree.Kind.CONDITIONAL_OR)) { evaluateConditionConditionalOr(result, executionState, (BinaryExpressionTree) expressionTree); } else if (expressionTree.is(Tree.Kind.EQUAL_TO)) { evaluateConditionRelationalOperator(result, executionState, (BinaryExpressionTree) expressionTree, SymbolicRelation.EQUAL_TO); } else if (expressionTree.is(Tree.Kind.GREATER_THAN)) { evaluateConditionRelationalOperator(result, executionState, (BinaryExpressionTree) expressionTree, SymbolicRelation.GREATER_THAN); } else if (expressionTree.is(Tree.Kind.GREATER_THAN_OR_EQUAL_TO)) { evaluateConditionRelationalOperator(result, executionState, (BinaryExpressionTree) expressionTree, SymbolicRelation.GREATER_EQUAL); } else if (expressionTree.is(Tree.Kind.LESS_THAN)) { evaluateConditionRelationalOperator(result, executionState, (BinaryExpressionTree) expressionTree, SymbolicRelation.LESS_THAN); } else if (expressionTree.is(Tree.Kind.LESS_THAN_OR_EQUAL_TO)) { evaluateConditionRelationalOperator(result, executionState, (BinaryExpressionTree) expressionTree, SymbolicRelation.LESS_EQUAL); } else if (expressionTree.is(Tree.Kind.NOT_EQUAL_TO)) { evaluateConditionRelationalOperator(result, executionState, (BinaryExpressionTree) expressionTree, SymbolicRelation.NOT_EQUAL); } else if (expressionTree.is(Tree.Kind.IDENTIFIER)) { evaluateConditionIdentifier(result, executionState, ((IdentifierTree) expressionTree).symbol()); } else if (isSuperOrThisMemberSelect(expressionTree)) { evaluateConditionIdentifier(result, executionState, ((MemberSelectExpressionTree) expressionTree).identifier().symbol()); } else { evaluateConditionOther(result, executionState, expressionTree); } return result; }

Target:
private List<ExecutionState> evaluateCondition(ExecutionState executionState, ExpressionTree tree) { List<ExecutionState> result = new ArrayList<>(); ExpressionTree expressionTree = removeCastAndParenthesis(tree); Tree.Kind kind = ((JavaTree) expressionTree).getKind(); SymbolicRelation relation = OPERATOR_TO_RELATION.get(kind); if (relation != null) { evaluateConditionRelationalOperator(result, executionState, (BinaryExpressionTree) expressionTree, relation); } else { switch (kind) { case CONDITIONAL_AND: evaluateConditionConditionalAnd(result, executionState, (BinaryExpressionTree) expressionTree); break; case CONDITIONAL_OR: evaluateConditionConditionalOr(result, executionState, (BinaryExpressionTree) expressionTree); break; case IDENTIFIER: evaluateConditionIdentifier(result, executionState, ((IdentifierTree) expressionTree).symbol()); break; default: evaluateConditionOther(result, executionState, expressionTree); break; } } return result; }
Source:
private void removeDeletedFromWireGraphProperty(final String pid) throws GwtKuraException { final ConfigurationAdmin configAdmin = ServiceLocator.getInstance().getService(ConfigurationAdmin.class); final WireHelperService wireHelperService = ServiceLocator.getInstance().getService(WireHelperService.class); try { final String filter = "(" + KURA_SERVICE_PID + "=" + pid + ")"; ServiceUtil.waitForService(filter, TIMEOUT, SECONDS); final String servicePid = wireHelperService.getServicePid(pid); if (servicePid == null) { return; } Configuration conf = configAdmin.getConfiguration(servicePid); if (conf == null) { return; } Dictionary<String, Object> props = conf.getProperties(); if (props != null) { props.remove(DELETED_WIRE_COMPONENT); conf.update(props); } } catch (final Exception exception) { throw new GwtKuraException(GwtKuraErrorCode.INTERNAL_ERROR, exception); } }

Target:
private void removeDeletedFromWireGraphProperty(final String pid) throws GwtKuraException { final ConfigurationAdmin configAdmin = ServiceLocator.getInstance().getService(ConfigurationAdmin.class); final WireHelperService wireHelperService = ServiceLocator.getInstance().getService(WireHelperService.class); try { final String filter = "(" + KURA_SERVICE_PID + "=" + pid + ")"; if (!ServiceUtil.waitForService(filter, TIMEOUT, SECONDS).isPresent()) { return; } final String servicePid = wireHelperService.getServicePid(pid); if (servicePid == null) { return; } Configuration conf = configAdmin.getConfiguration(servicePid); if (conf == null) { return; } Dictionary<String, Object> props = conf.getProperties(); if (props != null) { props.remove(DELETED_WIRE_COMPONENT); conf.update(props); } } catch (final Exception exception) { throw new GwtKuraException(GwtKuraErrorCode.INTERNAL_ERROR, exception); } }
Source:
public static PrePushHook prePush(Repository repo, PrintStream outputStream) { if (LFS.getInstance().isAvailable()) { PrePushHook hook = LFS.getInstance().getPrePushHook(repo, outputStream); if (hook != null) { if (hook.isNativeHookPresent()) { throw new IllegalStateException(MessageFormat .format(JGitText.get().lfsHookConflict, repo)); } return hook; } } return new PrePushHook(repo, outputStream); }

Target:
public static PrePushHook prePush(Repository repo, PrintStream outputStream) { if (LfsFactory.getInstance().isAvailable()) { PrePushHook hook = LfsFactory.getInstance().getPrePushHook(repo, outputStream); if (hook != null) { if (hook.isNativeHookPresent()) { throw new IllegalStateException(MessageFormat .format(JGitText.get().lfsHookConflict, repo)); } return hook; } } return new PrePushHook(repo, outputStream); }
Source:
public void write(@Nonnull IToken token, @Nonnull Object data, @Nonnull CacheOption cacheOption) { ILogData ld; if (data instanceof ILogData) { ld = (ILogData) data; } else { ld = new LogData(DataType.DATA, data); } ld.setPayloadCodecType(Codec.Type.valueOf(runtime.getParameters().getCodecType())); layoutHelper(e -> { Layout l = e.getLayout(); if (token.getEpoch() != l.getEpoch()) { throw new StaleTokenException(l.getEpoch()); } ld.useToken(token); ld.setId(runtime.getParameters().getClientId()); try { l.getReplicationMode(token.getSequence()) .getReplicationProtocol(runtime) .write(e, ld); } catch (OverwriteException ex) { if (ex.getOverWriteCause() == OverwriteCause.SAME_DATA){ validateStateOfWrittenEntry(token.getSequence(), ld); } else { throw ex; } } catch (WriteSizeException | QuotaExceededException ie) { log.warn("write: write failed", ie); throw ie; } catch (RuntimeException re) { log.error("write: Got exception during replication protocol write with token: {}", token, re); validateStateOfWrittenEntry(token.getSequence(), ld); } return null; }, true); if (cacheOption == CacheOption.WRITE_THROUGH) { readCache.put(token.getSequence(), ld); } }

Target:
public void write(@Nonnull IToken token, @Nonnull Object data, @Nonnull CacheOption cacheOption) { ILogData ld; if (data instanceof ILogData) { ld = (ILogData) data; } else { ld = new LogData(DataType.DATA, data, runtime.getParameters().getCodecType()); } layoutHelper(e -> { Layout l = e.getLayout(); if (token.getEpoch() != l.getEpoch()) { throw new StaleTokenException(l.getEpoch()); } ld.useToken(token); ld.setId(runtime.getParameters().getClientId()); try { l.getReplicationMode(token.getSequence()) .getReplicationProtocol(runtime) .write(e, ld); } catch (OverwriteException ex) { if (ex.getOverWriteCause() == OverwriteCause.SAME_DATA){ validateStateOfWrittenEntry(token.getSequence(), ld); } else { throw ex; } } catch (WriteSizeException | QuotaExceededException ie) { log.warn("write: write failed", ie); throw ie; } catch (RuntimeException re) { log.error("write: Got exception during replication protocol write with token: {}", token, re); validateStateOfWrittenEntry(token.getSequence(), ld); } return null; }, true); if (cacheOption == CacheOption.WRITE_THROUGH) { readCache.put(token.getSequence(), ld); } }
Source:
private static boolean isValidKey(final String s) { if (s == null) { return false; } if (s.equals(WILDCARD_VALUE)) { return true; } int lastIndex = s.length() - 1; if (!isValidKeyStartCharacter(s.charAt(0))) { return false; } for (int i = 1; i < lastIndex; i++) { if (!isValidKeyCharacter(s.charAt(i))) { return false; } } if (lastIndex > 0 && !isValidKeyEndCharacter(s.charAt(lastIndex))) { return false; } return true; }

Target:
private static boolean isValidKey(final String s) { if (s == null) { return false; } if (s.equals(WILDCARD_VALUE)) { return true; } int lastIndex = s.length() - 1; if (lastIndex == -1) { return false; } if (!isValidKeyStartCharacter(s.charAt(0))) { return false; } for (int i = 1; i < lastIndex; i++) { if (!isValidKeyCharacter(s.charAt(i))) { return false; } } if (lastIndex > 0 && !isValidKeyEndCharacter(s.charAt(lastIndex))) { return false; } return true; }
Source:
public boolean isColorImage(BufferedImage image, Color color, int accuracy) { int count = image.getHeight() * image.getWidth(); int diffCount = 0; for (int x = 0; x < image.getWidth(); x++) { for (int y = 0; y < image.getHeight(); y++) { Color pixelColor = new Color(image.getRGB(x,y)); if ( !colorsAreSimilar(pixelColor, color) ) { diffCount += 1; } } if (diffCount > ((100 - accuracy) * count) / 100D) { return false; } } return true; }

Target:
public boolean isColorImage(BufferedImage image, Color color, int accuracy) { int count = image.getHeight() * image.getWidth(); int diffCount = 0; for (int x = 0; x < image.getWidth(); x++) { for (int y = 0; y < image.getHeight(); y++) { Color pixelColor = new Color(image.getRGB(x,y)); if (!areColorsSimilar(pixelColor, color)) { diffCount += 1; } } if (diffCount > ((100 - accuracy) * count) / 100D) { return false; } } return true; }
Source:
public void pullsByDefault() { try ( GenericContainer<?> container = new GenericContainer(new DockerImageName(imageName)) .withStartupCheckStrategy(new OneShotStartupCheckStrategy()) ) { container.start(); } }

Target:
public void pullsByDefault() { try ( GenericContainer<?> container = new GenericContainer<>(imageName) .withStartupCheckStrategy(new OneShotStartupCheckStrategy()) ) { container.start(); } }
Source:
public Campaign(JSONObject jsonCampaign) { try { mId = jsonCampaign.getString("id"); } catch(JSONException e) { e.printStackTrace(); Log.d(TAG, "Couldn't extract id field"); mTitle = null; } try { mTitle = jsonCampaign.getString("title"); } catch (JSONException e) { e.printStackTrace(); Log.d(TAG, "Couldn't extract title field"); mTitle = "<No Title>"; } try { mDesription = jsonCampaign.getString("description"); } catch (JSONException e) { e.printStackTrace(); Log.d(TAG, "Couldn't extract description field"); mDesription = "<No Description>"; } }

Target:
public Campaign(JSONObject jsonCampaign) { try { mId = jsonCampaign.getString("id"); } catch(JSONException e) { e.printStackTrace(); Log.d(TAG, "Couldn't extract id field"); mId = null; } try { mTitle = jsonCampaign.getString("title"); } catch (JSONException e) { e.printStackTrace(); Log.d(TAG, "Couldn't extract title field"); mTitle = "<No Title>"; } try { mDesription = jsonCampaign.getString("description"); } catch (JSONException e) { e.printStackTrace(); Log.d(TAG, "Couldn't extract description field"); mDesription = "<No Description>"; } }
Source:
private void submitProcessTask(final CacheLoaderTask cacheLoaderTask, final KeyFilter filter, CompletionService ecs, final TaskContext taskContext, final List<Entry> batch, final boolean loadValues, final boolean loadMetadata) { ecs.submit(new Callable<Void>() { @Override public Void call() throws Exception { try { long now = ctx.getTimeService().wallClockTime(); for (Entry pair : batch) { if (taskContext.isStopped()) { break; } Object key = unmarshall(pair.key); if (filter == null || filter.accept(key)) { MarshalledEntry entry = loadValues || loadMetadata ? (MarshalledEntry) unmarshall(pair.value) : null; boolean isExpired = entry != null && entry.getMetadata() != null && entry.getMetadata().isExpired(now); if (!isExpired) { if (!loadValues || !loadMetadata) { entry = ctx.getMarshalledEntryFactory().newMarshalledEntry( key, loadValues ? entry.getValue() : null, loadMetadata ? entry.getMetadata() : null); } cacheLoaderTask.processEntry(entry, taskContext); } } } } catch (Exception e) { log.errorExecutingParallelStoreTask(e); throw e; } return null; } }); }

Target:
private void submitProcessTask(final CacheLoaderTask cacheLoaderTask, final KeyFilter filter, CompletionService ecs, final TaskContext taskContext, final List<Entry> batch, final boolean loadValues, final boolean loadMetadata) { ecs.submit(() -> { try { long now = ctx.getTimeService().wallClockTime(); for (Entry pair : batch) { if (taskContext.isStopped()) { break; } Object key = unmarshall(pair.key); if (filter == null || filter.accept(key)) { MarshalledEntry entry = loadValues || loadMetadata ? (MarshalledEntry) unmarshall(pair.value) : null; boolean isExpired = entry != null && entry.getMetadata() != null && entry.getMetadata().isExpired(now); if (!isExpired) { if (!loadValues || !loadMetadata) { entry = ctx.getMarshalledEntryFactory().newMarshalledEntry( key, loadValues ? entry.getValue() : null, loadMetadata ? entry.getMetadata() : null); } cacheLoaderTask.processEntry(entry, taskContext); } } } return null; } catch (Exception e) { log.errorExecutingParallelStoreTask(e); throw e; } }); }
Source:
public boolean performCancel() { for (String[] element : fAppearanceColorListModel) { String preference = element[1]; PreferenceConverter.setValue(getPreferenceStore(), preference, StringConverter.asRGB(element[2])); } return super.performCancel(); }

Target:
public boolean performCancel() { for (String[] colorModel : fAppearanceColorListModel) { String preference = colorModel[1]; PreferenceConverter.setValue(getPreferenceStore(), preference, StringConverter.asRGB(colorModel[2])); } return super.performCancel(); }
Source:
public void before() { Graphene.goTo(HomePage.class); Console.withBrowser(browser).waitUntilLoaded(); Graphene.goTo(DomainDeploymentPage.class); Console.withBrowser(browser).waitUntilLoaded(); Console.withBrowser(browser).maximizeWindow(); }

Target:
public void before() { Console.withBrowser(browser).refreshAndNavigate(DomainDeploymentPage.class); }
Source:
public void testVersion() { final org.apache.log4j.Logger root = LogManager.getRootLogger(); root.setLevel(org.apache.log4j.Level.INFO); final StringAppender app = new StringAppender(); root.addAppender(app); new NamedThreads("test", "desc").newThread( new Runnable() { @Override public void run() { } }); final String message = app.getBuffer(); MatcherAssert.assertThat( message, Matchers.not( Matchers.containsString( "${projectVersion}" ) ) ); MatcherAssert.assertThat( message, Matchers.not( Matchers.containsString( "${buildNumber}" ) ) ); }

Target:
public void testVersion() { final org.apache.log4j.Logger root = LogManager.getRootLogger(); final Level level = root.getLevel(); root.setLevel(Level.INFO); final StringWriter writer = new StringWriter(); final WriterAppender appender = new WriterAppender(new SimpleLayout(), writer); root.addAppender(appender); try { new NamedThreads("test", "desc").newThread( new Runnable() { @Override public void run() { } }); final String message = writer.toString(); MatcherAssert.assertThat( message, Matchers.containsString( Version.CURRENT.projectVersion() ) ); MatcherAssert.assertThat( message, Matchers.containsString( Version.CURRENT.buildNumber() ) ); } finally { root.removeAppender(appender); root.setLevel(level); } }
Source:
public void doubleClickTimeLineGroup() { WebElement elem = driver.findElement(By.xpath(" + "/descendant::div[contains(@class,'vispanel center')]")); doubleClick(elem); doubleClick(timeLineGroup); }

Target:
public void doubleClickTimeLineGroup() { clickRemoveBtn(); doubleClick(timeLineGroup); }
Source:
public void execute(final OperationParams params) { try { final KuduLocal server = options.getServer(); server.start(); if (interactive) { System.out.println("hit any key to shutdown .."); System.in.read(); System.out.println("Shutting down!"); server.stop(); } else { Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { try { server.stop(); } catch (final Exception e) { LOGGER.warn("Unable to shutdown redis", e); System.out.println("Error shutting down redis."); } System.out.println("Shutting down!"); } }); while (true) { Thread.sleep(TimeUnit.MILLISECONDS.convert(Long.MAX_VALUE, TimeUnit.DAYS)); } } } catch (final Exception e) { LOGGER.error("Unable to run embedded Redis server", e); } }

Target:
public void execute(final OperationParams params) { try { final KuduLocal server = options.getServer(); server.start(); if (interactive) { System.out.println("hit any key to shutdown .."); System.in.read(); System.out.println("Shutting down!"); server.stop(); } else { Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { try { server.stop(); } catch (final Exception e) { LOGGER.warn("Unable to shutdown kudu", e); System.out.println("Error shutting down kudu server."); } System.out.println("Shutting down!"); } }); while (true) { Thread.sleep(TimeUnit.MILLISECONDS.convert(Long.MAX_VALUE, TimeUnit.DAYS)); } } } catch (final Exception e) { LOGGER.error("Unable to run embedded kudu server", e); } }
Source:
private void initializeGatewayConfigurationReader() { this.gatewayConfigurationReader = new GatewayServiceConfigurationReader(this.serviceEndpoint, this.globalEndpointManager); DatabaseAccount databaseAccount = this.globalEndpointManager.getLatestDatabaseAccount(); this.useMultipleWriteLocations = this.connectionPolicy.getUsingMultipleWriteLocations() && BridgeInternal.isEnableMultipleWriteLocations(databaseAccount); }

Target:
private void initializeGatewayConfigurationReader() { this.gatewayConfigurationReader = new GatewayServiceConfigurationReader(this.globalEndpointManager); DatabaseAccount databaseAccount = this.globalEndpointManager.getLatestDatabaseAccount(); assert(databaseAccount != null); this.useMultipleWriteLocations = this.connectionPolicy.getUsingMultipleWriteLocations() && BridgeInternal.isEnableMultipleWriteLocations(databaseAccount); }
Source:
void processMessage(Message message) { String command = message.getCommand(); CommandExecutor executor = this.commandFactory.getCommandExecutor(command); Message response = executor.execute(message); if (Command.CONNECT.toString().equals(command)) { policy.setIdentifier(message.getHeaders().get(HEADER_HOST)); } if (response != null) { this.send(response.build()); } if (Command.DISCONNECT.toString().equals(command)) { try { channel.close(); } catch (IOException ignored) { } } }

Target:
void processMessage(Message message) { String command = message.getCommand(); CommandExecutor executor = this.commandFactory.getCommandExecutor(command); Message response = executor.execute(message); if (Command.CONNECT.toString().equals(command)) { if (message.getHeaders().get(HEADER_HOST) != null) { policy.setIdentifier(message.getHeaders().get(HEADER_HOST)); } } if (response != null) { this.send(response.build()); } if (Command.DISCONNECT.toString().equals(command)) { try { channel.close(); } catch (IOException ignored) { } } }
Source:
private InvocationStage checkPendingAndLockKey(TxInvocationContext<?> ctx, VisitableCommand command, Object key, long lockTimeout) { PendingLockPromise pendingLockPromise = pendingLockManager.checkPendingTransactionsForKey(ctx, key, lockTimeout, TimeUnit.MILLISECONDS); if (pendingLockPromise.isReady()) { return lockAndRecord(ctx, command, key, lockTimeout); } return makeStage(pendingLockPromise.toInvocationStage().thenApply(ctx, command, (rCtx, rCommand, rv) -> { long remaining = pendingLockPromise.getRemainingTimeout(); return lockAndRecord(ctx, command, key, remaining); })); }

Target:
private InvocationStage checkPendingAndLockKey(TxInvocationContext<?> ctx, VisitableCommand command, Object key, long lockTimeout) { PendingLockPromise pendingLockPromise = pendingLockManager.checkPendingTransactionsForKey(ctx, key, lockTimeout, TimeUnit.MILLISECONDS); if (pendingLockPromise.isReady()) { return lockAndRecord(ctx, command, key, lockTimeout); } return pendingLockPromise.toInvocationStage().thenApplyMakeStage(ctx, command, (rCtx, rCommand, rv) -> { long remaining = pendingLockPromise.getRemainingTimeout(); return lockAndRecord(ctx, command, key, remaining); }); }
Source:
public static void testGetActivitiesWithPaginationForClient() throws MambuApiException { String methodName = new Object() {}.getClass().getEnclosingMethod().getName(); System.out.println(methodName = "\nIn " + methodName); ActivitiesService activitiesService = MambuAPIFactory.getActivitiesService(); Class<Client> mambuEntity = Client.class; Calendar toDate = Calendar.getInstance(); Calendar fromDate = Calendar.getInstance(); fromDate.add(Calendar.DAY_OF_MONTH, -10); String entityId = DemoUtil.getDemoClient().getEncodedKey(); if (entityId == null) { System.out.println("WARNING: No Activities for Client entity to retrieve"); return; } List<JSONActivity> jsonActivities = activitiesService.getActivities(fromDate.getTime(), toDate.getTime(), mambuEntity, entityId, 0, 5); printMambuEntityAndActivitiesDetails(mambuEntity, entityId, jsonActivities, fromDate.getTime(), toDate.getTime()); }

Target:
public static void testGetActivitiesWithPaginationForClient() throws MambuApiException { String methodName = new Object() {}.getClass().getEnclosingMethod().getName(); System.out.println(methodName = "\nIn " + methodName); ActivitiesService activitiesService = MambuAPIFactory.getActivitiesService(); Class<Client> mambuEntity = Client.class; Calendar toDate = Calendar.getInstance(); Calendar fromDate = Calendar.getInstance(); fromDate.add(Calendar.DAY_OF_MONTH, -10); String entityId = DemoUtil.getDemoClient().getEncodedKey(); if (entityId == null) { System.out.println("WARNING: No Activities can be obtained for a client with null encodedKey"); return; } List<JSONActivity> jsonActivities = activitiesService.getActivities(fromDate.getTime(), toDate.getTime(), mambuEntity, entityId, 0, 5); printMambuEntityAndActivitiesDetails(mambuEntity, entityId, jsonActivities, fromDate.getTime(), toDate.getTime()); }
Source:
public static void trackSavePostAnalytics(PostModel post, SiteModel site) { PostStatus status = PostStatus.fromPost(post); Map<String, Object> properties = new HashMap<>(); PostUtils.addPostTypeToAnalyticsProperties(post, properties); switch (status) { case PUBLISHED: if (!post.isLocalDraft()) { properties.put("post_id", post.getRemotePostId()); properties.put(AnalyticsUtils.HAS_GUTENBERG_BLOCKS_KEY, PostUtils.contentContainsGutenbergBlocks(post.getContent())); AnalyticsUtils.trackWithSiteDetails(AnalyticsTracker.Stat.EDITOR_UPDATED_POST, site, properties); } else { } break; case SCHEDULED: if (!post.isLocalDraft()) { properties.put("post_id", post.getRemotePostId()); properties.put(AnalyticsUtils.HAS_GUTENBERG_BLOCKS_KEY, PostUtils.contentContainsGutenbergBlocks(post.getContent())); AnalyticsUtils.trackWithSiteDetails(AnalyticsTracker.Stat.EDITOR_UPDATED_POST, site, properties); } else { properties.put("word_count", AnalyticsUtils.getWordCount(post.getContent())); properties.put(AnalyticsUtils.HAS_GUTENBERG_BLOCKS_KEY, PostUtils.contentContainsGutenbergBlocks(post.getContent())); AnalyticsUtils.trackWithSiteDetails(AnalyticsTracker.Stat.EDITOR_SCHEDULED_POST, site, properties); } break; case DRAFT: properties.put("post_id", post.getRemotePostId()); properties.put(AnalyticsUtils.HAS_GUTENBERG_BLOCKS_KEY, PostUtils.contentContainsGutenbergBlocks(post.getContent())); AnalyticsUtils.trackWithSiteDetails(AnalyticsTracker.Stat.EDITOR_SAVED_DRAFT, site, properties); break; default: } }

Target:
public static void trackSavePostAnalytics(PostModel post, SiteModel site) { PostStatus status = PostStatus.fromPost(post); Map<String, Object> properties = new HashMap<>(); PostUtils.addPostTypeToAnalyticsProperties(post, properties); switch (status) { case PUBLISHED: if (!post.isLocalDraft()) { properties.put("post_id", post.getRemotePostId()); properties.put(AnalyticsUtils.HAS_GUTENBERG_BLOCKS_KEY, PostUtils.contentContainsGutenbergBlocks(post.getContent())); AnalyticsUtils.trackWithSiteDetails(AnalyticsTracker.Stat.EDITOR_UPDATED_POST, site, properties); } else { } break; case SCHEDULED: if (!post.isLocalDraft()) { properties.put("post_id", post.getRemotePostId()); properties.put(AnalyticsUtils.HAS_GUTENBERG_BLOCKS_KEY, PostUtils.contentContainsGutenbergBlocks(post.getContent())); AnalyticsUtils.trackWithSiteDetails(AnalyticsTracker.Stat.EDITOR_UPDATED_POST, site, properties); } else { properties.put("word_count", AnalyticsUtils.getWordCount(post.getContent())); properties.put("editor_source", shouldShowGutenbergEditor(post.isLocalDraft(), post, site) ? SiteUtils.GB_EDITOR_NAME : SiteUtils.AZTEC_EDITOR_NAME); properties.put(AnalyticsUtils.HAS_GUTENBERG_BLOCKS_KEY, PostUtils.contentContainsGutenbergBlocks(post.getContent())); AnalyticsUtils.trackWithSiteDetails(AnalyticsTracker.Stat.EDITOR_SCHEDULED_POST, site, properties); } break; case DRAFT: properties.put("post_id", post.getRemotePostId()); properties.put(AnalyticsUtils.HAS_GUTENBERG_BLOCKS_KEY, PostUtils.contentContainsGutenbergBlocks(post.getContent())); AnalyticsUtils.trackWithSiteDetails(AnalyticsTracker.Stat.EDITOR_SAVED_DRAFT, site, properties); break; default: } }
Source:
public int compare(MessageExt lhs, MessageExt rhs) { return lhs.getQueueOffset() < rhs.getQueueOffset() ? -1 : (lhs.getQueueOffset() == rhs.getQueueOffset() ? 0 : 1); }

Target:
public int compare(MessageExt lhs, MessageExt rhs) { return Long.compare(lhs.getQueueOffset(), lhs.getQueueOffset()); }
Source:
public ModuleMetaData deserialiseModule(String module) { ModuleMetaDataImpl result; try { ObjectMapper mapper = new ObjectMapper(); SimpleModule m = new SimpleModule(); m.addAbstractTypeMapping(ModuleMetaData.class, ModuleMetaDataImpl.class); m.addAbstractTypeMapping(FlowMetaData.class, FlowMetaDataImpl.class); m.addAbstractTypeMapping(FlowElementMetaData.class, FlowElementMetaDataImpl.class); m.addAbstractTypeMapping(Transition.class, TransitionImpl.class); mapper.registerModule(m); result = mapper.readValue(module, ModuleMetaDataImpl.class); } catch (Exception e) { throw new RuntimeException("Exception has occurred creating module meta data object!", e); } return result; }

Target:
public ModuleMetaData deserialiseModule(String module) { ModuleMetaDataImpl result; try { result = this.mapper.readValue(module, ModuleMetaDataImpl.class); } catch (Exception e) { throw new RuntimeException("Exception has occurred creating module meta data object!", e); } return result; }
Source:
public boolean isTrue(State state, String[] params) { if ((this.spaceName != null && !this.spaceName.equals("")) && !this.spaceName.equals(params[1])) { return false; } ObjectInstance space = state.getObject(params[1]); return SpaceFactory.getOnOff(space); }

Target:
public boolean isTrue(State state, String[] params) { if ((this.spaceName != null && !this.spaceName.isEmpty()) && !this.spaceName.equals(params[1])) { return false; } ObjectInstance space = state.getObject(params[1]); return SpaceFactory.getOnOff(space); }
Source:
private static void addShutdownMessageHook() { Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() { @Override public void run() { LOGGER.info("Stopping boot microservices..."); for (Process process : bootMicroservicesProcesses) process.destroyForcibly(); LOGGER.info("Shutting down..."); if (discoveryService != null) { discoveryService.stop(); } } })); }

Target:
private static void addShutdownMessageHook() { Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() { @Override public void run() { LOGGER.info("Stopping boot microservices..."); for (Process process : bootMicroservicesProcesses) { process.destroyForcibly(); } LOGGER.info("Shutting down..."); if (discoveryService != null) { discoveryService.stop(); } } })); }
Source:
RebalanceFuture( CacheGroupContext grp, GridDhtPreloaderAssignments assignments, IgniteLogger log, long rebalanceId, RebalanceFuture next, AtomicLong lastCancelledTime) { assert assignments != null; this.rebalancingParts = U.newHashMap(assignments.size()); this.assignments = assignments; exchId = assignments.exchangeId(); topVer = assignments.topologyVersion(); this.next = next; this.lastCancelledTime = lastCancelledTime; assignments.forEach((k, v) -> { assert v.partitions() != null : "Partitions are null [grp=" + grp.cacheOrGroupName() + ", fromNode=" + k.id() + "]"; remaining.put(k.id(), v.partitions()); partitionsLeft.addAndGet(v.partitions().size()); rebalancingParts.put(k, new HashSet<Integer>() {{ addAll(v.partitions().historicalSet()); addAll(v.partitions().fullSet()); }}); historical.addAll(v.partitions().historicalSet()); Stream.concat(v.partitions().historicalSet().stream(), v.partitions().fullSet().stream()) .forEach( p -> { queued.put(p, new LongAdder()); processed.put(p, new LongAdder()); }); }); this.routines = remaining.size(); this.grp = grp; this.log = log; this.rebalanceId = rebalanceId; ctx = grp.shared(); cancelLock = new ReentrantReadWriteLock(); }

Target:
RebalanceFuture( CacheGroupContext grp, GridDhtPreloaderAssignments assignments, IgniteLogger log, long rebalanceId, RebalanceFuture next, AtomicLong lastCancelledTime) { assert assignments != null; this.rebalancingParts = U.newHashMap(assignments.size()); this.assignments = assignments; exchId = assignments.exchangeId(); topVer = assignments.topologyVersion(); this.next = next; this.lastCancelledTime = lastCancelledTime; assignments.forEach((k, v) -> { assert v.partitions() != null : "Partitions are null [grp=" + grp.cacheOrGroupName() + ", fromNode=" + k.id() + "]"; remaining.put(k.id(), v.partitions()); partitionsLeft.addAndGet(v.partitions().size()); rebalancingParts.put(k, new HashSet<Integer>(v.partitions().size()) {{ addAll(v.partitions().historicalSet()); addAll(v.partitions().fullSet()); }}); historical.addAll(v.partitions().historicalSet()); Stream.concat(v.partitions().historicalSet().stream(), v.partitions().fullSet().stream()) .forEach( p -> { queued.put(p, new LongAdder()); processed.put(p, new LongAdder()); }); }); this.routines = remaining.size(); this.grp = grp; this.log = log; this.rebalanceId = rebalanceId; ctx = grp.shared(); cancelLock = new ReentrantReadWriteLock(); }
Source:
private void setup() { if (!mReady) { mSetupPending = true; return; } if (mBitmap == null) { return; } mBitmapShader = new BitmapShader(mBitmap, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP); mBitmapPaint.setAntiAlias(true); mBitmapPaint.setShader(mBitmapShader); mBorderPaint.setStyle(Paint.Style.STROKE); mBorderPaint.setAntiAlias(true); mBorderPaint.setColor(mBorderColor); mBorderPaint.setStrokeWidth(mBorderWidth); mBitmapHeight = mBitmap.getHeight(); mBitmapWidth = mBitmap.getWidth(); mBorderRect.set(0, 0, getWidth(), getHeight()); mBorderRadius = Math.min((mBorderRect.height() - mBorderWidth) / 2, (mBorderRect.width() - mBorderWidth) / 2); mDrawableRect.set(mBorderRect); if (mBorderInset) mDrawableRect.inset(mBorderWidth, mBorderWidth); mDrawableRadius = Math.min(mDrawableRect.height() / 2, mDrawableRect.width() / 2); updateShaderMatrix(); invalidate(); }

Target:
private void setup() { if (!mReady) { mSetupPending = true; return; } if (mBitmap == null) { return; } mBitmapShader = new BitmapShader(mBitmap, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP); mBitmapPaint.setAntiAlias(true); mBitmapPaint.setShader(mBitmapShader); mBorderPaint.setStyle(Paint.Style.STROKE); mBorderPaint.setAntiAlias(true); mBorderPaint.setColor(mBorderColor); mBorderPaint.setStrokeWidth(mBorderWidth); mBitmapHeight = mBitmap.getHeight(); mBitmapWidth = mBitmap.getWidth(); mBorderRect.set(0, 0, getWidth(), getHeight()); mBorderRadius = Math.min((mBorderRect.height() - mBorderWidth) / 2, (mBorderRect.width() - mBorderWidth) / 2); mDrawableRect.set(mBorderRect); if (!mBorderOverlay) { mDrawableRect.inset(mBorderWidth, mBorderWidth); } mDrawableRadius = Math.min(mDrawableRect.height() / 2, mDrawableRect.width() / 2); updateShaderMatrix(); invalidate(); }
Source:
public void restoreAndSaveState() { webView.restoreState(Bundle()); webView.saveState(Bundle()); }

Target:
public void restoreAndSaveState() { webView.restoreState(new Bundle()); webView.saveState(new Bundle()); }
Source:
public static List<Filter> getDistinctPositionFilters(Filter filter) { if (filter == null) { return ImmutableList.of(); } if (filter instanceof PositionalFilter) { return ((PositionalFilter) filter).getParent().getFilters().entrySet().stream().map(c -> c.getValue()).collect(toList()); } return ImmutableList.of(filter); }

Target:
public static List<Filter> getDistinctPositionFilters(Filter filter) { if (filter == null) { return ImmutableList.of(); } if (filter instanceof PositionalFilter) { return ImmutableList.copyOf(((PositionalFilter) filter).getParent().getFilters().values()); } return ImmutableList.of(filter); }
Source:
public ProcessInstance start(StartProcessPayload startProcessPayload) { ProcessDefinition processDefinition = null; if (startProcessPayload.getProcessDefinitionId() != null) { processDefinition = processDefinition(startProcessPayload.getProcessDefinitionId()); } if (processDefinition == null && startProcessPayload.getProcessDefinitionKey() != null) { processDefinition = processDefinition(startProcessPayload.getProcessDefinitionKey()); } if (processDefinition == null) { throw new IllegalStateException("At least Process Definition Id or Key needs to be provided to start a process"); } if (!securityPoliciesManager.canWrite(processDefinition.getKey())) { throw new ActivitiForbiddenException("Operation not permitted for " + processDefinition.getKey() + " due security policy violation"); } processVariablesValidator.checkStartProcessPayloadVariables(startProcessPayload, startProcessPayload.getProcessDefinitionKey()); return processInstanceConverter.from(runtimeService .createProcessInstanceBuilder() .processDefinitionId(startProcessPayload.getProcessDefinitionId()) .processDefinitionKey(startProcessPayload.getProcessDefinitionKey()) .businessKey(startProcessPayload.getBusinessKey()) .variables(startProcessPayload.getVariables()) .name(startProcessPayload.getName()) .start()); }

Target:
public ProcessInstance start(StartProcessPayload startProcessPayload) { ProcessDefinition processDefinition = getProcessDefinitionAndCheckUserHasRights(startProcessPayload.getProcessDefinitionId(), startProcessPayload.getProcessDefinitionKey()); processVariablesValidator.checkStartProcessPayloadVariables(startProcessPayload, processDefinition.getKey()); return processInstanceConverter.from(runtimeService .createProcessInstanceBuilder() .processDefinitionId(processDefinition.getId()) .processDefinitionKey(processDefinition.getKey()) .businessKey(startProcessPayload.getBusinessKey()) .variables(startProcessPayload.getVariables()) .name(startProcessPayload.getName()) .start()); }
Source:
public ContentProviderOperation.Builder updatedBuilder(@NonNull TransactionContext transactionContext, @NonNull ContentProviderOperation.Builder builder) { return builder .withValue(TaskContract.Instances.INSTANCE_START, new Mapped<>(DateTime::getTimestamp, mInstanceStart).value(null)) .withValue(TaskContract.Instances.INSTANCE_START_SORTING, new Mapped<>(DateTime::getInstance, mInstanceStart).value(null)) .withValue(TaskContract.Instances.INSTANCE_DUE, new Mapped<>(DateTime::getTimestamp, mInstanceDue).value(null)) .withValue(TaskContract.Instances.INSTANCE_DUE_SORTING, new Mapped<>(DateTime::getInstance, mInstanceDue).value(null)) .withValue(TaskContract.Instances.INSTANCE_DURATION, new Zipped<>(mInstanceStart, mInstanceDue, (start, due) -> (due.getTimestamp() - start.getTimestamp())).value(null)) .withValue(TaskContract.Instances.INSTANCE_ORIGINAL_TIME, mOriginalTime.value(new DateTime(0)).getTimestamp()) .withValue(TaskContract.Instances.DISTANCE_FROM_CURRENT, mDistanceFromCurrent) .withValue(TaskContract.Instances.DTSTART, new Mapped<>(DateTime::getTimestamp, mInstanceStart).value(null)) .withValue(TaskContract.Instances.DUE, new Mapped<>(DateTime::getTimestamp, mInstanceDue).value(null)) .withValue(TaskContract.Instances.DURATION, null) .withValue(TaskContract.Instances.RRULE, null) .withValue(TaskContract.Instances.RDATE, null) .withValue(TaskContract.Instances.EXDATE, null); }

Target:
public ContentProviderOperation.Builder updatedBuilder(@NonNull TransactionContext transactionContext, @NonNull ContentProviderOperation.Builder builder) { return builder .withValue(TaskContract.Instances.INSTANCE_START, new Mapped<>(DateTime::getTimestamp, mInstanceStart).value(null)) .withValue(TaskContract.Instances.INSTANCE_START_SORTING, new Mapped<>(DateTime::getInstance, mInstanceStart).value(null)) .withValue(TaskContract.Instances.INSTANCE_DUE, new Mapped<>(DateTime::getTimestamp, mInstanceDue).value(null)) .withValue(TaskContract.Instances.INSTANCE_DUE_SORTING, new Mapped<>(DateTime::getInstance, mInstanceDue).value(null)) .withValue(TaskContract.Instances.INSTANCE_DURATION, new Zipped<>(mInstanceStart, mInstanceDue, (start, due) -> (due.getTimestamp() - start.getTimestamp())).value(null)) .withValue(TaskContract.Instances.INSTANCE_ORIGINAL_TIME, new Mapped<>(DateTime::getTimestamp, mOriginalTime).value(null)) .withValue(TaskContract.Instances.DISTANCE_FROM_CURRENT, mDistanceFromCurrent) .withValue(TaskContract.Instances.DTSTART, new Mapped<>(DateTime::getTimestamp, mInstanceStart).value(null)) .withValue(TaskContract.Instances.DUE, new Mapped<>(DateTime::getTimestamp, mInstanceDue).value(null)) .withValue(TaskContract.Instances.ORIGINAL_INSTANCE_TIME, new Mapped<>(DateTime::getTimestamp, mOriginalTime).value(null)) .withValue(TaskContract.Instances.DURATION, null) .withValue(TaskContract.Instances.RRULE, null) .withValue(TaskContract.Instances.RDATE, null) .withValue(TaskContract.Instances.EXDATE, null); }
Source:
public synchronized void onAssignmentChange(List<DatastreamTask> tasks) { _logger.info("onAssignmentChange called with tasks {}", tasks); synchronized (_runningTasks) { HashSet<DatastreamTask> toCancel = new HashSet<>(_runningTasks.keySet()); toCancel.removeAll(tasks); for (DatastreamTask task : toCancel) { ConnectorTaskEntry connectorTaskEntry = _runningTasks.remove(task); connectorTaskEntry.getConnectorTask().stop(); } for (DatastreamTask task : tasks) { ConnectorTaskEntry connectorTaskEntry = _runningTasks.get(task); if (connectorTaskEntry != null) { AbstractKafkaBasedConnectorTask kafkaBasedConnectorTask = connectorTaskEntry.getConnectorTask(); kafkaBasedConnectorTask.checkForUpdateTask(task); _runningTasks.put(task, new ConnectorTaskEntry(kafkaBasedConnectorTask, connectorTaskEntry.getThread())); continue; } createKafkaConnectorTask(task); } } }

Target:
public synchronized void onAssignmentChange(List<DatastreamTask> tasks) { _logger.info("onAssignmentChange called with tasks {}", tasks); synchronized (_runningTasks) { Set<DatastreamTask> toCancel = new HashSet<>(_runningTasks.keySet()); toCancel.removeAll(tasks); for (DatastreamTask task : toCancel) { ConnectorTaskEntry connectorTaskEntry = _runningTasks.remove(task); connectorTaskEntry.getConnectorTask().stop(); } for (DatastreamTask task : tasks) { ConnectorTaskEntry connectorTaskEntry = _runningTasks.get(task); if (connectorTaskEntry != null) { AbstractKafkaBasedConnectorTask kafkaBasedConnectorTask = connectorTaskEntry.getConnectorTask(); kafkaBasedConnectorTask.checkForUpdateTask(task); _runningTasks.put(task, connectorTaskEntry); continue; } _runningTasks.put(task, createKafkaConnectorTask(task)); } } }
Source:
private void waitTillFirstTopicIsAdded() { while (!topicAdded.get()) { try { firstTopicAdded.await(1, TimeUnit.SECONDS); } catch (InterruptedException e) { LOG.info("Interrupted before first topic was added. Terminating Kafka RPC consumer thread.", e); closed.set(true); return; } catch(Throwable e) { LOG.error("Unknown exception before first topic is added, Terminating Kafka RPC consumer thread", e); closed.set(true); return; } } }

Target:
private void waitTillFirstTopicIsAdded() { while (!topicAdded.get()) { try { firstTopicAdded.await(1, TimeUnit.SECONDS); } catch (InterruptedException e) { LOG.info("Interrupted before first topic was added. Terminating Kafka RPC consumer thread.", e); return; } catch(Throwable e) { LOG.error("Unknown exception before first topic is added. Terminating Kafka RPC consumer thread.", e); return; } } }
Source:
public int hashCode() { return Objects.hash( account, uuid, state, invoiceNumber, poNumber, vatNumber, subtotalInCents, taxInCents, currency, createdAt, collectionMethod, netTerms, lineItems, transactions ); }

Target:
public int hashCode() { return Objects.hashCode( account, uuid, state, invoiceNumber, poNumber, vatNumber, subtotalInCents, totalInCents, taxInCents, currency, createdAt, collectionMethod, netTerms, lineItems, transactions ); }
Source:
private void loadClientDetails() { final User loggedInUser = PrefManager.getUser(); TextView textViewUsername = (TextView) mNavigationHeader.findViewById(R.id.tv_user_name); textViewUsername.setText(loggedInUser.getUsername()); ImageView imageViewUserPicture = (ImageView) mNavigationHeader .findViewById(R.id.iv_user_picture); imageViewUserPicture.setImageResource(R.drawable.ic_account_circle); }

Target:
private void loadClientDetails() { final User loggedInUser = PrefManager.getUser(); TextView textViewUsername = ButterKnife.findById(mNavigationHeader, R.id.tv_user_name); textViewUsername.setText(loggedInUser.getUsername()); ImageView imageViewUserPicture = ButterKnife .findById(mNavigationHeader, R.id.iv_user_picture); imageViewUserPicture.setImageResource(R.drawable.ic_account_circle); }
Source:
public Instant getDateOfEarliestLog() throws DateTimeParseException { DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm:ss.SSS"); String dateTimeString = getLogsTable().findElement(By.cssSelector("tr:last-child > td > a")).getText(); return LocalDateTime.parse(dateTimeString, formatter).atZone(Const.SystemParams.ADMIN_TIME_ZONE_ID).toInstant(); }

Target:
public Instant getDateOfEarliestLog() { String dateTimeString = getLogsTable().findElement(By.cssSelector("tr:last-child > td > a")).getText(); return TimeHelper.parseLocalDateTime(dateTimeString, "dd/MM/yyyy HH:mm:ss.SSS") .atZone(Const.SystemParams.ADMIN_TIME_ZONE_ID).toInstant(); }