auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private boolean canFindVmOrTemplate() { boolean retValue = true; if (getParameters().getOperation() == ImageOperation.Copy) { VmTemplate template = getVmTemplateDAO().get(getImage().getvm_guid()); if (template == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_DOES_NOT_EXIST); retValue = false; } else { setVmTemplate(template); sharedLockMap = Collections.singletonMap(getImage().getvm_guid(), LockingGroup.TEMPLATE.name()); } } else { List<VM> listVms = getVmsForDiskId(); if (!listVms.isEmpty()) { sharedLockMap = new HashMap<Guid, String>(); for (VM vm : listVms) { sharedLockMap.put(vm.getId(), LockingGroup.VM.name()); } } <START> retValue = true; <END> } return retValue; }</code><technical_language>need for retValue</technical_language>

Target:
private boolean canFindVmOrTemplate() { boolean retValue = true; if (getParameters().getOperation() == ImageOperation.Copy) { VmTemplate template = getVmTemplateDAO().get(getImage().getvm_guid()); if (template == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_DOES_NOT_EXIST); retValue = false; } else { setVmTemplate(template); sharedLockMap = Collections.singletonMap(getImage().getvm_guid(), LockingGroup.TEMPLATE.name()); } } else { List<VM> listVms = getVmsForDiskId(); if (!listVms.isEmpty()) { sharedLockMap = new HashMap<Guid, String>(); for (VM vm : listVms) { sharedLockMap.put(vm.getId(), LockingGroup.VM.name()); } } } return retValue; }
Source:
<code>private Iterable<Result<Item>> listObjectsV2(ListObjectsArgs args) { return new Iterable<Result<Item>>() { @Override public Iterator<Result<Item>> iterator() { return new ObjectIterator() { protected void populateResult() throws InvalidKeyException, InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, InsufficientDataException, XmlParserException, ErrorResponseException, InternalException, InvalidResponseException, IOException { <START> String delimiter = "/"; <END> if (args.recursive()) { delimiter = null; } String continuationToken = null; if (this.listBucketResult != null) { continuationToken = listBucketResult.nextContinuationToken(); } this.listBucketResult = null; this.itemIterator = null; this.prefixIterator = null; this.listBucketResult = invokeListObjectsV2( ListObjectsArgs.builder() .bucket(args.bucketName()) .continuationToken(continuationToken) .delimiter(delimiter) .fetchOwner(args.fetchOwner()) .prefix(args.prefix()) .includeUserMetadata(args.includeUserMetadata()) .build()); } }; } }; }</code><technical_language>need delimiter args.delimiter() if is null default /</technical_language>

Target:
private Iterable<Result<Item>> listObjectsV2(ListObjectsArgs args) { return new Iterable<Result<Item>>() { @Override public Iterator<Result<Item>> iterator() { return new ObjectIterator() { protected void populateResult() throws InvalidKeyException, InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, InsufficientDataException, XmlParserException, ErrorResponseException, InternalException, InvalidResponseException, IOException { String delimiter = getDelimiter(args); String continuationToken = null; if (this.listBucketResult != null) { continuationToken = listBucketResult.nextContinuationToken(); } this.listBucketResult = null; this.itemIterator = null; this.prefixIterator = null; this.listBucketResult = invokeListObjectsV2( ListObjectsArgs.builder() .bucket(args.bucket()) .continuationToken(continuationToken) .delimiter(delimiter) .fetchOwner(args.fetchOwner()) .prefix(args.prefix()) .includeUserMetadata(args.includeUserMetadata()) .build()); } }; } }; }
Source:
<code>protected void execStore() { Set<IForm> formsToStore = getOpenFormsField().getValue().stream() <START> .flatMap(a -> a.stream()) <END> .collect(Collectors.toSet()); for (IForm f : formsToStore) { if (isWizardContainerForm(f)) { ((IWizardContainerForm) f).getWizard().doFinish(); } else { f.doOk(); } } m_forms.stream() .filter(f -> !formsToStore.contains(f) && isWizardContainerForm(f)) .map(f -> ((IWizardContainerForm) f).getWizard()) .forEach(IWizard::doSuspend); }</code><technical_language>minor: a function reference instead</technical_language>

Target:
protected void execStore() { Set<IForm> formsToStore = getOpenFormsField().getValue().stream() .flatMap(Collection::stream) .collect(Collectors.toSet()); for (IForm f : formsToStore) { if (isWizardContainerForm(f)) { ((IWizardContainerForm) f).getWizard().doFinish(); } else { f.doOk(); } } m_forms.stream() .filter(f -> !formsToStore.contains(f) && isWizardContainerForm(f)) .map(f -> ((IWizardContainerForm) f).getWizard()) .forEach(this::closeWizard); }
Source:
<code>public void canLowerKey() { final TreeMap<String, Integer> unit = TreeMap.ofEntries(aaron, carter, john, nancy, simon); assertThat(unit.lowerKey("john")).isEqualTo(Option.of("carter")); assertThat(unit.lowerKey("eddie")).isEqualTo(Option.of("carter")); <START> assertThat(unit.lowerKey("aaa")).isEqualTo(Option.none()); <END> }</code><technical_language>numbers instead of weird random names, please :)</technical_language>

Target:
public void canLowerKey() { final TreeMap<Integer, Integer> unit = TreeMap.ofEntries(one, three, five, seven, nine); assertThat(unit.lowerKey(5)).isEqualTo(Option.of(3)); assertThat(unit.lowerKey(4)).isEqualTo(Option.of(3)); assertThat(unit.lowerKey(0)).isEqualTo(Option.none()); }
Source:
<code>private List<PyExpressionTree> getConditionsToCompare(PyIfStatementTree ifStatement) { <START> List<PyExpressionTree> conditions = new ArrayList<>(Collections.singletonList(ifStatement.condition())); <END> conditions.addAll(ifStatement.elifBranches().stream().map(PyIfStatementTree::condition).collect(Collectors.toList())); PyElseStatementTree elseStatement = ifStatement.elseBranch(); if (elseStatement != null) { lookForElseIfs(conditions, elseStatement); } return conditions; }</code><technical_language>This is a bit convoluted imo : adding condition conditions list initialized empty. remove Collections.singletonList call</technical_language>

