auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void notify(CarbonServerEvent event) { if (event.getType() == CarbonServerEvent.STARTING) { Path carbonHome = Utils.getCarbonHomeDirectory(); try { Optional<String> carbonProfile = Optional.ofNullable(System.getProperty("carbon.profile")); if (carbonProfile.isPresent()) { DropinsBundleDeployerUtils.executeDropinsCapability(carbonHome.toString(), carbonProfile.get()); } else { DropinsBundleDeployerUtils.getCarbonProfiles().parallelStream().forEach(profileName -> { try { DropinsBundleDeployerUtils.executeDropinsCapability(carbonHome.toString(), profileName); } catch (IOException e) { <START> logger.log(Level.SEVERE, "Failed to update the Carbon Profile : " + carbonProfile, e); <END> } }); } } catch (IOException e) { logger.log(Level.SEVERE, "Failed to update the specified Carbon Profile", e); } } }</code><technical_language>revert throw exception failed update Carbon Profile? logging carrying forward</technical_language>

Target:
public void notify(CarbonServerEvent event) { if (event.getType() == CarbonServerEvent.STARTING) { Path carbonHome = Utils.getCarbonHomeDirectory(); String profile = Optional.ofNullable(System.getProperty(Constants.PROFILE)). orElse(Constants.DEFAULT_PROFILE); try { DropinsBundleDeployerUtils.executeDropinsCapability(carbonHome.toString(), profile); } catch (IOException e) { logger.log(Level.SEVERE, "Failed to update the OSGi bundle information of Carbon Profile: " + profile, e); } } }
Source:
<code>public void validate(NodeContext baseConfig, StripeAdditionNomadChange change) throws NomadException { LOGGER.info("Validating change: {}", change.getSummary()); if (baseConfig == null) { throw new NomadException("Existing config must not be null"); } try { Cluster updated = change.apply(baseConfig.getCluster()); new ClusterValidator(updated).validate(); } catch (RuntimeException e) { throw new NomadException("Error when trying to apply: '" + change.getSummary() + "': " + e.getMessage(), e); <START> } <END> }</code><technical_language>a call license validation is required fail nomad prepare phase if needed rely client-side validation. TopologyService.getLicense().ifPresent(l -> LicenseService.validate(l, updated))</technical_language>

Target:
public void validate(NodeContext baseConfig, StripeAdditionNomadChange change) throws NomadException { LOGGER.info("Validating change: {}", change.getSummary()); if (baseConfig == null) { throw new NomadException("Existing config must not be null"); } try { Cluster updated = change.apply(baseConfig.getCluster()); new ClusterValidator(updated).validate(); topologyService.getLicense().ifPresent(l -> licenseService.validate(l, updated)); } catch (RuntimeException e) { throw new NomadException("Error when trying to apply: '" + change.getSummary() + "': " + e.getMessage(), e); } }
Source:
<code>public void testMput() throws Exception { @SuppressWarnings("unchecked") SessionFactory<TestLsEntry> sessionFactory = mock(SessionFactory.class); @SuppressWarnings("unchecked") Session<TestLsEntry> session = mock(Session.class); RemoteFileTemplate<TestLsEntry> template = new RemoteFileTemplate<TestLsEntry>(sessionFactory); template.setRemoteDirectoryExpression(new LiteralExpression("foo/")); template.setBeanFactory(mock(BeanFactory.class)); template.afterPropertiesSet(); TestRemoteFileOutboundGateway gw = new TestRemoteFileOutboundGateway(template, "mput", null); gw.afterPropertiesSet(); when(sessionFactory.getSession()).thenReturn(session); final AtomicReference<String> written = new AtomicReference<String>(); doAnswer(new Answer<Object>() { @Override public Object answer(InvocationOnMock invocation) throws Throwable { written.set((String) invocation.getArguments()[1]); return null; } }).when(session).write(any(InputStream.class), anyString()); File file1 = tempFolder.newFile("baz.txt"); File file2 = tempFolder.newFile("qux.txt"); Message<File> requestMessage = MessageBuilder.withPayload(tempFolder.getRoot()) .build(); @SuppressWarnings("unchecked") List<String> out = (List<String>) gw.handleRequestMessage(requestMessage); assertEquals(2, out.size()); assertThat(out.get(0), not(equalTo(out.get(1)))); assertThat(out.get(0), anyOf( equalTo("foo/baz.txt"), equalTo("foo/qux.txt"))); assertThat(out.get(1), anyOf( equalTo("foo/baz.txt"), equalTo("foo/qux.txt"))); file1.delete(); <START> file2.delete(); <END> }</code><technical_language>reason delete files: TemporaryFolder Rule takes care of that</technical_language>

Target:
public void testMput() throws Exception { @SuppressWarnings("unchecked") SessionFactory<TestLsEntry> sessionFactory = mock(SessionFactory.class); @SuppressWarnings("unchecked") Session<TestLsEntry> session = mock(Session.class); RemoteFileTemplate<TestLsEntry> template = new RemoteFileTemplate<TestLsEntry>(sessionFactory); template.setRemoteDirectoryExpression(new LiteralExpression("foo/")); template.setBeanFactory(mock(BeanFactory.class)); template.afterPropertiesSet(); TestRemoteFileOutboundGateway gw = new TestRemoteFileOutboundGateway(template, "mput", null); gw.afterPropertiesSet(); when(sessionFactory.getSession()).thenReturn(session); final AtomicReference<String> written = new AtomicReference<String>(); doAnswer(new Answer<Object>() { @Override public Object answer(InvocationOnMock invocation) throws Throwable { written.set((String) invocation.getArguments()[1]); return null; } }).when(session).write(any(InputStream.class), anyString()); File file1 = tempFolder.newFile("baz.txt"); File file2 = tempFolder.newFile("qux.txt"); Message<File> requestMessage = MessageBuilder.withPayload(tempFolder.getRoot()) .build(); @SuppressWarnings("unchecked") List<String> out = (List<String>) gw.handleRequestMessage(requestMessage); assertEquals(2, out.size()); assertThat(out.get(0), not(equalTo(out.get(1)))); assertThat(out.get(0), anyOf( equalTo("foo/baz.txt"), equalTo("foo/qux.txt"))); assertThat(out.get(1), anyOf( equalTo("foo/baz.txt"), equalTo("foo/qux.txt"))); }
Source:
<code>public void handleMessageLog(TelemetryMessageLog messageLog) { for (TelemetryMessageLogEntry message : messageLog.getMessageList()) { handleMessage(message, messageLog).forEach(result -> { final PackageDefinition pkg = getPackageFor(adapterConfig, result.getAgent()); if (pkg == null) { LOG.warn("No matching package found for message: {}. Dropping.", message); return; } final RrdRepository repository = new RrdRepository(); repository.setStep(pkg.getRrd().getStep()); repository.setHeartBeat(repository.getStep() * 2); repository.setRraList(pkg.getRrd().getRras()); repository.setRrdBaseDir(new File(pkg.getRrd().getBaseDir())); final CollectionSet collectionSet = result.getCollectionSet(); LOG.trace("Persisting collection set: for message: {}", collectionSet, message); final Persister persister = persisterFactory.createPersister(EMPTY_SERVICE_PARAMETERS, repository); collectionSet.visit(persister); try { if (isThresholdingEnabled) { ThresholdingSession session = getSessionForAgent(result.getAgent(), repository); session.accept(collectionSet); } } catch (ThresholdInitializationException e) { <START> LOG.warn("Failed Thresholding of CollectionSet: ", e.getMessage()); <END> } }); } }</code><technical_language>include some of agent details in log message this happens? i.e. agent affected</technical_language>