Target:
private List<PyExpressionTree> getConditionsToCompare(PyIfStatementTree ifStatement) { List<PyExpressionTree> conditions = new ArrayList<>(); conditions.add(ifStatement.condition()); conditions.addAll(ifStatement.elifBranches().stream().map(PyIfStatementTree::condition).collect(Collectors.toList())); PyElseStatementTree elseStatement = ifStatement.elseBranch(); if (elseStatement != null) { lookForElseIfs(conditions, elseStatement); } return conditions; }
Source:
<code>public static int nextAvailablePort(int port) { checkArgument(port >= MIN_PORT_NUMBER && port <= MAX_PORT_NUMBER, "requested port %s is outside the valid range of %s to %s", port, MIN_PORT_NUMBER, MAX_PORT_NUMBER); int originalPort = port; while (!isPortAvailable(port) && port <= MAX_PORT_NUMBER) port++; <START> if (port >= MAX_PORT_NUMBER) <END> throw new RuntimeException("attempt to find a free port at or above " + originalPort); return port; }</code><technical_language>I think, _could_ port 65535 available</technical_language>

Target:
public static int nextAvailablePort(int port) { checkArgument(port >= MIN_PORT_NUMBER && port <= MAX_PORT_NUMBER, "requested port %s is outside the valid range of %s to %s", port, MIN_PORT_NUMBER, MAX_PORT_NUMBER); int originalPort = port; while (!isPortAvailable(port) && port <= MAX_PORT_NUMBER) port++; if (port > MAX_PORT_NUMBER) throw new RuntimeException("unable to find a free port at or above " + originalPort); return port; }
Source:
<code>public SSHClient getSSHClient() { Long timeout = TimeUnit.SECONDS.toMillis(Config.<Integer> GetValue(ConfigValues.ConnectToServerTimeoutInSeconds)); EngineSSHClient sshclient = new EngineSSHClient(); sshclient.setVds(getParameters().getvds()); sshclient.setHardTimeout(timeout); sshclient.setSoftTimeout(timeout); <START> if (getParameters().getAuthMethod() == AuthenticationMethod.PublicKey) { <END> sshclient.useDefaultKeyPair(); } else { sshclient.setPassword(getParameters().getPassword()); } return sshclient; }</code><technical_language>if enum... assume else... switch(enum) { case a: break; case b: break; default: throw new *Exception("invalid..."); }</technical_language>

Target:
public EngineSSHClient getSSHClient() throws Exception { Long timeout = TimeUnit.SECONDS.toMillis(Config.<Integer> GetValue(ConfigValues.ConnectToServerTimeoutInSeconds)); EngineSSHClient sshclient = new EngineSSHClient(); sshclient.setVds(getParameters().getvds()); sshclient.setHardTimeout(timeout); sshclient.setSoftTimeout(timeout); switch (getParameters().getAuthMethod()) { case PublicKey: sshclient.useDefaultKeyPair(); break; case Password: sshclient.setPassword(getParameters().getPassword()); break; default: throw new Exception("Invalid authentication method value was sent to AddVdsCommand"); } return sshclient; }
Source:
<code>public Response getSkinResource(@PathParam("path") String path) { try { ScriptFile file = getModule().getSkinResource("/resources/" + path); if (file != null) { long lastModified = file.lastModified(); ResponseBuilder resp = Response.ok(file.getFile()) .lastModified(new Date(lastModified)) .header("Cache-Control", "public") .header("Server", "Nuxeo/WebEngine-1.0"); String mimeType = ctx.getEngine().getMimeType(file.getExtension()); if (mimeType == null) { mimeType = "text/plain"; } resp.type(mimeType); return resp.build(); } } catch (IOException e) { throw new NuxeoException("Failed to get resource file: " + path, e); } <START> return Response.status(404).build(); <END> }</code><technical_language>replace proper constant</technical_language>

Target:
public Response getSkinResource(@PathParam("path") String path) { try { ScriptFile file = getModule().getSkinResource("/resources/" + path); if (file != null) { long lastModified = file.lastModified(); ResponseBuilder resp = Response.ok(file.getFile()) .lastModified(new Date(lastModified)) .header("Cache-Control", "public") .header("Server", "Nuxeo/WebEngine-1.0"); String mimeType = ctx.getEngine().getMimeType(file.getExtension()); if (mimeType == null) { mimeType = "text/plain"; } resp.type(mimeType); return resp.build(); } } catch (IOException e) { throw new NuxeoException("Failed to get resource file: " + path, e); } return Response.status(SC_NOT_FOUND).build(); }
Source:
<code>public <R, E extends Exception> R execute(ExceptionFunction<T, R, E> function) throws E { Lock lock = this.lock.readLock(); lock.lock(); try { T value = this.value; <START> return (value != null) ? function.apply(value) : null; <END> } finally { lock.unlock(); } }</code><technical_language>lines do perfect job for you. Yes, miss some statistics, this is case a race condition retrieving executor invoking it</technical_language>

Target:
public synchronized <R, E extends Exception> R execute(ExceptionFunction<T, R, E> function) throws E { return (this.value != null) ? function.apply(this.value) : null; }
Source:
<code>public boolean isGeneratedPathSameAsOriginal() { Optional<Path> newDir = databaseContext.getFirstExistingFileDir(filePreferences); Optional<Path> currentDir = linkedFile.findIn(databaseContext, filePreferences); <START> BiPredicate<Path, Path> equality = Files::isSameFile; <END> return OptionalUtil.equals(newDir, currentDir, equality); }</code><technical_language>a bit more precise exception is thrown</technical_language>

Target:
public boolean isGeneratedPathSameAsOriginal() { Optional<Path> newDir = databaseContext.getFirstExistingFileDir(filePreferences); Optional<Path> currentDir = linkedFile.findIn(databaseContext, filePreferences); BiPredicate<Path, Path> equality = (fileA, fileB) -> { try { return Files.isSameFile(fileA, fileB); } catch (IOException e) { return false; } }; return OptionalUtil.equals(newDir, currentDir, equality); }
Source:
<code>public SaslClient createSaslClient(final String[] mechanisms, final String authorizationId, final String protocol, final String serverName, Map<String, ?> props, final CallbackHandler cbh) throws SaslException { Assert.checkNotNullParam("cbh", cbh); if (props == null) props = Collections.emptyMap(); if (PlainSasl.isMatched(props, false)) for (String mechanism : mechanisms) { if (SaslMechanismInformation.Names.PLAIN.equals(mechanism)) { <START> boolean skipNormalization = "true".equals(props.get(WildFlySasl.SKIP_NORMALIZATION)); <END> return new PlainSaslClient(authorizationId, cbh, skipNormalization); } } return null; }</code><technical_language>I Boolean.parseBoolean here, i.e., Boolean.parseBoolean((String) props.get(WildFlySasl.SKIP_NORMALIZATION))</technical_language>

Target:
public SaslClient createSaslClient(final String[] mechanisms, final String authorizationId, final String protocol, final String serverName, Map<String, ?> props, final CallbackHandler cbh) throws SaslException { Assert.checkNotNullParam("cbh", cbh); if (props == null) props = Collections.emptyMap(); if (PlainSasl.isMatched(props, false)) for (String mechanism : mechanisms) { if (SaslMechanismInformation.Names.PLAIN.equals(mechanism)) { boolean skipNormalization; if (props.containsKey(WildFlySasl.SKIP_NORMALIZATION)) { skipNormalization = Boolean.parseBoolean((String) props.get(WildFlySasl.SKIP_NORMALIZATION)); } else { skipNormalization = false; } return new PlainSaslClient(authorizationId, cbh, skipNormalization); } } return null; }
Source:
<code>public CryptoOperationFragment() { <START> CryptoOperationHelper.Callback callback = new CryptoOperationHelper.Callback<T, S>() { <END> @Override public T createOperationInput() { return CryptoOperationFragment.this.createOperationInput(); } @Override public void onCryptoOperationSuccess(S result) { CryptoOperationFragment.this.onCryptoOperationSuccess(result); } @Override public void onCryptoOperationCancelled() { CryptoOperationFragment.this.onCryptoOperationCancelled(); } @Override public void onCryptoOperationError(S result) { CryptoOperationFragment.this.onCryptoOperationError(result); } @Override public boolean onCryptoSetProgress(String msg, int progress, int max) { return CryptoOperationFragment.this.onCryptoSetProgress(msg, progress, max); } }; mOperationHelper = new CryptoOperationHelper<>(this, callback); }</code><technical_language>is a reason this interface implemented in fragment</technical_language>

Target:
public CryptoOperationFragment() { mOperationHelper = new CryptoOperationHelper<>(this, this); }
Source:
<code>public void should_find_books() { populator.forServer(hostIp, 0) .withDatabase("travel-sample") <START> .usingDataSet("/airlines.json") <END> .execute(); CouchbaseCluster couchbaseCluster = CouchbaseCluster.create(hostIp); final Bucket books = couchbaseCluster.openBucket("travel-sample"); final JsonDocument vueling = books.get("airline_1"); final JsonObject vuelingObject = vueling.content(); assertThat(vuelingObject.getString("name")).isEqualTo("Vueling Airlines"); }</code><technical_language>potential improvement avoid / prefix. a bit confusing for user, assume in root OS folder. needed,</technical_language>

Target:
public void should_find_books() { populator.forServer(hostIp, 0) .withDatabase("travel-sample") .usingDataSet("airlines.json") .execute(); CouchbaseCluster couchbaseCluster = CouchbaseCluster.create(hostIp); final Bucket books = couchbaseCluster.openBucket("travel-sample"); final JsonDocument vueling = books.get("airline_1"); final JsonObject vuelingObject = vueling.content(); assertThat(vuelingObject.getString("name")).isEqualTo("Vueling Airlines"); }
Source:
<code>public void testPredicateAccessCache() throws Exception { final Ignite ignite0 = startGrid(0); <START> CacheConfiguration<String, String> cacheCfg = new CacheConfiguration<>(); <END> cacheCfg.setName("testCache"); cacheCfg.setAtomicityMode(ATOMIC); cacheCfg.setCacheMode(REPLICATED); cacheCfg.setWriteSynchronizationMode(FULL_SYNC); IgniteCache<String, String> cache = ignite0.getOrCreateCache(cacheCfg); cache.put(ignite0.cluster().localNode().id().toString(), "val"); latch = new CountDownLatch(1); final ClusterGroup grp = ignite0.cluster().forPredicate((IgnitePredicate<ClusterNode>) node -> { System.out.println("Predicated started [thread=" + Thread.currentThread().getName() + ']'); latch.countDown(); try { Thread.sleep(3000); } catch (InterruptedException ignore) { } System.out.println("Call contains key [thread=" + Thread.currentThread().getName() + ']'); boolean ret = Ignition.localIgnite().cache("testCache").containsKey(node.id().toString()); System.out.println("After contains key [ret=" + ret + ", thread=" + Thread.currentThread().getName() + ']'); return ret; }); IgniteInternalFuture<?> fut = GridTestUtils.runAsync(new Callable<Void>() { @Override public Void call() throws Exception { info("Start deploy service."); ignite0.services(grp).deployNodeSingleton("testService", new TestService()); info("Service deployed."); return null; } }, "deploy-thread"); latch.await(); startGrid(1); fut.get(); }</code><technical_language>this change</technical_language>