Target:
public void handleMessageLog(TelemetryMessageLog messageLog) { for (TelemetryMessageLogEntry message : messageLog.getMessageList()) { handleMessage(message, messageLog).forEach(result -> { final PackageDefinition pkg = getPackageFor(adapterConfig, result.getAgent()); if (pkg == null) { LOG.warn("No matching package found for message: {}. Dropping.", message); return; } final RrdRepository repository = new RrdRepository(); repository.setStep(pkg.getRrd().getStep()); repository.setHeartBeat(repository.getStep() * 2); repository.setRraList(pkg.getRrd().getRras()); repository.setRrdBaseDir(new File(pkg.getRrd().getBaseDir())); final CollectionSet collectionSet = result.getCollectionSet(); LOG.trace("Persisting collection set: for message: {}", collectionSet, message); final Persister persister = persisterFactory.createPersister(EMPTY_SERVICE_PARAMETERS, repository); collectionSet.visit(persister); try { if (isThresholdingEnabled.get()) { ThresholdingSession session = getSessionForAgent(result.getAgent(), repository); session.accept(collectionSet); } } catch (ThresholdInitializationException e) { LOG.warn("Failed Thresholding of CollectionSet : for agent: {}", e.getMessage(), result.getAgent()); } }); } }
Source:
<code>private boolean isGerrit() { final String GERRIT_XSSI_MAGIC_STRING = ")]}\'\n"; if (uri.startsWith("https://") || uri.startsWith("http://")) { try { String u = uri; int protocolEnd = uri.indexOf("://") + 3; while (true) { <START> HttpURLConnection httpConnection = (HttpURLConnection) new URL( <END> u + "/config/server/version").openConnection(); httpConnection.setRequestMethod("GET"); int responseCode = httpConnection.getResponseCode(); switch (responseCode) { case HttpURLConnection.HTTP_OK: InputStream in = httpConnection.getInputStream(); String response = readFully(in, "UTF-8"); if (response.startsWith(GERRIT_XSSI_MAGIC_STRING)) { return true; } else { return false; } case HttpURLConnection.HTTP_NOT_FOUND: int slash = u.lastIndexOf('/'); if (slash <= protocolEnd) { return false; } u = u.substring(0, u.lastIndexOf('/')); break; default: return false; } } } catch (Exception e) { e.printStackTrace(); } } return false; }</code><technical_language>I told resources closed. connection is a resource, I miss try/finally/close it</technical_language>

Target:
private boolean isGerrit() throws MalformedURLException, IOException { final String GERRIT_XSSI_MAGIC_STRING = ")]}\'\n"; if (uri.startsWith("https://") || uri.startsWith("http://")) { String u = uri; int protocolEnd = uri.indexOf("://") + 3; HttpURLConnection httpConnection = null; try { while (true) { InputStream in = null; try { httpConnection = (HttpURLConnection) new URL(u + "/config/server/version").openConnection(); httpConnection.setRequestMethod("GET"); int responseCode = httpConnection.getResponseCode(); switch (responseCode) { case HttpURLConnection.HTTP_OK: in = httpConnection.getInputStream(); String response = readFully(in, "UTF-8"); if (response.startsWith(GERRIT_XSSI_MAGIC_STRING)) { return true; } else { return false; } case HttpURLConnection.HTTP_NOT_FOUND: int slash = u.lastIndexOf('/'); if (slash <= protocolEnd) { return false; } u = u.substring(0, u.lastIndexOf('/')); break; default: return false; } } finally { if (in != null) { in.close(); } } } } finally { if (httpConnection != null) { httpConnection.disconnect(); } } } return false; }
Source:
<code>public void testLFCR() throws IOException { <START> final byte[] input = new byte[] { (byte)1, (byte)'\n', (byte)'\r', (byte)2, (byte)'\n', (byte)'\r', (byte)3}; <END> final byte[] expected = new byte[] { (byte)1, (byte)'\n', (byte)'\r', (byte)2, (byte)'\n', (byte)'\r', (byte)3}; test(input, expected); }</code><technical_language>a shorter write inputs is: byte[] input = asBytes("1\n\r2\n\r3"); private static byte[] asBytes(String in) { return in.getBytes("UTF-8"); }</technical_language>

Target:
public void testLFCR() throws IOException { final byte[] bytes = asBytes("1\n\r2\n\r3"); test(bytes, bytes); }
Source:
<code>public Map<AnyObjectId, List<AnyObjectId>> getGrafts() throws IOException { if (isOutdated()) <START> grafts = loadGrafts(); <END> return grafts; }</code><technical_language>grafts volatile, a volatile safe pattern here: static State { final FileSnapshot snapshot; final Map... grafts; } private volatile State state; State s = state; if (s.isOutdated()) { s = loadGrafts(); state = s; } return s.grafts;</technical_language>

Target:
public Map<AnyObjectId, List<ObjectId>> getGrafts() throws IOException { if (isOutdated()) grafts = loadGrafts(); return grafts; }
Source:
<code>protected List<Integer> getCriterionInScope() { <START> if (filter == null || filter.getShowJustInScope()) { <END> List<Integer> inScopeChannelIds = new ArrayList<>(); try { for (WebSocketChannelDTO channel : table.getChannelItems()) { if (channel.isInScope()) { inScopeChannelIds.add(channel.id); } } return inScopeChannelIds; } catch (DatabaseException e) { logger.warn(e.getMessage(), e); } } return null; }</code><technical_language>&&</technical_language>

Target:
protected List<Integer> getCriterionInScope() { if (filter != null && filter.getShowJustInScope()) { List<Integer> inScopeChannelIds = new ArrayList<>(); try { for (WebSocketChannelDTO channel : table.getChannelItems()) { if (channel.isInScope()) { inScopeChannelIds.add(channel.id); } } return inScopeChannelIds; } catch (DatabaseException e) { logger.warn(e.getMessage(), e); } } return null; }
Source:
<code>public void productWithMultipleBrandNames() { String engProdId = "1000"; String brandedName = "Branded Eng Product"; Owner owner = new Owner("Test Corporation"); Product p = new Product(engProdId, "Eng Product 1000"); p.setAttribute(Product.Attributes.BRANDING_TYPE, "OS"); Set<Product> prods = new HashSet<>(Arrays.asList(p)); Product mktProd = new Product("mkt", "MKT SKU"); Pool pool = TestUtil.createPool(mktProd); Product product = pool.getProduct(); List<Branding> branding = new LinkedList<>(); branding.add(new Branding(engProdId, "OS", brandedName, null)); branding.add(new Branding(engProdId, "OS", "another brand name", null)); branding.add(new Branding(engProdId, "OS", "number 3", null)); product.setBranding(branding); <START> pool.setProduct(product); <END> Set<String> possibleBrandNames = new HashSet<>(); for (Branding b : pool.getProduct().getBranding()) { possibleBrandNames.add(b.getName()); } List<org.candlepin.model.dto.Product> certProds = util.createProducts(mktProd, prods, "", new HashMap<>(), new Consumer(), pool); assertEquals(1, certProds.size()); String resultBrandName = certProds.get(0).getBrandName(); String resultBrandType = certProds.get(0).getBrandType(); assertTrue(possibleBrandNames.contains(resultBrandName)); assertEquals("OS", resultBrandType); }</code><technical_language>above, need re-add product here. edited is pool a reference to</technical_language>

Target:
public void productWithMultipleBrandNames() { String engProdId = "1000"; String brandedName = "Branded Eng Product"; Owner owner = new Owner("Test Corporation"); Product p = new Product(engProdId, "Eng Product 1000"); p.setAttribute(Product.Attributes.BRANDING_TYPE, "OS"); Set<Product> prods = new HashSet<>(Arrays.asList(p)); Product mktProd = new Product("mkt", "MKT SKU"); Pool pool = TestUtil.createPool(mktProd); Product product = pool.getProduct(); List<Branding> branding = new LinkedList<>(); branding.add(new Branding(null, engProdId, brandedName, "OS")); branding.add(new Branding(null, engProdId, "another brand name", "OS")); branding.add(new Branding(null, engProdId, "number 3", "OS")); product.setBranding(branding); Set<String> possibleBrandNames = new HashSet<>(); for (Branding b : pool.getProduct().getBranding()) { possibleBrandNames.add(b.getName()); } List<org.candlepin.model.dto.Product> certProds = util.createProducts(mktProd, prods, "", new HashMap<>(), new Consumer(), pool); assertEquals(1, certProds.size()); String resultBrandName = certProds.get(0).getBrandName(); String resultBrandType = certProds.get(0).getBrandType(); assertTrue(possibleBrandNames.contains(resultBrandName)); assertEquals("OS", resultBrandType); }
Source:
<code>private static void handleExceptClause(SubscriptionContext ctx, Map<String, Expression> caughtTypes, ExceptClause exceptClause) { Map<String, Expression> caughtInExceptClause = new HashMap<>(); Expression exceptionExpression = exceptClause.exception(); if (exceptionExpression == null) { <START> Expression baseExceptionExpression = caughtTypes.getOrDefault("BaseException", null); <END> if (baseExceptionExpression != null) { ctx.addIssue(exceptClause.exceptKeyword(), "Merge this bare \"except:\" with the \"BaseException\" one.").secondary(baseExceptionExpression, null); } return; } if (exceptionExpression.is(Tree.Kind.TUPLE)) { Tuple tuple = (Tuple) exceptionExpression; for (Expression expression : tuple.elements()) { handleExceptionExpression(ctx, caughtTypes, expression, caughtInExceptClause); } } else { handleExceptionExpression(ctx, caughtTypes, exceptionExpression, caughtInExceptClause); } caughtInExceptClause.forEach(caughtTypes::putIfAbsent); }</code><technical_language>If default is null, caughtTypes.get("BaseException")</technical_language>

Target:
private static void handleExceptClause(SubscriptionContext ctx, Map<String, Expression> caughtTypes, ExceptClause exceptClause) { Map<String, Expression> caughtInExceptClause = new HashMap<>(); Expression exceptionExpression = exceptClause.exception(); if (exceptionExpression == null) { Expression baseExceptionExpression = caughtTypes.get("BaseException"); if (baseExceptionExpression != null) { ctx.addIssue(exceptClause.exceptKeyword(), "Merge this bare \"except:\" with the \"BaseException\" one.").secondary(baseExceptionExpression, null); } return; } if (exceptionExpression.is(Tree.Kind.TUPLE)) { Tuple tuple = (Tuple) exceptionExpression; for (Expression expression : tuple.elements()) { handleExceptionExpression(ctx, caughtTypes, expression, caughtInExceptClause); } } else { handleExceptionExpression(ctx, caughtTypes, exceptionExpression, caughtInExceptClause); } caughtInExceptClause.forEach(caughtTypes::putIfAbsent); }
Source:
<code>public static ControllerStarter startDefault(File webappPath) { final ControllerConf conf = new ControllerConf(); conf.setControllerHost("localhost"); conf.setControllerPort("9000"); conf.setDataDir("/tmp/PinotController"); conf.setZkStr("localhost:2122"); conf.setHelixClusterName("quickstart"); if (webappPath == null) { String path = ControllerStarter.class.getClassLoader().getResource("webapp").getFile(); if (!path.startsWith("file://")) { path = "file://" + path; } conf.setQueryConsolePath(path); } else { conf.setQueryConsolePath("file://" + webappPath.getAbsolutePath()); } conf.setControllerVipHost("localhost"); conf.setControllerVipProtocol(CommonConstants.HTTP_PROTOCOL); conf.setRetentionControllerFrequencyInSeconds(3600 * 6); conf.setOfflineSegmentIntervalCheckerFrequencyInSeconds(3600); conf.setRealtimeSegmentValidationFrequencyInSeconds(3600); conf.setBrokerResourceValidationFrequencyInSeconds(3600); conf.setStatusCheckerFrequencyInSeconds(5 * 60); <START> conf.setSegmentRelocatorFrequencyInSeconds(60*60); <END> conf.setStatusCheckerWaitForPushTimeInSeconds(10 * 60); conf.setTenantIsolationEnabled(true); final ControllerStarter starter = new ControllerStarter(conf); starter.start(); return starter; }</code><technical_language>(nit) reformat (or put 3600)</technical_language>