Target:
public void testPredicateAccessCache() throws Exception { final IgniteEx ignite0 = startGrid(0); CacheConfiguration<String, String> cacheCfg = new CacheConfiguration<>(); cacheCfg.setName("testCache"); cacheCfg.setAtomicityMode(ATOMIC); cacheCfg.setCacheMode(REPLICATED); cacheCfg.setWriteSynchronizationMode(FULL_SYNC); IgniteCache<String, String> cache = ignite0.getOrCreateCache(cacheCfg); if (ignite0.context().service() instanceof IgniteServiceProcessor) cache.put(ignite0.cluster().localNode().id().toString(), "val"); latch = new CountDownLatch(1); final ClusterGroup grp = ignite0.cluster().forPredicate((IgnitePredicate<ClusterNode>)node -> { System.out.println("Predicated started [thread=" + Thread.currentThread().getName() + ']'); latch.countDown(); try { Thread.sleep(3000); } catch (InterruptedException ignore) { } System.out.println("Call contains key [thread=" + Thread.currentThread().getName() + ']'); boolean ret = Ignition.localIgnite().cache("testCache").containsKey(node.id().toString()); System.out.println("After contains key [ret=" + ret + ", thread=" + Thread.currentThread().getName() + ']'); return ret; }); IgniteInternalFuture<?> fut = GridTestUtils.runAsync(new Callable<Void>() { @Override public Void call() throws Exception { info("Start deploy service."); ignite0.services(grp).deployNodeSingleton("testService", new TestService()); info("Service deployed."); return null; } }, "deploy-thread"); latch.await(); startGrid(1); fut.get(); }
Source:
<code>public MassMothballDialog(Frame parent, Unit[] units, Campaign campaign, boolean activate) { super(parent, "Mass Mothball/Activate"); setLocationRelativeTo(parent); sortUnitsByType(units); this.campaign = campaign; contentPanel.setLayout(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); gbc.gridwidth = 3; gbc.gridx = 0; gbc.gridy = 0; gbc.ipadx = 4; gbc.ipady = 4; gbc.insets = new Insets(2, 2, 2, 2); gbc.weightx = 3; JLabel instructionLabel = new JLabel(); instructionLabel.setBorder(new LineBorder(Color.BLUE)); instructionLabel.setText("<html>Choose the techs to carry out " + (activate ? "activation" : "mothballing") + " operations on the displayed units. <br/>" + "A * indicates that the tech is currently maintaining units.</html>"); contentPanel.add(instructionLabel, gbc); <START> <END> gbc.weightx = 1; gbc.gridy++; addTableHeaders(gbc); for (int unitType : unitsByType.keySet()) { gbc.gridy++; addUnitTypePanel(unitType, gbc); } gbc.gridy++; addExecuteButton(activate, gbc); scrollPane.setViewportView(contentPanel); scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setMaximumSize(new Dimension(600, 600)); scrollPane.setPreferredSize(new Dimension(600, 600)); getContentPane().add(scrollPane); this.setResizable(true); this.pack(); this.validate(); setUserPreferences(); }</code><technical_language>While in this file, a bug in this dialog shows activation time cost mothball time cost, 1/2 time. Do track down</technical_language>

Target:
public MassMothballDialog(Frame parent, Unit[] units, Campaign campaign, boolean activate) { super(parent, "Mass Mothball/Activate"); setLocationRelativeTo(parent); sortUnitsByType(units); this.campaign = campaign; this.activating = activate; contentPanel.setLayout(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); gbc.gridwidth = 3; gbc.gridx = 0; gbc.gridy = 0; gbc.ipadx = 4; gbc.ipady = 4; gbc.insets = new Insets(2, 2, 2, 2); gbc.weightx = 3; JLabel instructionLabel = new JLabel(); instructionLabel.setBorder(new LineBorder(Color.BLUE)); instructionLabel.setText("<html>Choose the techs to carry out " + (activating ? "activation" : "mothballing") + " operations on the displayed units. <br/>" + "A * indicates that the tech is currently maintaining units.</html>"); contentPanel.add(instructionLabel, gbc); gbc.weightx = 1; gbc.gridy++; addTableHeaders(gbc); for (int unitType : unitsByType.keySet()) { gbc.gridy++; addUnitTypePanel(unitType, gbc); } gbc.gridy++; addExecuteButton(activating, gbc); JScrollPane scrollPane = new JScrollPane(); scrollPane.setViewportView(contentPanel); scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setMaximumSize(new Dimension(600, 600)); scrollPane.setPreferredSize(new Dimension(600, 600)); getContentPane().add(scrollPane); this.setResizable(true); this.pack(); this.validate(); setUserPreferences(); }
Source:
<code>private void validate(@Nullable Schema inputSchema) { if (!Strings.isNullOrEmpty(suffix)) { new SimpleDateFormat(suffix); } if (!Strings.isNullOrEmpty(fileSystemProperties)) { new Gson().fromJson(fileSystemProperties, new TypeToken<Map<String, String>>() { }.getType()); } if (!isText() && !isAvro() && !isParquet()) { throw new IllegalArgumentException(String.format("Invalid format '%s. Must be 'text', 'avro', or 'parquet'.", format)); } getFSProperties(); <START> Schema schema = getSchema(inputSchema); <END> if ((isAvro() || isParquet()) && schema == null) { throw new IllegalArgumentException( String.format("Format '%s' cannot be used without a schema. Please set the schema property.", format)); } }</code><technical_language>getSchema parses schema if null. parse if a macro right ? support macro for schema field</technical_language>

Target:
private void validate(@Nullable Schema inputSchema) { if (!Strings.isNullOrEmpty(suffix)) { new SimpleDateFormat(suffix); } if (!Strings.isNullOrEmpty(fileSystemProperties)) { new Gson().fromJson(fileSystemProperties, new TypeToken<Map<String, String>>() { }.getType()); } if (!isText() && !isAvro() && !isParquet()) { throw new IllegalArgumentException(String.format("Invalid format '%s. Must be 'text', 'avro', or 'parquet'.", format)); } getFSProperties(); if (!containsMacro("schema")) { Schema schema = getSchema(inputSchema); if ((isAvro() || isParquet()) && schema == null) { throw new IllegalArgumentException( String.format("Format '%s' cannot be used without a schema. Please set the schema property.", format)); } } }
Source:
<code>void postConstruct(MApplication application) { IExtensionPoint point = extensionRegistry.getExtensionPoint("org.eclipse.ui.perspectives"); for (IConfigurationElement element : point.getConfigurationElements()) { String id = element.getAttribute(IWorkbenchRegistryConstants.ATT_ID); descriptors.put(id, new PerspectiveDescriptor(id, element)); } List<MUIElement> snippets = application.getSnippets(); for (MUIElement snippet : snippets) { if (snippet instanceof MPerspective) { MPerspective perspective = (MPerspective) snippet; String id = perspective.getElementId(); PerspectiveDescriptor existingDescriptor = descriptors.get(id); if (existingDescriptor == null) { createDescriptor(perspective); } else { existingDescriptor.setHasCustomDefinition(true); } } } <START> IEclipseContext childContext = context.createChild(); <END> childContext.set(PerspectiveRegistry.class, this); ContextInjectionFactory.make(ImportExportPespectiveHandler.class, childContext); }</code><technical_language>this context disposed</technical_language>