Target:
public static ControllerStarter startDefault(File webappPath) { final ControllerConf conf = new ControllerConf(); conf.setControllerHost("localhost"); conf.setControllerPort("9000"); conf.setDataDir("/tmp/PinotController"); conf.setZkStr("localhost:2122"); conf.setHelixClusterName("quickstart"); if (webappPath == null) { String path = ControllerStarter.class.getClassLoader().getResource("webapp").getFile(); if (!path.startsWith("file://")) { path = "file://" + path; } conf.setQueryConsolePath(path); } else { conf.setQueryConsolePath("file://" + webappPath.getAbsolutePath()); } conf.setControllerVipHost("localhost"); conf.setControllerVipProtocol(CommonConstants.HTTP_PROTOCOL); conf.setRetentionControllerFrequencyInSeconds(3600 * 6); conf.setOfflineSegmentIntervalCheckerFrequencyInSeconds(3600); conf.setRealtimeSegmentValidationFrequencyInSeconds(3600); conf.setBrokerResourceValidationFrequencyInSeconds(3600); conf.setStatusCheckerFrequencyInSeconds(5 * 60); conf.setSegmentRelocatorFrequencyInSeconds(3600); conf.setStatusCheckerWaitForPushTimeInSeconds(10 * 60); conf.setTenantIsolationEnabled(true); final ControllerStarter starter = new ControllerStarter(conf); starter.start(); return starter; }
Source:
<code>private void processStageConfigDetailsResponse(ArrayList<StageConfigDetailsArtifactCleanup> list, List<Map<String, String>> result) { for (Map<String, String> stageDetails : result) { StageConfigDetailsArtifactCleanup stageConfigDetailsArtifactCleanup = new StageConfigDetailsArtifactCleanup(stageDetails.get("stageName"), stageDetails.get("pipelineName")); <START> if (!list.contains(stageConfigDetailsArtifactCleanup)) { <END> list.add(stageConfigDetailsArtifactCleanup); } } }</code><technical_language>If a 1000 pipelines 3 stages (say), a plugin wants handle everything, this loop slower slower, of contains a list, a map? worth checking performance here</technical_language>

Target:
private void processStageConfigDetailsResponse(ArrayList<StageConfigDetailsArtifactCleanup> list, List<Map<String, String>> result) { for (Map<String, String> stageDetails : result) { StageConfigDetailsArtifactCleanup stageConfigDetailsArtifactCleanup = new StageConfigDetailsArtifactCleanup(stageDetails.get("stageName"), stageDetails.get("pipelineName")); List<StageConfigDetailsArtifactCleanup> toBeAdded = new ArrayList<StageConfigDetailsArtifactCleanup>(); if (!list.contains(stageConfigDetailsArtifactCleanup)) { toBeAdded.add(stageConfigDetailsArtifactCleanup); } list.addAll(toBeAdded); } }
Source:
<code>public void setUp() throws Exception { <START> page = new WebPage(); <END> }</code><technical_language>I this full constructor WebPage.newBuilder().build();;</technical_language>

Target:
public void setUp() throws Exception { page = WebPage.newBuilder().build(); }
Source:
<code>public Map<String, byte[]> getMetadata() { Map<String, byte[]> meta = new HashMap<>(); if (application != null) { meta.put("application", application.getBytes(StandardCharsets.UTF_8)); } if (component != null) { meta.put("component", component.getBytes(StandardCharsets.UTF_8)); } if (customMetadata != null) { for (Map.Entry<String, String> e : customMetadata.entrySet()) { String value = e.getValue(); meta.put(e.getKey(), value == null <START> ? null <END> : value.getBytes(StandardCharsets.UTF_8)); } } return meta; }</code><technical_language>sense a null here. fail a null key</technical_language>

Target:
public Map<String, byte[]> getMetadata() { Map<String, byte[]> meta = new HashMap<>(); if (application != null) { meta.put("application", application.getBytes(StandardCharsets.UTF_8)); } if (component != null) { meta.put("component", component.getBytes(StandardCharsets.UTF_8)); } if (customMetadata != null) { for (Map.Entry<String, String> e : customMetadata.entrySet()) { String value = e.getValue(); meta.put(e.getKey(), value.getBytes(StandardCharsets.UTF_8)); } } return meta; }
Source:
<code>public Optional<InfoInsightCards> map(int index, ResultSet r, StatementContext ctx) throws SQLException { try { <START> InsightCard.Category category = InsightCard.Category.fromString(r.getString("category")); <END> return Optional.of(new InfoInsightCards(r.getInt("id"), category, r.getString("title"), r.getString("text"), r.getString("image_url"))); } catch (IllegalArgumentException exception) { LOGGER.debug("Illegal argument found in info_insight_cards", r.getString("category")); } return Optional.absent(); }</code><technical_language>r.getString("category") in try/cactch</technical_language>

Target:
public Optional<InfoInsightCards> map(int index, ResultSet r, StatementContext ctx) throws SQLException { final String categoryString = r.getString("category"); try { InsightCard.Category category = InsightCard.Category.fromString(categoryString); return Optional.of(new InfoInsightCards(r.getInt("id"), category, r.getString("title"), r.getString("text"), r.getString("image_url"))); } catch (IllegalArgumentException exception) { LOGGER.debug("Illegal argument found in info_insight_cards", categoryString); } return Optional.absent(); }
Source:
<code>void shutdownBlobStore(PartitionId id) { BlobStore store = (BlobStore) getStore(id); if (store != null) { try { <START> Thread shutdownThread = Utils.newThread("store-shutdown-" + id, () -> { <END> try { store.shutdown(); } catch (Exception e) { logger.error("Exception while shutting down store on disk {}", id, disk, e); } }, false); shutdownThread.start(); shutdownThread.join(); } catch (Exception e) { logger.error("Could not shut down the store on disk {}", id, disk, e); } } }</code><technical_language>need a thread for this is a store shutdown</technical_language>

Target:
boolean shutdownBlobStore(PartitionId id) { BlobStore store = (BlobStore) getStore(id); if (store == null) { return false; } try { store.shutdown(); } catch (Exception e) { logger.error("Exception while shutting down store on disk {}", id, disk, e); return false; } return true; }
Source:
<code>public boolean isDown() { boolean ret = false; if (hardDown) { ret = true; } else if (failureCount.get() >= failureCountThreshold) { synchronized (this) { if (SystemTime.getInstance().milliseconds() < downUntil) { <START> ret = true; <END> } } } return ret; }</code><technical_language>want check failureCount if. If is zero, want return false. miss a success</technical_language>

Target:
public boolean isDown() { boolean down = false; if (hardDown) { down = true; } else if (failureCount.get() >= failureCountThreshold) { if (SystemTime.getInstance().milliseconds() < downUntil.get()) { down = true; } } return down; }
Source:
<code>private boolean isImageExist() { if (getImage() == null || getImage().getDiskStorageType() != Disk.DiskStorageType.IMAGE) { <START> addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_DISK_NOT_EXIST); <END> return false; } return true; }</code><technical_language>instead of addCanDoActionMessage return false, failCanDoAction method both</technical_language>

Target:
private boolean isImageExist() { if (getImage() == null || getImage().getDiskStorageType() != Disk.DiskStorageType.IMAGE) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_NOT_EXIST); } return true; }
Source:
<code>private Response invokeParticipantMethod(Method method, URI lraId, URI parentId, String type) { Object participant = CDI.current().select(id).get(); Object result = null; switch (method.getParameterCount()) { case 0: result = invokeMethod(type, method, participant); break; case 1: result = invokeMethod(type, method, participant, lraId); break; case 2: result = invokeMethod(type, method, participant, lraId, parentId); break; default: throw new InvalidLRAParticipantDefinitionException( method.toGenericString() + ": invalid number of arguments: " + method.getParameterCount()); } Response.ResponseBuilder builder = Response.status(Response.Status.OK); if (result instanceof CompletionStage) { try { <START> result = ((CompletionStage) result).toCompletableFuture().get(); <END> } catch (InterruptedException | ExecutionException e) { throw new RuntimeException(e); } } if (result == null) { builder.status(Response.Status.NOT_FOUND); } else if (method.getReturnType().equals(Void.TYPE)) { builder.entity(type.equals(COMPLETE) ? ParticipantStatus.Completed.name() : ParticipantStatus.Compensated.name()); } else if (result instanceof ParticipantStatus) { builder.entity(((ParticipantStatus) result).name()); } else if (result instanceof Response) { return (Response) result; } else { throw new InvalidLRAParticipantDefinitionException( method.toGenericString() + ": invalid type of returned object: " + result.getClass()); } return builder.build(); }</code><technical_language>This is a blocking call</technical_language>

Target:
private Response invokeParticipantMethod(Method method, URI lraId, URI parentId, String type) { Object participant = getInstance(); Object result; switch (method.getParameterCount()) { case 0: result = invokeMethod(type, method, participant); break; case 1: result = invokeMethod(type, method, participant, lraId); break; case 2: result = invokeMethod(type, method, participant, lraId, parentId); break; default: throw new IllegalStateException( method.toGenericString() + ": invalid number of arguments: " + method.getParameterCount()); } return processResult(result, lraId, method, type); }
Source:
<code>protected void configureGraphicalViewer() { super.configureGraphicalViewer(); AdvancedScrollingGraphicalViewer viewer = getGraphicalViewer(); ScalableFreeformRootEditPart root = createRootEditPart(); ContextMenuProvider cmp = getContextMenuProvider(viewer, root.getZoomManager()); if (cmp != null) { viewer.setContextMenu(cmp); getSite().registerContextMenu("org.eclipse.fordiac.ide.gef.contextmenu", cmp, viewer); } viewer.setRootEditPart(root); viewer.setEditPartFactory(getEditPartFactory()); <START> AdvancedGraphicalViewerKeyHandler keyHandler = new AdvancedGraphicalViewerKeyHandler(viewer); <END> viewer.setKeyHandler(keyHandler); viewer.setProperty(MouseWheelHandler.KeyGenerator.getKey(SWT.MOD1), MouseWheelZoomHandler.SINGLETON); }</code><technical_language>setParent is missing? is this good bad</technical_language>

Target:
protected void configureGraphicalViewer() { super.configureGraphicalViewer(); AdvancedScrollingGraphicalViewer viewer = getGraphicalViewer(); ScalableFreeformRootEditPart root = createRootEditPart(); ContextMenuProvider cmp = getContextMenuProvider(viewer, root.getZoomManager()); if (cmp != null) { viewer.setContextMenu(cmp); getSite().registerContextMenu("org.eclipse.fordiac.ide.gef.contextmenu", cmp, viewer); } viewer.setRootEditPart(root); viewer.setEditPartFactory(getEditPartFactory()); AdvancedGraphicalViewerKeyHandler keyHandler = new AdvancedGraphicalViewerKeyHandler(viewer); keyHandler.setParent(getCommonKeyHandler()); viewer.setKeyHandler(keyHandler); viewer.setProperty(MouseWheelHandler.KeyGenerator.getKey(SWT.MOD1), MouseWheelZoomHandler.SINGLETON); }
Source:
<code>public void onOpened() { super.onOpened(); SimpleUri worldGenUri = config.getWorldGeneration().getDefaultGenerator(); Name moduleName = worldGenUri.getModuleName(); try { DependencyResolver resolver = new DependencyResolver(moduleManager.getRegistry()); ResolutionResult result = resolver.resolve(moduleName); if (result.isSuccess()) { environment = moduleManager.loadEnvironment(result.getModules(), false); CoreRegistry.put(WorldGeneratorPluginLibrary.class, new TempWorldGeneratorPluginLibrary(environment)); <START> CoreRegistry.get(AssetManager.class).setEnvironment(environment); <END> worldGenerator = worldGeneratorManager.searchForWorldGenerator(worldGenUri, environment); worldGenerator.setWorldSeed(seed.getText()); previewGen = new FacetLayerPreview(environment, worldGenerator); configureProperties(); triggerUpdate = true; } else { logger.error("Could not resolve modules for: {}", worldGenUri); } } catch (Exception e) { worldGenerator = null; logger.error("Unable to load world generator: " + worldGenUri + " for a 2d preview", e); } }</code><technical_language>I currently remove CoreRegistry usage. AssetManager obtained depenendcy injection. e.g. adding a private AssetManager field @In annotation. registration done #1721 is merged obtaining a Context instance dependency injection. offers a put method CoreRegistry. I find a bit strange of a location for registering objects</technical_language>