Target:
void postConstruct(MApplication application) { IExtensionPoint point = extensionRegistry.getExtensionPoint("org.eclipse.ui.perspectives"); for (IConfigurationElement element : point.getConfigurationElements()) { String id = element.getAttribute(IWorkbenchRegistryConstants.ATT_ID); descriptors.put(id, new PerspectiveDescriptor(id, element)); } List<MUIElement> snippets = application.getSnippets(); for (MUIElement snippet : snippets) { if (snippet instanceof MPerspective) { MPerspective perspective = (MPerspective) snippet; String id = perspective.getElementId(); PerspectiveDescriptor existingDescriptor = descriptors.get(id); if (existingDescriptor == null) { createDescriptor(perspective); } else { existingDescriptor.setHasCustomDefinition(true); } } } impExpHandlerContext = context.createChild(); impExpHandlerContext.set(PerspectiveRegistry.class, this); ContextInjectionFactory.make(ImportExportPespectiveHandler.class, impExpHandlerContext); }
Source:
<code>private ConnectorSplit createSplit(BucketShards bucketShards) { if (bucketShards.getBucketNumber().isPresent()) { return createBucketSplit(bucketShards.getBucketNumber().getAsInt(), bucketShards.getShards()); } verify(bucketShards.getShards().size() == 1, "wrong shard count for non-bucketed table"); ShardNodes shard = getOnlyElement(bucketShards.getShards()); UUID shardId = shard.getShardUuid(); Optional<UUID> deltaShardUuid = shard.getDeltaShardUuid(); Set<String> nodeIds = shard.getNodeIdentifiers(); List<HostAddress> addresses = getAddressesForNodes(nodesById, nodeIds); if (addresses.isEmpty()) { if (!backupAvailable) { throw new PrestoException(RAPTOR_NO_HOST_FOR_SHARD, format("No host for shard %s found: %s", shardId, nodeIds)); } Set<Node> availableNodes = nodeSupplier.getWorkerNodes(); if (availableNodes.isEmpty()) { throw new PrestoException(NO_NODES_AVAILABLE, "No nodes available to run query"); } Node node = selectRandom(availableNodes); <START> shardManager.replaceShardAssignment(tableId, shardId, <END> deltaShardUuid.isPresent() ? Optional.empty() : deltaShardUuid, node.getNodeIdentifier(), true); addresses = ImmutableList.of(node.getHostAndPort()); } return new RaptorSplit( connectorId, shardId, deltaShardUuid.isPresent() ? ImmutableMap.of(shardId, deltaShardUuid.get()) : ImmutableMap.of(), tableSupportsDeltaDelete, addresses, effectivePredicate, transactionId, columnTypes); }</code><technical_language>param line</technical_language>

Target:
private ConnectorSplit createSplit(BucketShards bucketShards) { if (bucketShards.getBucketNumber().isPresent()) { return createBucketSplit(bucketShards.getBucketNumber().getAsInt(), bucketShards.getShards()); } verify(bucketShards.getShards().size() == 1, "wrong shard count for non-bucketed table"); ShardNodes shard = getOnlyElement(bucketShards.getShards()); UUID shardUuid = shard.getShardUuid(); Optional<UUID> deltaShardUuid = shard.getDeltaShardUuid(); Set<String> nodeIds = shard.getNodeIdentifiers(); List<HostAddress> addresses = getAddressesForNodes(nodesById, nodeIds); if (addresses.isEmpty()) { if (!backupAvailable) { throw new PrestoException(RAPTOR_NO_HOST_FOR_SHARD, format("No host for shard %s found: %s", shardUuid, nodeIds)); } Set<Node> availableNodes = nodeSupplier.getWorkerNodes(); if (availableNodes.isEmpty()) { throw new PrestoException(NO_NODES_AVAILABLE, "No nodes available to run query"); } Node node = selectRandom(availableNodes); shardManager.replaceShardAssignment(tableId, shardUuid, deltaShardUuid.isPresent() ? Optional.empty() : deltaShardUuid, node.getNodeIdentifier(), true); addresses = ImmutableList.of(node.getHostAndPort()); } return new RaptorSplit( connectorId, shardUuid, deltaShardUuid.isPresent() ? ImmutableMap.of(shardUuid, deltaShardUuid.get()) : ImmutableMap.of(), tableSupportsDeltaDelete, addresses, effectivePredicate, transactionId, columnTypes); }
Source:
<code>public static boolean shouldLog(ScanResult scanResult) { if (SSIDBlockList.isOptOut(scanResult)) { <START> Log.w(LOG_TAG, "Blocked opt-out SSID"); <END> return false; } if (BSSIDBlockList.contains(scanResult)) { Log.w(LOG_TAG, "Blocked BSSID: " + scanResult); return false; } if (SSIDBlockList.contains(scanResult)) { Log.w(LOG_TAG, "Blocked SSID: " + scanResult); return false; } return true; }</code><technical_language>I need warning level log here. change a Log.d for debugging</technical_language>

Target:
public static boolean shouldLog(ScanResult scanResult) { if (SSIDBlockList.isOptOut(scanResult)) { Log.d(LOG_TAG, "Blocked opt-out SSID"); return false; } if (BSSIDBlockList.contains(scanResult)) { Log.w(LOG_TAG, "Blocked BSSID: " + scanResult); return false; } if (SSIDBlockList.contains(scanResult)) { Log.w(LOG_TAG, "Blocked SSID: " + scanResult); return false; } return true; }
Source:
<code>protected boolean registerLibvirtSecrets(List<LibvirtSecret> libvirtSecrets, boolean clearUnusedSecrets) { VDSReturnValue returnValue = runVdsCommand( VDSCommandType.RegisterLibvirtSecrets, <START> new RegisterLibvirtSecretsVDSParameters(getVdsId(), libvirtSecrets, clearUnusedSecrets)); <END> if (!returnValue.getSucceeded()) { auditLogDirector.log(new AuditLogableBase(getVdsId()), AuditLogType.FAILED_TO_REGISTER_LIBVIRT_SECRET_ON_VDS); log.error("Failed to register libvirt secret on vds {}.", getVds().getName()); return false; } return true; }</code><technical_language>put try catch block</technical_language>

Target:
protected boolean registerLibvirtSecrets(List<LibvirtSecret> libvirtSecrets, boolean clearUnusedSecrets) { VDSReturnValue returnValue = runVdsCommand( VDSCommandType.RegisterLibvirtSecrets, new RegisterLibvirtSecretsVDSParameters(getVdsId(), libvirtSecrets, clearUnusedSecrets)); try { runVdsCommand( VDSCommandType.RegisterLibvirtSecrets, new RegisterLibvirtSecretsVDSParameters(getVdsId(), libvirtSecrets, clearUnusedSecrets)); } catch (RuntimeException e) { auditLogDirector.log(new AuditLogableBase(getVdsId()), AuditLogType.FAILED_TO_REGISTER_LIBVIRT_SECRET_ON_VDS); log.error("Failed to register libvirt secret on vds {}. Error: {}", getVds().getName(), e.getMessage()); return false; } if (!returnValue.getSucceeded()) { auditLogDirector.log(new AuditLogableBase(getVdsId()), AuditLogType.FAILED_TO_REGISTER_LIBVIRT_SECRET_ON_VDS); log.error("Failed to register libvirt secret on vds {}.", getVds().getName()); return false; } return true; }
Source:
<code>public static Iterable<Integer> parseNumberList(String numberList) throws IllegalArgumentException { Assert.hasText(numberList, "must contain a list of values"); Set<Integer> numbers = new TreeSet<Integer>(); String[] numbersOrRanges = numberList.split(","); for (String numberOrRange : numbersOrRanges) { <START> if (numberOrRange.contains("-")) { <END> String[] split = numberOrRange.split("-"); Integer start = Integer.parseInt(split[0]); Integer end = Integer.parseInt(split[1]); if (start >= end) { throw new IllegalArgumentException(String.format("A range contains a start which is after the end: %d-%d", start, end)); } for (int i = start; i <= end; i++) { numbers.add(i); } } else { numbers.add(Integer.parseInt(numberOrRange)); } } return Collections.unmodifiableSet(numbers); }</code><technical_language>Scala Range</technical_language>

Target:
public static Iterable<Integer> parseNumberList(String numberList) throws IllegalArgumentException { Assert.hasText(numberList, "must contain a list of values"); Assert.isTrue(PARTITION_LIST_VALIDATION_REGEX.matcher(numberList).matches(),"is not a list of numbers or ranges"); Set<Integer> numbers = new TreeSet<Integer>(); String[] numbersOrRanges = numberList.split(","); for (String numberOrRange : numbersOrRanges) { if (numberOrRange.contains("-")) { String[] split = numberOrRange.split("-"); Integer start = Integer.parseInt(split[0]); Integer end = Integer.parseInt(split[1]); if (start >= end) { throw new IllegalArgumentException(String.format("A range contains a start which is after the end: %d-%d", start, end)); } for (int i = start; i <= end; i++) { numbers.add(i); } } else { numbers.add(Integer.parseInt(numberOrRange)); } } return Collections.unmodifiableSet(numbers); }
Source:
<code>public boolean loadGestures(String directory) { File dir = makeGesturesDirectory(directory); boolean loaded = true; for (File f : dir.listFiles()) { <START> loaded = Utils.loadPythonFile(f.getAbsolutePath()); <END> } return true; }</code><technical_language>need check a python file load it. missing check deleting this code</technical_language>

Target:
public void loadGestures(String directory) { String extension = "py"; Integer totalLoaded = 0; Integer totalError = 0; File dir = makeGesturesDirectory(directory); if (dir.exists()) { for (File f : dir.listFiles()) { if (FilenameUtils.getExtension(f.getAbsolutePath()).equalsIgnoreCase(extension)) { if (Utils.loadFile(f.getAbsolutePath()) == true) { totalLoaded += 1; gesturesList.add(f.getName()); } else { totalError += 1; } } else { log.warn("{} is not a file", f.getAbsolutePath(), extension); } } } info("%s Gestures loaded, %s Gestures with error", totalLoaded, totalError); }
Source:
<code>public String getCleanNodeName(boolean specialNodesAsRegex) { String name = this.getNodeName(); if (specialNodesAsRegex && this.isDataDriven()) { name = "(.+?)"; } else if (this.isLeaf()) { int colonIndex = name.indexOf(":"); if (colonIndex > 0) { name = name.substring(colonIndex + 1); } int bracketIndex = name.lastIndexOf("("); if (bracketIndex > 0) { name = name.substring(0, bracketIndex); } <START> int questIndex = name.indexOf("?"); <END> if (questIndex > 0) { name = name.substring(0, questIndex); } } return name; }</code><technical_language>query quest</technical_language>

Target:
public String getCleanNodeName(boolean specialNodesAsRegex) { String name = this.getNodeName(); if (specialNodesAsRegex && this.isDataDriven()) { name = "(.+?)"; } else if (this.isLeaf()) { int colonIndex = name.indexOf(":"); if (colonIndex > 0) { name = name.substring(colonIndex + 1); } int bracketIndex = name.lastIndexOf("("); if (bracketIndex > 0) { name = name.substring(0, bracketIndex); } int queryIndex = name.indexOf("?"); if (queryIndex > 0) { name = name.substring(0, queryIndex); } } return name; }
Source:
<code>public static String toString(Iterable<CypherAstBase> expressions) { return stream(expressions) <START> .map(e -> e == null ? "null" : "") <END> .map(Object::toString) .collect(Collectors.joining(", ")); }</code><technical_language>this .map(e -> e == null ? "null" : e)</technical_language>

Target:
public static String toString(Iterable<CypherAstBase> expressions) { return stream(expressions) .map(e -> e == null ? "null" : e) .map(Object::toString) .collect(Collectors.joining(", ")); }
Source:
<code>public void removeFacilityContact(PerunSession sess, Facility facility, String name, Owner owner) throws InternalErrorException { try { ContactGroup contactGroup = getFacilityContactGroup(sess, facility, name); <START> sess.getPerun().getAuditer().log(sess, "User/Owner (" + owner.getId() + ") removed from contact group " + contactGroup.toString() + "."); <END> jdbc.update("delete from facility_contacts where facility_id=? and owner_id=? and name=?", facility.getId(), owner.getId(), name); log.info("Facility contact deleted. Facility: {}, ContactName: {}, Owner: " + owner, facility, name); } catch (RuntimeException ex) { throw new InternalErrorException(ex); } catch (FacilityContactNotExistsException ex) { log.error("Facility contact for facility " + facility + " and user/owner " + owner + " was not found."); } }</code><technical_language>owner</technical_language>

Target:
public void removeFacilityContact(PerunSession sess, Facility facility, String name, Owner owner) throws InternalErrorException { try { jdbc.update("delete from facility_contacts where facility_id=? and owner_id=? and name=?", facility.getId(), owner.getId(), name); log.info("Facility contact deleted. Facility: {}, ContactName: {}, Owner: " + owner, facility, name); } catch (RuntimeException ex) { throw new InternalErrorException(ex); } }
Source:
<code>private List<VM> getMigratableVmsRunningOnVds(final VmDao vmDao, final Guid hostId) { List<VM> vmsFromDB = vmDao.getAllRunningForVds(hostId); List<VM> vms = LinqUtils.filter(vmsFromDB, new Predicate<VM>() { @Override public boolean eval(VM v) { return v.getMigrationSupport().allowsMigration() && <START> (!v.getMigrationSupport().limitsMigration() <END> || v.getDedicatedVmForVdsList().size() >= 2); } }); return vms; }</code><technical_language>replaced v.getMigrationSupport().migrateAnywhere()</technical_language>