Target:
public void onOpened() { super.onOpened(); SimpleUri worldGenUri = config.getWorldGeneration().getDefaultGenerator(); Name moduleName = worldGenUri.getModuleName(); try { DependencyResolver resolver = new DependencyResolver(moduleManager.getRegistry()); ResolutionResult result = resolver.resolve(moduleName); if (result.isSuccess()) { environment = moduleManager.loadEnvironment(result.getModules(), false); context.put(WorldGeneratorPluginLibrary.class, new TempWorldGeneratorPluginLibrary(environment, context)); assetManager.setEnvironment(environment); worldGenerator = worldGeneratorManager.searchForWorldGenerator(worldGenUri, environment); worldGenerator.setWorldSeed(seed.getText()); previewGen = new FacetLayerPreview(environment, worldGenerator); configureProperties(); triggerUpdate = true; } else { logger.error("Could not resolve modules for: {}", worldGenUri); } } catch (Exception e) { worldGenerator = null; logger.error("Unable to load world generator: " + worldGenUri + " for a 2d preview", e); } }
Source:
<code>public void send(ThroughputEvent event) { <START> logger.info("send ThroughputEvent : {}", event.toString()); <END> }</code><technical_language>remove toStirng</technical_language>

Target:
public void send(ThroughputEvent event) { logger.info("send ThroughputEvent : {}", event); }
Source:
<code>public static List<RedDeerLauncherProperties> loadAll(ILaunchConfiguration configuration) throws CoreException{ List<RedDeerLauncherProperties> properties = new ArrayList<RedDeerLauncherProperties>(); for (String key : configuration.getAttributes().keySet()){ if (key.startsWith(RedDeerLauncherProperties.ATTRIBUTE_PREFIX)){ String argName = key.replace(RedDeerLauncherProperties.ATTRIBUTE_PREFIX, ""); try{ RedDeerProperties rdProperty = getByName(argName); RedDeerLauncherProperties property = new RedDeerLauncherProperties(rdProperty); String argValue = configuration.getAttribute(key, property.getProperty().getValue()); property.setCurrentValue(argValue); property.setDoubleDefined(configuration); <START> System.out.println("Found property: " + property.getProperty().getName() + " with value " + property.currentValue); <END> properties.add(property); } catch (RedDeerException re){ } } } return properties; }</code><technical_language>Please remove this line</technical_language>

Target:
public static List<RedDeerLauncherProperties> loadAll(ILaunchConfiguration configuration) throws CoreException{ List<RedDeerLauncherProperties> properties = new ArrayList<RedDeerLauncherProperties>(); for (String key : configuration.getAttributes().keySet()){ if (key.startsWith(RedDeerLauncherProperties.ATTRIBUTE_PREFIX)){ String argName = key.replace(RedDeerLauncherProperties.ATTRIBUTE_PREFIX, ""); try{ RedDeerProperties rdProperty = getByName(argName); RedDeerLauncherProperties property = new RedDeerLauncherProperties(rdProperty); String argValue = configuration.getAttribute(key, property.getProperty().getValue()); property.setCurrentValue(argValue); property.setDoubleDefined(configuration); properties.add(property); } catch (RedDeerException re){ } } } return properties; }
Source:
<code>public TextTrackScore( Format format, Parameters parameters, int trackFormatSupport, @Nullable String selectedAudioLanguage) { isWithinRendererCapabilities = isSupported(trackFormatSupport, false); int maskedSelectionFlags = format.selectionFlags & ~parameters.disabledTextTrackSelectionFlags; isDefault = (maskedSelectionFlags & C.SELECTION_FLAG_DEFAULT) != 0; boolean isForced = (maskedSelectionFlags & C.SELECTION_FLAG_FORCED) != 0; preferredLanguageScore = getFormatLanguageScore( format, parameters.preferredTextLanguage, parameters.selectUndeterminedTextLanguage); <START> preferredRoleFlagsScore = format.roleFlags & parameters.preferredRoleFlags; <END> hasPreferredIsForcedFlag = (preferredLanguageScore > 0 && !isForced) || (preferredLanguageScore == 0 && isForced); boolean selectedAudioLanguageUndetermined = normalizeUndeterminedLanguageToNull(selectedAudioLanguage) == null; selectedAudioLanguageScore = getFormatLanguageScore(format, selectedAudioLanguage, selectedAudioLanguageUndetermined); isWithinConstraints = (preferredLanguageScore > 0 || (parameters.preferredTextLanguage == null && selectedAudioLanguageScore > 0 && preferredRoleFlagsScore > 0)) || isDefault || (isForced && selectedAudioLanguageScore > 0); }</code><technical_language>I need count number of matches: Integer.bitCount(format.roleFlags & parameters.preferredRoleFlags)</technical_language>

Target:
public TextTrackScore( Format format, Parameters parameters, int trackFormatSupport, @Nullable String selectedAudioLanguage) { isWithinRendererCapabilities = isSupported(trackFormatSupport, false); int maskedSelectionFlags = format.selectionFlags & ~parameters.disabledTextTrackSelectionFlags; isDefault = (maskedSelectionFlags & C.SELECTION_FLAG_DEFAULT) != 0; boolean isForced = (maskedSelectionFlags & C.SELECTION_FLAG_FORCED) != 0; preferredLanguageScore = getFormatLanguageScore( format, parameters.preferredTextLanguage, parameters.selectUndeterminedTextLanguage); preferredRoleFlagsScore = Integer.bitCount(format.roleFlags & parameters.preferredRoleFlags); hasPreferredIsForcedFlag = (preferredLanguageScore > 0 && !isForced) || (preferredLanguageScore == 0 && isForced); hasPreferredRoleFlags = parameters.preferredRoleFlags > 0; hasCaptionRoleFlags = Integer.bitCount(format.roleFlags & (C.ROLE_FLAG_CAPTION | C.ROLE_FLAG_DESCRIBES_MUSIC_AND_SOUND)); boolean selectedAudioLanguageUndetermined = normalizeUndeterminedLanguageToNull(selectedAudioLanguage) == null; selectedAudioLanguageScore = getFormatLanguageScore(format, selectedAudioLanguage, selectedAudioLanguageUndetermined); isWithinConstraints = (preferredLanguageScore > 0 || (parameters.preferredTextLanguage == null && preferredRoleFlagsScore > 0)) || isDefault || (isForced && selectedAudioLanguageScore > 0); }
Source:
<code>private boolean acceptorAgreesIsLatestRound(PaxosAcceptor acceptor, long round) { try { return round >= acceptor.getLatestSequencePreparedOrAccepted(); } catch (Exception e) { <START> log.debug("latest sequence retrieval failed for acceptor: {}", acceptor, e); <END> throw e; } }</code><technical_language>want this a higher level - internally logged DEBUG. I realise if a node is this a bit of spam, INFO is okay</technical_language>

Target:
private boolean acceptorAgreesIsLatestRound(PaxosAcceptor acceptor, long round) { try { return round >= acceptor.getLatestSequencePreparedOrAccepted(); } catch (Exception e) { log.info("latest sequence retrieval failed", e); throw e; } }
Source:
<code>private String getZkPathForKey(byte[] key) { try { return String.format("%s/%s", zkBaseDir, new String(key, "UTF-8")); <START> } catch (UnsupportedEncodingException e) { <END> throw new SamzaException(e); } }</code><technical_language>String constructor explicit Charset instead (Charset.forName("UTF-8") remove try-catch</technical_language>

Target:
private String getZkPathForKey(byte[] key) { return String.format("%s/%s", zkBaseDir, new String(key, Charset.forName("UTF-8"))); }
Source:
<code>public void process(Exchange exchange) throws Exception { Message in = exchange.getIn(); String binaryUri = (String) in.getHeader(FCREPO_URI); String binarySubPath = (String) in.getHeader(CdrBinarySubPath); final ExecResult result = (ExecResult) in.getBody(); <START> String derivativePath = new BufferedReader(new InputStreamReader(result.getStdout())) <END> .lines().collect(Collectors.joining("\n")); moveFile(binaryUri, binarySubPath, derivativePath); }</code><technical_language>this derivativeTmpPath? I a hard time paths landing in variables is derivatives</technical_language>

Target:
public void process(Exchange exchange) throws Exception { Message in = exchange.getIn(); String binaryUri = (String) in.getHeader(FCREPO_URI); String binaryId = PIDs.get(binaryUri).getId(); String derivativePath = RepositoryPaths .idToPath(binaryId, HASHED_PATH_DEPTH, HASHED_PATH_SIZE); final ExecResult result = (ExecResult) in.getBody(); String derivativeTmpPath = new BufferedReader(new InputStreamReader(result.getStdout())) .lines().collect(Collectors.joining("\n")); derivativeTmpPath += "." + fileExtension; String derivativeFinalRelative = derivativePath + binaryId + "." + fileExtension; Path derivativeFinalPath = Paths.get(derivativeBasePath, derivativeFinalRelative); moveFile(derivativeTmpPath, derivativeFinalPath); log.info("Adding derivative for from {}", binaryUri, derivativeFinalPath); }
Source:
<code>public AbstractAnnotationsDetail(final AbstractBuild<?, ?> owner, final DetailFactory detailFactory, final Collection<FileAnnotation> annotations, final String defaultEncoding, final String name, final Hierarchy hierarchy) { super(name, hierarchy); this.owner = owner; this.detailFactory = detailFactory; this.defaultEncoding = defaultEncoding; <START> addAnnotations(annotations); <END> }</code><technical_language>A simpler delegate new constructor</technical_language>

Target:
public AbstractAnnotationsDetail(final AbstractBuild<?, ?> owner, final DetailFactory detailFactory, final Collection<FileAnnotation> annotations, final String defaultEncoding, final String name, final Hierarchy hierarchy) { this((Run<?, ?>) owner, detailFactory, annotations, defaultEncoding, name, hierarchy); }
Source:
<code>protected void configure() { <START> bind(KeycloakUserRemover.class); <END> bind(RemoveUserListener.class).asEagerSingleton(); }</code><technical_language>I redundant binding</technical_language>

Target:
protected void configure() { bind(RemoveUserListener.class).asEagerSingleton(); }
Source:
<code>private void updateWidgetOffsets(int fromOffset) { if (document == null) { widgetLines = 0; return; } final int docLines = document.getNumberOfLines(); if (!isFixedWidth()) { widgetLines = docLines; } else { try { final int offset = Math.max(fromOffset, 0); int docLineIndex = Math.max(document.getLineOfOffset(offset), 0); final int docLineOffset = document.getLineOffset(docLineIndex); int widgetLineIndex; if (docLineOffset > 0) { widgetLineIndex = getLineOfOffset(docLineOffset); } else { widgetLineIndex = 0; ensureOffsetsCapacity(widgetLineIndex + 1); widgetLineOffsets[widgetLineIndex] = 0; } for (; docLineIndex < docLines; docLineIndex++) { int lineLength = document.getLineInformation(docLineIndex).getLength(); for (; lineLength > fixedConsoleWidth; lineLength -= fixedConsoleWidth) { widgetLineIndex++; ensureOffsetsCapacity(widgetLineIndex + 1); widgetLineOffsets[widgetLineIndex] = widgetLineOffsets[widgetLineIndex - 1] + fixedConsoleWidth; } final String docLineDelimiter = document.getLineDelimiter(docLineIndex); if (docLineDelimiter != null) { widgetLineIndex++; <START> ensureOffsetsCapacity(widgetLineIndex + 1); widgetLineOffsets[widgetLineIndex] = <END> widgetLineOffsets[widgetLineIndex - 1] + lineLength + docLineDelimiter.length(); } } widgetLines = widgetLineIndex + 1; } catch (BadLocationException e) { log(e); } } }</code><technical_language>extracted method I think</technical_language>

Target:
private void updateWidgetOffsets(int fromOffset) { if (document == null) { widgetLines = 0; return; } final int docLines = document.getNumberOfLines(); if (!isFixedWidth()) { widgetLines = docLines; } else { try { final int offset = Math.max(fromOffset, 0); int docLineIndex = Math.max(document.getLineOfOffset(offset), 0); final int docLineOffset = document.getLineOffset(docLineIndex); int widgetLineIndex; if (docLineOffset > 0) { widgetLineIndex = getLineOfOffset(docLineOffset); } else { widgetLineIndex = 0; setLookupEntry(widgetLineIndex, 0); } for (; docLineIndex < docLines; docLineIndex++) { int lineLength = document.getLineInformation(docLineIndex).getLength(); for (; lineLength > fixedConsoleWidth; lineLength -= fixedConsoleWidth) { widgetLineIndex++; setLookupEntry(widgetLineIndex, widgetLineOffsets[widgetLineIndex - 1] + fixedConsoleWidth); } final String docLineDelimiter = document.getLineDelimiter(docLineIndex); if (docLineDelimiter != null) { widgetLineIndex++; setLookupEntry(widgetLineIndex, widgetLineOffsets[widgetLineIndex - 1] + lineLength + docLineDelimiter.length()); } } widgetLines = widgetLineIndex + 1; } catch (BadLocationException e) { log(e); } } }
Source:
<code>public MapInfoBean parseSingleMap(String mapName) throws IOException { MapVaultHtmlContentHandler mapVaultHtmlContentHandler = new MapVaultHtmlContentHandler(); URL url = new URL(String.format(environment.getProperty("vault.singleMapUrl"), mapName)); HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection(); try (BufferedReader reader = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()))) { JsonReader jsonReader = new JsonReader(reader); jsonReader.beginObject(); while (jsonReader.hasNext()) { String key = jsonReader.nextName(); if (!"layout".equals(key)) { jsonReader.skipValue(); continue; } String layout = jsonReader.nextString(); List<MapInfoBean> mapInfoBeans = htmlParser.parse(layout, mapVaultHtmlContentHandler); if (!mapInfoBeans.isEmpty()) { for (MapInfoBean mapInfoBean : mapInfoBeans) { if (mapInfoBean.getDisplayName().equalsIgnoreCase(mapName)) { return mapInfoBean; } } } } jsonReader.endObject(); } <START> logger.warn("Map vault could not be read from {}", url); <END> throw new IOException("Map vault could not be read from" + url); }</code><technical_language>Logging done exception is catched thrown. message is in exception</technical_language>