Target:
private List<VM> getMigratableVmsRunningOnVds(final VmDao vmDao, final Guid hostId) { List<VM> vmsFromDB = vmDao.getAllRunningForVds(hostId); List<VM> vms = LinqUtils.filter(vmsFromDB, new Predicate<VM>() { @Override public boolean eval(VM v) { return v.getMigrationSupport().allowsMigration() && (v.getMigrationSupport().migrateAnywhere() || v.getDedicatedVmForVdsList().size() >= 2); } }); return vms; }
Source:
<code>public LwjglCanvasRenderer(Context context) { <START> try { this.textureMat = Assets.getMaterial("engine:UITexture").get(); } catch (java.util.NoSuchElementException noSuch) { throw new RuntimeException("Failing to find engine textures", noSuch); } <END> this.billboard = Assets.getMesh("engine:UIBillboard").get(); this.fontMeshBuilder = new FontMeshBuilder(context.get(AssetManager.class).getAsset("engine:UIUnderline", Material.class).get()); this.renderingConfig = context.get(Config.class).getRendering(); this.uiScale = this.renderingConfig.getUiScale() / 100f; this.renderingConfig.subscribe(RenderingConfig.UI_SCALE, this); }</code><technical_language>Optional::get surrounded try-catch is anti-pattern me. Instead, [Optional::orElseThrow](<LINK_0> suggestion this.textureMat = Assets.getMaterial("engine:UITexture") .orElseThrow(e -> throw new RuntimeException("Failing find engine textures", e));</technical_language>

Target:
public LwjglCanvasRenderer(Context context) { this.textureMat = Assets.getMaterial("engine:UITexture").orElseThrow( () -> new RuntimeException("Failing to find engine textures")); this.billboard = Assets.getMesh("engine:UIBillboard").get(); this.fontMeshBuilder = new FontMeshBuilder(context.get(AssetManager.class).getAsset("engine:UIUnderline", Material.class).get()); this.renderingConfig = context.get(Config.class).getRendering(); this.uiScale = this.renderingConfig.getUiScale() / 100f; this.renderingConfig.subscribe(RenderingConfig.UI_SCALE, this); }
Source:
<code>public VariantAnnotation getAnnotation(String variant) { <START> boolean storeVariantJson = true; <END> VariantAnnotation variantAnnotation = null; String annotationJSON = null; try { variantAnnotation = variantAnnotationRepository.findOne(variant); } catch (DataAccessResourceFailureException e) { LOG.warn("Failed to read from Mongo database - falling back on Ensembl server. Will not attempt to store variant in Mongo database."); storeVariantJson = false; } if (variantAnnotation == null) { try { annotationJSON = this.getRawAnnotation(variant); variantAnnotation = this.mapAnnotationJson(variant, annotationJSON); if (storeVariantJson) { try { variantAnnotationRepository.saveAnnotationJson(variant, annotationJSON); } catch (DataIntegrityViolationException e) { LOG.info(e.getLocalizedMessage()); } } } catch (HttpClientErrorException e) { variantAnnotation = new VariantAnnotation(variant, e.getResponseBodyAsString()); } catch (IOException e) { variantAnnotation = new VariantAnnotation(variant, annotationJSON); } } return variantAnnotation; }</code><technical_language>name this variable saveAnnotationJson for consistency method name</technical_language>

Target:
public VariantAnnotation getAnnotation(String variant) { boolean saveAnnotationJson = true; VariantAnnotation variantAnnotation = null; String annotationJSON = null; try { variantAnnotation = variantAnnotationRepository.findOne(variant); } catch (DataAccessResourceFailureException e) { LOG.warn("Failed to read from Mongo database - falling back on Ensembl server. Will not attempt to store variant in Mongo database."); saveAnnotationJson = false; } if (variantAnnotation == null) { try { annotationJSON = this.getRawAnnotation(variant); variantAnnotation = this.mapAnnotationJson(variant, annotationJSON); if (saveAnnotationJson) { variantAnnotationRepository.saveAnnotationJson(variant, annotationJSON); } } catch (HttpClientErrorException e) { variantAnnotation = new VariantAnnotation(variant, e.getResponseBodyAsString()); } catch (IOException e) { variantAnnotation = new VariantAnnotation(variant, annotationJSON); } catch (DataIntegrityViolationException e) { LOG.info(e.getLocalizedMessage()); } } return variantAnnotation; }
Source:
<code>protected Map<CaseInsensitiveString, StringBuilder> validate(SecretParams secretParams, Class<? extends Validatable> entityClass, String entityName, String entityNameOrErrorMessagePrefix) { <START> HashMap<CaseInsensitiveString, StringBuilder> pipelinesWithErrors = new HashMap<>(); <END> secretParams .groupBySecretConfigId() .forEach((secretConfigId, secretParam) -> { SecretConfig secretConfig = goConfigService.getSecretConfigById(secretConfigId); if (secretConfig == null) { addError(pipelinesWithErrors, new CaseInsensitiveString(entityName), format("%s '%s' is referring to none-existent secret config '%s'.", entityNameOrErrorMessagePrefix, entityName, secretConfigId)); } else if (!secretConfig.canRefer(entityClass, entityName)) { addError(pipelinesWithErrors, new CaseInsensitiveString(entityName), format("%s '%s' does not have permission to refer to secrets using secret config '%s'.", entityNameOrErrorMessagePrefix, entityName, secretConfigId)); } }); return pipelinesWithErrors; }</code><technical_language>Map<CaseInsensitiveString, StringBuilder> errors = new HashMap<>();</technical_language>

Target:
protected Map<CaseInsensitiveString, StringBuilder> validate(SecretParams secretParams, Class<? extends Validatable> entityClass, String entityName, String entityNameOrErrorMessagePrefix) { Map<CaseInsensitiveString, StringBuilder> pipelinesWithErrors = new HashMap<>(); secretParams .groupBySecretConfigId() .forEach((secretConfigId, secretParam) -> { SecretConfig secretConfig = goConfigService.getSecretConfigById(secretConfigId); if (secretConfig == null) { addError(pipelinesWithErrors, new CaseInsensitiveString(entityName), format("%s '%s' is referring to none-existent secret config '%s'.", entityNameOrErrorMessagePrefix, entityName, secretConfigId)); } else if (!secretConfig.canRefer(entityClass, entityName)) { addError(pipelinesWithErrors, new CaseInsensitiveString(entityName), format("%s '%s' does not have permission to refer to secrets using secret config '%s'.", entityNameOrErrorMessagePrefix, entityName, secretConfigId)); } }); return pipelinesWithErrors; }
Source:
<code>private void cleanupExportWorkDirs(File baseDir, int maxAgeInMinutes) { long dirCount = 0; long delCount = 0; long leftCount = 0; Date cutOff = Util.addMinutesToDt(maxAgeInMinutes * -1); if (baseDir.listFiles() != null) { dirCount = baseDir.listFiles().length; for (File f : baseDir.listFiles()) { if (f.lastModified() < cutOff.getTime()) { try { FileUtils.deleteDirectory(f); delCount++; } catch (IOException io) { <START> log.error("Unable to delete export directory that is old enough " + <END> "to delete", io); } } else { leftCount++; } } } log.info("Begining directory count: " + dirCount); log.info("Directories deleted: " + delCount); log.info("Directories remaining: " + leftCount); }</code><technical_language>assuming this calls [log.error()](<LINK_0>,%20java.lang.Object%29) , this argument in string format</technical_language>

Target:
private void cleanupExportWorkDirs(File baseDir, int maxAgeInMinutes) { long dirCount = 0; long delCount = 0; long leftCount = 0; Date cutOff = Util.addMinutesToDt(maxAgeInMinutes * -1); if (baseDir.listFiles() != null) { dirCount = baseDir.listFiles().length; for (File f : baseDir.listFiles()) { if (f.lastModified() < cutOff.getTime()) { try { FileUtils.deleteDirectory(f); delCount++; } catch (IOException io) { String errorMsg = String.format("Unable to delete export directory that is old " + "enough to delete: %s", f.getAbsolutePath()); log.error(errorMsg, io); } } else { leftCount++; } } } log.info("Begining directory count: {}", dirCount); log.info("Directories deleted: {}", delCount); log.info("Directories remaining: {}", leftCount); }
Source:
<code>public SystemProducer getProducer(String systemName, Config config, MetricsRegistry registry) { <START> return new EventHubSystemProducer(systemName, new EventHubConfig(config, systemName), registry); <END> }</code><technical_language>inject EventHubWrapperFactory EventHubSystemProducer, EventHubSystemConsumer EventHubSystemAdmin instead of class-loading config? cleaner types way. Use-cases LinkedIn require tunneling inject tunnel-aware versions of EventHubClientWrapper</technical_language>

Target:
public SystemProducer getProducer(String systemName, Config config, MetricsRegistry registry) { EventHubConfig eventHubConfig = new EventHubConfig(config); return new EventHubSystemProducer(eventHubConfig, systemName, new EventHubClientManagerFactory(), getInterceptorsMap(eventHubConfig, systemName), registry); }
Source:
<code>public void testBulkWrites(){ for(int i=0 ; i<10; i++) testCache.put("test"+i, "test"+i); Map<String, String> entries = new HashMap<String, String>(10); Set<String> keys = new HashSet<String>(10); for(int i=10 ; i<20; i++) { entries.put("test"+i, "test"+i); keys.add("test"+i); } testCache.putAll(entries); try { <START> Thread.sleep(500); <END> } catch (InterruptedException e) { e.printStackTrace(); } assertThat(loaderWriter.getData().size(), is(20)); testCache.removeAll(keys); try { Thread.sleep(500); } catch (InterruptedException e) { e.printStackTrace(); } assertThat(loaderWriter.getData().size(), is(10)); }</code><technical_language>Tests a Thread.sleep() call. This reworked</technical_language>

Target:
public void testBulkWrites() throws Exception { CountDownLatch countDownLatch = new CountDownLatch(20); loaderWriter.setLatch(countDownLatch); for(int i=0 ; i<10; i++) testCache.put("test"+i, "test"+i); Map<String, String> entries = new HashMap<String, String>(10); Set<String> keys = new HashSet<String>(10); for(int i=10 ; i<20; i++) { entries.put("test"+i, "test"+i); keys.add("test"+i); } testCache.putAll(entries); countDownLatch.await(5, TimeUnit.SECONDS); assertThat(loaderWriter.getData().size(), is(20)); CountDownLatch countDownLatch1 = new CountDownLatch(10); loaderWriter.setLatch(countDownLatch1); testCache.removeAll(keys); countDownLatch1.await(5, TimeUnit.SECONDS); assertThat(loaderWriter.getData().size(), is(10)); }
Source:
<code>public void handleLogAddressSpaceRequest(RequestMsg req, ChannelHandlerContext ctx, IServerRouter r) { <START> log.trace("handleLogAddressSpaceRequest[{}]: received a log " + "address space request {}", req.getHeader().getRequestId(), TextFormat.shortDebugString(req)); <END> batchWriter.<StreamsAddressResponse>addTask(BatchWriterOperation.Type.LOG_ADDRESS_SPACE_QUERY, req) .thenAccept(resp -> { r.sendResponse(getResponseMsg(req.getHeader(), getLogAddressSpaceResponseMsg( resp.getLogTail(), resp.getEpoch(), resp.getAddressMap())), ctx); }).exceptionally(ex -> { handleException(ex, ctx, req, r); return null; }); }</code><technical_language>clear RPCs logging level. In case, wrapped log.isTraceEnabled()</technical_language>

Target:
public void handleLogAddressSpaceRequest(RequestMsg req, ChannelHandlerContext ctx, IServerRouter r) { if (log.isTraceEnabled()) { log.trace("handleLogAddressSpaceRequest[{}]: received a log " + "address space request {}", req.getHeader().getRequestId(), TextFormat.shortDebugString(req)); } batchWriter.<StreamsAddressResponse>addTask(BatchWriterOperation.Type.LOG_ADDRESS_SPACE_QUERY, req) .thenAccept(resp -> { r.sendResponse(getResponseMsg(req.getHeader(), getLogAddressSpaceResponseMsg( resp.getLogTail(), resp.getEpoch(), resp.getAddressMap())), ctx); }).exceptionally(ex -> { handleException(ex, ctx, req, r); return null; }); }