Target:
public MapInfoBean parseSingleMap(String mapName) throws IOException { MapVaultHtmlContentHandler mapVaultHtmlContentHandler = new MapVaultHtmlContentHandler(); URL url = new URL(String.format(environment.getProperty("vault.singleMapUrl"), mapName)); HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection(); try (BufferedReader reader = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()))) { JsonReader jsonReader = new JsonReader(reader); jsonReader.beginObject(); while (jsonReader.hasNext()) { String key = jsonReader.nextName(); if (!"layout".equals(key)) { jsonReader.skipValue(); continue; } String layout = jsonReader.nextString(); List<MapInfoBean> mapInfoBeans = htmlParser.parse(layout, mapVaultHtmlContentHandler); if (!mapInfoBeans.isEmpty()) { for (MapInfoBean mapInfoBean : mapInfoBeans) { if (mapInfoBean.getTechnicalName().equalsIgnoreCase(mapName)) { return mapInfoBean; } } } } jsonReader.endObject(); } throw new IOException("Map vault could not be read from " + url); }
Source:
<code>public void setUp() { initMocks(this); <START> queryStockLedgerActionService = new QueryStockLedgerActionServiceImpl(stockTransactionService, eventRelay); <END> eventHandler = new QueryStockLedgerEventHandler(queryStockLedgerActionService); request = prepareRequest(); }</code><technical_language>mock</technical_language>

Target:
public void setUp() { initMocks(this); eventHandler = new QueryStockLedgerEventHandler(queryStockLedgerActionService); }
Source:
<code>private void checkAndInitSevenZip() { if (Sirius.isFrameworkEnabled(FRAMEWORK_SEVEN_ZIP)) { try { Log.SYSTEM.INFO("Loading 7-ZIP native libraries to support all breeds of archive formats..."); SevenZip.initSevenZipFromPlatformJAR(); sevenZipEnabled = true; } catch (Throwable e) { Exceptions.handle() .to(Log.SYSTEM) .error(e) <START> .withSystemErrorMessage("Failed to inizialize 7-Zip: %s (%s)") <END> .handle(); sevenZipEnabled = false; } } else { sevenZipEnabled = false; } }</code><technical_language>suggestion .withSystemErrorMessage("Failed initialize 7-Zip: %s (%s)")</technical_language>

Target:
private void checkAndInitSevenZip() { if (Sirius.isFrameworkEnabled(FRAMEWORK_SEVEN_ZIP)) { try { Log.SYSTEM.INFO("Loading 7-ZIP native libraries to support all breeds of archive formats..."); SevenZip.initSevenZipFromPlatformJAR(); sevenZipEnabled = true; } catch (Throwable e) { Exceptions.handle() .to(Log.SYSTEM) .error(e) .withSystemErrorMessage("Failed to initialize 7-Zip: %s (%s)") .handle(); sevenZipEnabled = false; } } else { sevenZipEnabled = false; } }
Source:
<code>public DefaultLeaderRetrievalService(LeaderRetrievalDriverFactory leaderRetrievalDriverFactory) { <START> this.leaderRetrievalDriverFactory = leaderRetrievalDriverFactory; <END> this.lastLeaderAddress = null; this.lastLeaderSessionID = null; running = false; }</code><technical_language>null check</technical_language>

Target:
public DefaultLeaderRetrievalService(LeaderRetrievalDriverFactory leaderRetrievalDriverFactory) { this.leaderRetrievalDriverFactory = checkNotNull(leaderRetrievalDriverFactory); this.lastLeaderAddress = null; this.lastLeaderSessionID = null; running = false; }