auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { long feedId = getArguments().getLong(EXTRA_FEED_ID); disposable = Maybe.create((MaybeOnSubscribe<Feed>) emitter -> { Feed feed = DBReader.getFeed(feedId); if (feed != null) { emitter.onSuccess(feed); } else { emitter.onComplete(); } }) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(result -> { feed = result; <START> loadStatistics(); <END> }, error -> Log.d(TAG, Log.getStackTraceString(error)), () -> { }); }</code><technical_language>I call decouple displaying statistics displaying other feed info</technical_language>

Target:
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { long feedId = getArguments().getLong(EXTRA_FEED_ID); disposable = Maybe.create((MaybeOnSubscribe<Feed>) emitter -> { Feed feed = DBReader.getFeed(feedId); if (feed != null) { emitter.onSuccess(feed); } else { emitter.onComplete(); } }) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(result -> { feed = result; showFeed(); loadStatistics(); }, error -> Log.d(TAG, Log.getStackTraceString(error)), () -> { }); }
Source:
<code>private boolean isKerberosClientInstallAllowed(final ClusterTopology topology) { final org.apache.ambari.server.topology.Configuration topologyConfig = topology.getBlueprint().getConfiguration(); final String kdc_type = topologyConfig.getPropertyValue(KerberosHelper.KERBEROS_ENV, KerberosHelper.KDC_TYPE); final String manage_identities = topologyConfig.getPropertyValue(KerberosHelper.KERBEROS_ENV, KerberosHelper.MANAGE_IDENTITIES); <START> return kdc_type != null && !"none".equalsIgnoreCase(kdc_type) || Boolean.parseBoolean(manage_identities); <END> }</code><technical_language>Please consider a constant for "none"</technical_language>

Target:
private boolean isKerberosClientInstallAllowed(final ClusterTopology topology) { final org.apache.ambari.server.topology.Configuration topologyConfig = topology.getBlueprint().getConfiguration(); final String kdc_type = topologyConfig.getPropertyValue(KerberosHelper.KERBEROS_ENV, KerberosHelper.KDC_TYPE); final String manage_identities = topologyConfig.getPropertyValue(KerberosHelper.KERBEROS_ENV, KerberosHelper.MANAGE_IDENTITIES); return KDCType.NONE != KDCType.translate(kdc_type) || Boolean.parseBoolean(manage_identities); }
Source:
<code>private static Mono<okhttp3.Request> toOkHttpRequest(HttpRequest request) { return Mono.just(new okhttp3.Request.Builder()) .map(rb -> { rb.url(request.url()); if (request.headers() != null) { return rb.headers(okhttp3.Headers.of(request.headers().toMap())); } else { <START> return rb.headers(okhttp3.Headers.of((new HashMap<>()))); <END> } }) .flatMap((Function<Request.Builder, Mono<Request.Builder>>) rb -> { if (request.httpMethod() == HttpMethod.GET) { return Mono.just(rb.get()); } else if (request.httpMethod() == HttpMethod.HEAD) { return Mono.just(rb.head()); } else { return toOkHttpRequestBody(request.body(), request.headers()) .map(requestBody -> rb.method(request.httpMethod().toString(), requestBody)); } }) .map(rb -> rb.build()); }</code><technical_language>reason for additional set of parantheses</technical_language>

Target:
private static Mono<okhttp3.Request> toOkHttpRequest(HttpRequest request) { return Mono.just(new okhttp3.Request.Builder()) .map(rb -> { rb.url(request.url()); if (request.headers() != null) { return rb.headers(okhttp3.Headers.of(request.headers().toMap())); } else { return rb.headers(okhttp3.Headers.of(new HashMap<>())); } }) .flatMap((Function<Request.Builder, Mono<Request.Builder>>) rb -> { if (request.httpMethod() == HttpMethod.GET) { return Mono.just(rb.get()); } else if (request.httpMethod() == HttpMethod.HEAD) { return Mono.just(rb.head()); } else { return toOkHttpRequestBody(request.body(), request.headers()) .map(requestBody -> rb.method(request.httpMethod().toString(), requestBody)); } }) .map(rb -> rb.build()); }
Source:
<code>public void testApplicationID() throws Exception { Map<String, String> metainfo = newHashMap(); metainfo.put("application_id", "myApp"); <START> violationEntity = new ViolationEntity(null, null, null, null, metainfo, null, null, null, null, null); <END> ruleEntity.setApplicationId("myApp"); Boolean apply = evaluator.apply(ruleEntity, violationEntity); assertThat(apply).isEqualTo(true); }</code><technical_language>I expect white-listing rules changed match app id new property</technical_language>

Target:
public void testApplicationID() throws Exception { violationEntity = new ViolationEntity(null, null, null, null, null, null, null, null, null, null); violationEntity.setApplication(new ApplicationEntity("myApp")); ruleEntity.setApplicationId("myApp"); Boolean apply = evaluator.apply(ruleEntity, violationEntity); assertThat(apply).isEqualTo(true); }
Source:
<code>public void mouseUp(MouseEvent mouseEvent, EditPartViewer viewer) { super.mouseUp(mouseEvent, viewer); if (transition && ((AdvancedPanningSelectionTool) getDefaultTool()) .getTargetEditPart() instanceof FreeformGraphicalRootEditPart) { ECState destState = (ECState) new StateCreationFactory().getNewObject(); <START> new CreateECStateCommand(destState, ((ECCPanningSelectionTool) getDefaultTool()).getLastLocation(), ((ECCEditor) getEditorPart()).getFbType().getECC()).execute(); new CreateTransitionCommand(sourceState, destState, null).execute(); <END> } transition = false; }</code><technical_language>problem if do is creation is added command stack. handle in a tool. if commands executed other depending other good in a compound command put command provided edit creation edit policy attached root editpart</technical_language>

Target:
public void mouseUp(MouseEvent mouseEvent, EditPartViewer viewer) { super.mouseUp(mouseEvent, viewer); if (transition) { if (createTransitionAndState && ((AdvancedPanningSelectionTool) getDefaultTool()) .getTargetEditPart() instanceof FreeformGraphicalRootEditPart) { transitionStateCreationTool .setLocationActivation(((ECCPanningSelectionTool) getDefaultTool()).getLastLocation()); setActiveTool(transitionStateCreationTool); transitionStateCreationTool.performCreation(); setActiveTool(getDefaultTool()); createTransitionAndState = false; } transition = false; setActiveTool(getDefaultTool()); } }
Source:
<code>public boolean isAvailable(long timeout, long pollInterval, TimeUnit unit) { try { return solr.isAvailable(timeout, pollInterval, unit); <START> } catch (InterruptedException e) { <END> LOGGER.debug("Solr client is available interrupted exception {}", e); return false; } }</code><technical_language>Improper handle interruptions. need propagated re-interrupting current thread</technical_language>

Target:
public boolean isAvailable(long timeout, long pollInterval, TimeUnit unit) { try { return solr.isAvailable(timeout, pollInterval, unit); } catch (InterruptedException e) { LOGGER.debug("Solr client is available interrupted exception {}", e); Thread.currentThread().interrupt(); } return false; }
Source:
<code>public void configurePipeline(PipelineConfigurer pipelineConfigurer) { if (Strings.isNullOrEmpty(config.username) ^ Strings.isNullOrEmpty(config.password)) { throw new IllegalArgumentException( String.format("You must either set both username and password " + "or neither username nor password. " + "Currently, they are username: \'%s\', and password: \'%s\'", <START> config.username, config.password)); <END> } try { new InternetAddress(config.senderEmailAddress); } catch (AddressException e) { throw new IllegalArgumentException( String.format("%s is an invalid sender email address. Reason: %s", config.senderEmailAddress, e.getMessage())); } try { new InternetAddress(config.recipientEmailAddress); } catch (AddressException e) { throw new IllegalArgumentException( String.format("%s is an invalid recipient email address. Reason: %s", config.recipientEmailAddress, e.getMessage())); } }</code><technical_language>i a good idea include password in exception message</technical_language>

Target:
public void configurePipeline(PipelineConfigurer pipelineConfigurer) { config.validate(); }
Source:
<code>public void testConnectOverProxy_implicit_http_fails() throws Exception { ProxySelector defaultProxySelector = ProxySelector.getDefault(); try { CountingProxy countingProxy = CountingProxy.start(); try { Proxy proxy = countingProxy.asProxy(); SingleProxySelector proxySelector = new SingleProxySelector(proxy); ProxySelector.setDefault(proxySelector); <START> FtpURLConnection connection <END> = (FtpURLConnection) fileUrl.openConnection(); InputStream inputStream = connection.getInputStream(); IOException e = proxySelector.getLastException(); assertEquals("FTP connections over HTTP proxy not supported", e.getMessage()); assertContents(inputStream); } finally { int numConnections = countingProxy.shutdownAndGetConnectionCount(); assertEquals(0, numConnections); } } finally { ProxySelector.setDefault(defaultProxySelector); } }</code><technical_language>URLConnection too</technical_language>

Target:
public void testConnectOverProxy_implicit_http_fails() throws Exception { URL fileUrl = addFileEntry(FILE_PATH, fileContents); ProxySelector defaultProxySelector = ProxySelector.getDefault(); try { CountingProxy countingProxy = CountingProxy.start(); try { Proxy proxy = countingProxy.asProxy(); SingleProxySelector proxySelector = new SingleProxySelector(proxy); ProxySelector.setDefault(proxySelector); URLConnection connection = fileUrl.openConnection(); InputStream inputStream = connection.getInputStream(); IOException e = proxySelector.getLastException(); assertEquals("FTP connections over HTTP proxy not supported", e.getMessage()); assertContents(fileContents, inputStream); } finally { int numConnections = countingProxy.shutdownAndGetConnectionCount(); assertEquals(0, numConnections); } } finally { ProxySelector.setDefault(defaultProxySelector); } }
Source:
<code>protected ToStringHelper string() { return super.string() .add("networkId", networkId) .add("gatewayIp", gatewayIp) .add("ipVersion", ipVersion) .add("cidr", cidr) <START> .add("enableDHCP", enableDhcp); <END> }</code><technical_language>Is a reason allocationPools, dnsNameServers, hostRoutes missing here</technical_language>

Target:
protected ToStringHelper string() { return super.string() .add("networkId", networkId) .add("gatewayIp", gatewayIp) .add("ipVersion", ipVersion) .add("cidr", cidr) .add("enableDHCP", enableDhcp) .add("allocationPools", allocationPools) .add("dnsNameServers", dnsNameServers) .add("hostRoutes", hostRoutes); }
Source:
<code><START> public AzureBlobBlockUploadStrategy(AzureBlobClient client, PayloadSlicer slicer, BlobToAzureBlob blobToAzureBlob) { <END> this.client = checkNotNull(client, "client"); this.slicer = checkNotNull(slicer, "slicer"); this.blobToAzureBlob = checkNotNull(blobToAzureBlob, "blobToAzureBlob"); }</code><technical_language>I this public, package private</technical_language>

Target:
AzureBlobBlockUploadStrategy(AzureBlobClient client, PayloadSlicer slicer, BlobToAzureBlob blobToAzureBlob) { this.client = checkNotNull(client, "client"); this.slicer = checkNotNull(slicer, "slicer"); this.blobToAzureBlob = checkNotNull(blobToAzureBlob, "blobToAzureBlob"); }
Source:
<code>public void save(@RequestParam(value = "cdmVersion", defaultValue = "5") float version, @RequestParam(value = "ids") List<Long> idV4s, @RequestParam(value = "name") String bundleName, HttpServletResponse response) throws IOException, PermissionDeniedException { if (notExist(version)) { response.sendError(SC_BAD_REQUEST, "No supported version " + version); return; } if (isEmpty(bundleName)) { response.sendError(SC_BAD_REQUEST, "Name cannot be empty"); return; } AthenaUser currentUser = userService.getCurrentUser(); ENDING licenses are not active <START> boolean noLicence = vocabularyConversionService.missingAvailableForDownloadingLicenses(currentUser.getId(), false).stream() <END> .map(VocabularyDTO::getId) .map(Long::new) .anyMatch(idV4s::contains); if (noLicence) { throw new PermissionDeniedException("User must have licenses for all vocabularies"); } DownloadBundle bundle = vocabularyService.saveBundle(bundleName, idV4s, currentUser, getByValue(version)); vocabularyService.saveContent(bundle, currentUser); LOGGER.info("Vocabulary saving is started, bundle name: {}, user id: {}", bundleName, currentUser.getId()); }</code><technical_language>missingAvailableForDownloadingLicenses absolutely clear naming</technical_language>

Target:
public void save(@RequestParam(value = "cdmVersion", defaultValue = "5") float version, @RequestParam(value = "ids") List<Long> idV4s, @RequestParam(value = "name") String bundleName, HttpServletResponse response) throws IOException, PermissionDeniedException { if (notExist(version)) { response.sendError(SC_BAD_REQUEST, "No supported version " + version); return; } if (isEmpty(bundleName)) { response.sendError(SC_BAD_REQUEST, "Name cannot be empty"); return; } AthenaUser currentUser = userService.getCurrentUser(); ENDING licenses are not active boolean noLicence = vocabularyConversionService.getUnavailableVocabularies(currentUser.getId(), false).stream() .map(VocabularyDTO::getId) .map(Long::new) .anyMatch(idV4s::contains); if (noLicence) { throw new PermissionDeniedException("User must have licenses for all vocabularies"); } DownloadBundle bundle = vocabularyService.saveBundle(bundleName, idV4s, currentUser, getByValue(version)); vocabularyService.saveContent(bundle, currentUser); LOGGER.info("Vocabulary saving is started, bundle name: {}, user id: {}", bundleName, currentUser.getId()); }
Source:
<code>private void deleteMarkers(String suffix) throws CoreException { final File localDeploymentDirectory = new File(getDeploymentOptions().getDeploymentsRootFolder(true)); Stream.of(localDeploymentDirectory.listFiles()) .filter(p->p.getName().endsWith(suffix)) <START> .forEach(File::delete); <END> }</code><technical_language>in is change this superior? this is alternative achieve added benefit</technical_language>

Target:
private void deleteMarkers(String suffix) throws CoreException { final File localDeploymentDirectory = new File(getDeploymentOptions().getDeploymentsRootFolder(true)); Stream.of(localDeploymentDirectory.listFiles()) .filter(p->p.getName().endsWith(suffix)) .forEach(p->p.delete()); }
Source:
<code>private BooleanWrapper internalSetFree(final RMNode rmNode) { if (logger.isDebugEnabled()) { logger.debug("Current node state " + rmNode.getState() + " " + rmNode.getNodeURL()); logger.debug("Setting node state to free " + rmNode.getNodeURL()); } if (rmNode.isFree()) { return new BooleanWrapper(true); } final NodeState previousNodeState = rmNode.getState(); Client client = rmNode.getOwner(); if (client == null) { client = rmNode.getProvider(); } <START> rmNode.setFree(); <END> if (!rmNode.isLocked()) { this.freeNodes.add(rmNode); } this.registerAndEmitNodeEvent( rmNode.createNodeEvent( RMEventType.NODE_STATE_CHANGED, previousNodeState, client.getName())); return new BooleanWrapper(true); }</code><technical_language>node previously locked, node set in free state put in freeNodes map. code of other methods (lock, unlock). node is handled is obscure me. a lockedNode collection clearer understand</technical_language>

Target:
private BooleanWrapper internalSetFree(final RMNode rmNode) { if (logger.isDebugEnabled()) { logger.debug("Current node state " + rmNode.getState() + " " + rmNode.getNodeURL()); logger.debug("Setting node state to free " + rmNode.getNodeURL()); } if (rmNode.isFree()) { return new BooleanWrapper(true); } final NodeState previousNodeState = rmNode.getState(); Client client = rmNode.getOwner(); if (client == null) { client = rmNode.getProvider(); } rmNode.setFree(); if (!rmNode.isLocked()) { this.eligibleNodes.add(rmNode); } this.registerAndEmitNodeEvent( rmNode.createNodeEvent( RMEventType.NODE_STATE_CHANGED, previousNodeState, client.getName())); return new BooleanWrapper(true); }
Source:
<code>public void getTextTest() throws Exception { String craigsUrl = "<LINK_1>"; iface.go(craigsUrl); String banner = "craigslist"; <START> WebDriverElement bannerDiv = ((WebDriverElement) iface.getWebDriverElement(Strategy.ID, "logo")); <END> WebDriverElement bannerLogo = ((WebDriverElement) bannerDiv.getElement(new Hook(Strategy.TAG, "a"), 0)); String bannerText = bannerLogo.getText(); Assert.assertEquals(bannerText,banner); String meanUrl = "<LINK_3>"; iface.go(meanUrl); String banner1 = "The Friendly"; WebDriverElement bannerElement = ((WebDriverElement) iface.getWebDriverElement(Strategy.CLASS, "banner-top-title")); String bannerElementText = bannerElement.getText(); Assert.assertTrue(bannerElementText.contains(banner1)); String url = "<LINK_2>"; iface.go(url); String actChapterText = iface.getWebDriverElement(Strategy.NAME, "shorttext").getText(); String expChapterText = "Hit Me!"; Assert.assertEquals(expChapterText, actChapterText); url = "<LINK_0>"; iface.go(url); actChapterText = iface.getWebDriverElement(Strategy.XPATH, " expChapterText = "Generic Button"; Assert.assertEquals(expChapterText, actChapterText); }</code><technical_language>casting required</technical_language>

Target:
public void getTextTest() throws Exception { String craigsUrl = "<LINK_1>"; iface.go(craigsUrl); String banner = "craigslist"; WebDriverElement bannerDiv = iface.getWebDriverElement(Strategy.ID, "logo"); WebDriverElement bannerLogo = ((WebDriverElement) bannerDiv.getElement(new Hook(Strategy.TAG, "a"), 0)); String bannerText = bannerLogo.getText(); Assert.assertEquals(bannerText,banner); String meanUrl = "<LINK_3>"; iface.go(meanUrl); String banner1 = "The Friendly"; WebDriverElement bannerElement = iface.getWebDriverElement(Strategy.CLASS, "banner-top-title"); String bannerElementText = bannerElement.getText(); Assert.assertTrue(bannerElementText.contains(banner1)); String url = "<LINK_2>"; iface.go(url); String actChapterText = iface.getWebDriverElement(Strategy.NAME, "shorttext").getText(); String expChapterText = "Hit Me!"; Assert.assertEquals(expChapterText, actChapterText); url = "<LINK_0>"; iface.go(url); actChapterText = iface.getWebDriverElement(Strategy.XPATH, " expChapterText = "Generic Button"; Assert.assertEquals(expChapterText, actChapterText); }
Source:
<code>private void createManagementNetworkIfRequired(VDS host) { <START> if (host != null) { <END> Network managementNetwork = getNetworkDAO().getByNameAndDataCenter(Config.<String> GetValue(ConfigValues.ManagementNetwork), host.getStoragePoolId()); VdsNetworkInterface nic = findNicForManagementNetwork(host, managementNetwork); if (nic != null) { List<VdsNetworkInterface> interfaces = filterBondsWithoutSlaves(host.getInterfaces()); if (interfaces.contains(nic)) { nic.setNetworkName(managementNetwork.getName()); SetupNetworksParameters parameters = new SetupNetworksParameters(); parameters.setVdsId(host.getId()); parameters.setInterfaces(interfaces); parameters.setCheckConnectivity(true); createAndPersistManagementNetwork(parameters); } else { addCustomValue("InterfaceName", nic.getName()); AuditLogDirector.log(this, AuditLogType.INVALID_INTERFACE_FOR_MANAGEMENT_NETWORK_CONFIGURATION); } } } }</code><technical_language>host null in this case, if activate command succeeded</technical_language>

Target:
private void createManagementNetworkIfRequired(VDS host) { if (host != null) { VdsNetworkInterface nic = findNicForManagementNetwork(host); if (nic != null) { List<VdsNetworkInterface> interfaces = filterBondsWithoutSlaves(host.getInterfaces()); if (interfaces.contains(nic)) { nic.setNetworkName(Config.<String> GetValue(ConfigValues.ManagementNetwork)); SetupNetworksParameters parameters = new SetupNetworksParameters(); parameters.setVdsId(host.getId()); parameters.setInterfaces(interfaces); parameters.setCheckConnectivity(true); createAndPersistManagementNetwork(parameters); } else { addCustomValue("InterfaceName", nic.getName()); AuditLogDirector.log(this, AuditLogType.INVALID_INTERFACE_FOR_MANAGEMENT_NETWORK_CONFIGURATION); } } } }
Source:
<code>public Response<BlockBlobItem> uploadWithResponse(InputStream data, long length, BlobHTTPHeaders headers, Metadata metadata, BlobAccessConditions accessConditions, Duration timeout, Context context) throws IOException { Flux<ByteBuffer> fbb = Utility.convertStreamToByteBuffer(data, length, BlockBlobAsyncClient.BLOB_DEFAULT_UPLOAD_BLOCK_SIZE); Mono<Response<BlockBlobItem>> upload = blockBlobAsyncClient <START> .uploadWithResponse(fbb, length, headers, metadata, accessConditions, context); <END> try { return Utility.blockWithOptionalTimeout(upload, timeout); } catch (UncheckedIOException e) { throw e.getCause(); } }</code><technical_language>remove subscribeOn here</technical_language>

Target:
public Response<BlockBlobItem> uploadWithResponse(InputStream data, long length, BlobHTTPHeaders headers, Metadata metadata, BlobAccessConditions accessConditions, Duration timeout, Context context) throws IOException { Objects.requireNonNull(data); Flux<ByteBuffer> fbb = Utility.convertStreamToByteBuffer(data, length, BlockBlobAsyncClient.BLOB_DEFAULT_UPLOAD_BLOCK_SIZE); Mono<Response<BlockBlobItem>> upload = blockBlobAsyncClient .uploadWithResponse(fbb.subscribeOn(Schedulers.elastic()), length, headers, metadata, accessConditions, context); try { return Utility.blockWithOptionalTimeout(upload, timeout); } catch (UncheckedIOException e) { throw e.getCause(); } }
Source:
<code>public String getShortDescription() { <START> return "Export and Import credentials as XML"; <END> }</code><technical_language>NIT: order is "import export"</technical_language>

Target:
public String getShortDescription() { return "Export credentials as XML. The output of this command can be used as input for \"import-credentials-as-xml\" as is, the only needed change is to set the actual Secrets which are redacted in the output."; }
Source:
<code>private static boolean isBalloonEnabled(VmManagementParametersBase params) { Boolean balloonEnabled = params.isBalloonEnabled(); return balloonEnabled != null ? balloonEnabled : <START> VmDeviceUtils.isBalloonEnabled(params.getVmStaticData().getId()); <END> }</code><technical_language>calling a method in class want drop "VmDeviceUtils." prefix</technical_language>

Target:
private static boolean isBalloonEnabled(VmManagementParametersBase params) { Boolean balloonEnabled = params.isBalloonEnabled(); return (balloonEnabled != null) ? balloonEnabled : isBalloonEnabled(params.getVmStaticData().getId()); }
Source:
<code>public List<PlanNode> getSources(PlanNode node) { if (node instanceof RemoteSourceNode) { return ((RemoteSourceNode) node).getSourceFragmentIds().stream() .map(id -> { <START> verify(fragmentMap.containsKey(id), "fragment id not in map"); <END> return fragmentMap.get(id).getRoot(); }) .collect(toImmutableList()); } return node.getSources(); }</code><technical_language>verify(fragmentMap.containsKey(id), "fragment id in map: %s", id);</technical_language>

Target:
public List<PlanNode> getSources(PlanNode node) { if (node instanceof RemoteSourceNode) { return ((RemoteSourceNode) node).getSourceFragmentIds().stream() .map(id -> { verify(fragments.containsKey(id), "fragment id not in map: %s", id); return fragments.get(id).getRoot(); }) .collect(toImmutableList()); } return node.getSources(); }
Source:
<code>private Folder computeRootFolder(String path) { return rootFolders.computeIfAbsent(path, <START> key -> { Folder newFolder = new Folder(key); return newFolder; }); <END> }</code><technical_language>This replaced Folder::new</technical_language>

Target:
private Folder computeRootFolder(String path) { return rootFolders.computeIfAbsent(path, Folder::new); }
Source:
<code>private void verifyResource(String v) throws IOException, InterruptedException { Assert.assertThat(v, StringStartsWith.startsWith("jar:file:")); Assert.assertThat(v, StringContains.containsString(dir.toURI().getPath())); <START> Assert.assertThat(v, StringEndsWith.endsWith("::hello")); <END> }</code><technical_language>Nit-pick Assert.assertThat(v, allOf(StringStartsWith.startsWith("jar:file:"),StringContains.containsString(dir.toURI().getPath()),StringEndsWith.endsWith("::hello"))); nicer... assert if failing report failed... run test times ensure fixed potential issues: - right start... fix run - right contains... fix run - right end... fix run - right start, contains end... fix run</technical_language>

Target:
private void verifyResource(String v) throws IOException, InterruptedException { Assert.assertThat(v, allOf(startsWith("jar:file:"), containsString(dir.toURI().getPath()), endsWith("::hello"))); }
Source:
<code>public ConsoleProperties createConsoleProperties(PerfTest perfTest) { ConsoleProperties consoleProperties = ConsolePropertiesFactory.createEmptyConsoleProperties(); try { <START> removePerftestResultDistributedFolderIfExist(perfTest); <END> consoleProperties.setAndSaveDistributionDirectory(new Directory(getDistributionPath(perfTest))); consoleProperties.setConsoleHost(config.getCurrentIP()); consoleProperties.setIgnoreSampleCount(getSafe(perfTest.getIgnoreSampleCount())); consoleProperties.setSampleInterval(1000 * getSafe(perfTest.getSamplingInterval())); } catch (Exception e) { throw processException("Error while setting console properties", e); } return consoleProperties; }</code><technical_language>I this called here.. behavior createConsoleProperties()</technical_language>

Target:
public ConsoleProperties createConsoleProperties(PerfTest perfTest) { ConsoleProperties consoleProperties = ConsolePropertiesFactory.createEmptyConsoleProperties(); try { consoleProperties.setAndSaveDistributionDirectory(new Directory(getDistributionPath(perfTest))); consoleProperties.setConsoleHost(config.getCurrentIP()); consoleProperties.setIgnoreSampleCount(getSafe(perfTest.getIgnoreSampleCount())); consoleProperties.setSampleInterval(1000 * getSafe(perfTest.getSamplingInterval())); } catch (Exception e) { throw processException("Error while setting console properties", e); } return consoleProperties; }
Source:
<code>public Builder withModifiedDate(Date modifiedDate) { <START> profileAttributes.modifiedDate = modifiedDate; <END> return this; }</code><technical_language>is this is null</technical_language>

Target:
public Builder withModifiedDate(Date modifiedDate) { profileAttributes.modifiedDate = modifiedDate == null ? new Date() : modifiedDate; return this; }
Source:
<code><START> public static ClientPrefs getInstance() { <END> assert(sInstance != null); assert(sInstance.getClass().isInstance(ClientPrefs.class)); return (ClientPrefs)sInstance; }</code><technical_language>sense change this getInstance(Context c) merge this createGlobalInstance</technical_language>

Target:
public static synchronized ClientPrefs getInstance() { assert(sInstance != null); assert(sInstance.getClass().isInstance(ClientPrefs.class)); return (ClientPrefs)sInstance; }
Source:
<code>protected PocketAuthInfo buildInfo(Response r) throws AccessTokenException { String body = r.getBody(); <START> String accessToken = body.substring(body.indexOf("=") + 1, body.indexOf("&")); <END> String userName = body.substring(body.indexOf("=", body.indexOf("=") + 1) + 1); PocketAuthInfo info = new PocketAuthInfo(accessToken, requestToken, userName); return info; }</code><technical_language>I a proper query string parser here. is change Pocket API JSON. I read in API docs, spoken in urlencoded JSON format: Pocket Authentication API supports formats: application/x-www-form-urlencoded (DEFAULT) application/json</technical_language>

Target:
protected PocketAuthInfo buildInfo(Response r) throws AccessTokenException { if (r.getStatus() >= 400) { throw new AccessTokenException(r.asJson() .asText()); } else { JsonNode response = r.asJson(); String accessToken = response.get("access_token") .asText(); String userName = response.get("username") .asText(); PocketAuthInfo info = new PocketAuthInfo(accessToken, requestToken, userName); return info; } }
Source:
<code>public void readLac(final BookieSocketAddress addr, final long ledgerId, final ReadLacCallback cb, final Object ctx) { final PerChannelBookieClientPool client = lookupClient(addr); if (client == null) { cb.readLacComplete(getRc(BKException.Code.BookieHandleNotAvailableException), ledgerId, null, null, ctx); return; } client.obtain(new GenericCallback<PerChannelBookieClient>() { @Override public void operationComplete(final int rc, PerChannelBookieClient pcbc) { if (rc != BKException.Code.OK) { try { executor.submitOrdered(ledgerId, new SafeRunnable() { @Override public void safeRun() { cb.readLacComplete(rc, ledgerId, null, null, ctx); } }); } catch (RejectedExecutionException re) { cb.readLacComplete(getRc(BKException.Code.InterruptedException), ledgerId, null, null, ctx); } <START> return; <END> } pcbc.readLac(ledgerId, cb, ctx); } }, ledgerId); }</code><technical_language>nit: remove this</technical_language>

Target:
public void readLac(final BookieSocketAddress addr, final long ledgerId, final ReadLacCallback cb, final Object ctx) { final PerChannelBookieClientPool client = lookupClient(addr); if (client == null) { cb.readLacComplete(getRc(BKException.Code.BookieHandleNotAvailableException), ledgerId, null, null, ctx); return; } client.obtain((rc, pcbc) -> { if (rc != BKException.Code.OK) { try { executor.submitOrdered(ledgerId, safeRun(() -> { cb.readLacComplete(rc, ledgerId, null, null, ctx); })); } catch (RejectedExecutionException re) { cb.readLacComplete(getRc(BKException.Code.InterruptedException), ledgerId, null, null, ctx); } } else { pcbc.readLac(ledgerId, cb, ctx); } }, ledgerId); }
Source:
<code>public void validateRpd9s1() { if (!isPage("XWiki", "XWikiSyntax") && !isPage("XWiki", "XWikiSyntaxHorizontalLine") && !isPage("XWiki", "XWikiSyntaxTables") && !isPage("XWiki", "XWikiSyntaxLinks") && !isPage("XWiki", "XWikiSyntaxParagraphs") && !isPage("XWiki", "XWikiSyntaxMacros") && !isPage("XWiki", "XWikiSyntaxDefinitionLists") && !isPage("XWiki", "XWikiSyntaxHeadings") && !isPage("XWiki", "XWikiSyntaxLists") && !isPage("XWiki", "XWikiSyntaxParameters") && !isPage("Panels", "PanelWizard") && !isPage("XWiki", "Treeview") && !isPage("Invitation", "WebHome") <START> && !isPage("XWiki", "XWikiSyntaxGroups")) { <END> assertTrue(Type.ERROR, "rpd9s1.attr", getElement(ELEM_BODY).getElementsByAttribute(STYLE).isEmpty()); } assertTrue(Type.ERROR, "rpd9s1.tag", getElement(ELEM_BODY).getElementsByTag(STYLE).isEmpty()); }</code><technical_language>nicer pages grouped space name</technical_language>

Target:
public void validateRpd9s1() { if (!isPage("XWiki", "XWikiSyntax") && !isPage("XWiki", "XWikiSyntaxHorizontalLine") && !isPage("XWiki", "XWikiSyntaxTables") && !isPage("XWiki", "XWikiSyntaxLinks") && !isPage("XWiki", "XWikiSyntaxParagraphs") && !isPage("XWiki", "XWikiSyntaxMacros") && !isPage("XWiki", "XWikiSyntaxDefinitionLists") && !isPage("XWiki", "XWikiSyntaxHeadings") && !isPage("XWiki", "XWikiSyntaxLists") && !isPage("XWiki", "XWikiSyntaxParameters") && !isPage("XWiki", "XWikiSyntaxGroups") && !isPage("XWiki", "Treeview") && !isPage("Panels", "PanelWizard") && !isPage("Invitation", "WebHome")) { assertTrue(Type.ERROR, "rpd9s1.attr", getElement(ELEM_BODY).getElementsByAttribute(STYLE).isEmpty()); } assertTrue(Type.ERROR, "rpd9s1.tag", getElement(ELEM_BODY).getElementsByTag(STYLE).isEmpty()); }
Source:
<code>public void onSuccess(SshPollValue val) { String stdout = val.getStdout(); int jsonStarts = stdout.indexOf('{'); if (jsonStarts > 0) stdout = stdout.substring(jsonStarts); JsonElement jsonElement = new Gson().fromJson(stdout, JsonElement.class); <START> final Iterable<String> prefixes = Lists.newArrayList("", "automatic", "force_override", "override", "normal", "force_default", "default"); <END> for (AttributeSensor attribute : chefAttributeSensors) { if (!attribute.getName().startsWith(CHEF_ATTRIBUTE_PREFIX)) continue; log.debug("Finding value for attribute sensor "+attribute.getName()); Iterable<String> path = Lists.newArrayList(attribute.getName().substring(CHEF_ATTRIBUTE_PREFIX.length()).split("\\.")); JsonElement elementForSensor = null; for(String prefix : prefixes) { Iterable<String> prefixedPath = !Strings.isNullOrEmpty(prefix) ? Iterables.concat(ImmutableList.of(prefix), path) : path; elementForSensor = getElementByPath(jsonElement.getAsJsonObject(), prefixedPath); if (elementForSensor != null) { log.debug("Found a value with attribute "+ Joiner.on('.').join(prefixedPath)); break; } } log.debug("Attribute sensor value is {}", new Object[]{attribute.getName(), elementForSensor}); entity.setAttribute(attribute, elementForSensor != null ? elementForSensor.getAsString() : null); } }</code><technical_language>Personal preference for ImmutableList.of(...). strong feelings</technical_language>

Target:
public void onSuccess(SshPollValue val) { String stdout = val.getStdout(); int jsonStarts = stdout.indexOf('{'); if (jsonStarts > 0) stdout = stdout.substring(jsonStarts); JsonElement jsonElement = new Gson().fromJson(stdout, JsonElement.class); for (Map.Entry<String, AttributeSensor> attribute : chefAttributeSensors.entrySet()) { String chefAttributeName = attribute.getKey(); AttributeSensor sensor = attribute.getValue(); log.trace("Finding value for attribute sensor " + sensor.getName()); Iterable<String> path = SPLITTER.split(chefAttributeName); JsonElement elementForSensor = null; for(String prefix : PREFIXES) { Iterable<String> prefixedPath = !Strings.isNullOrEmpty(prefix) ? Iterables.concat(ImmutableList.of(prefix), path) : path; try { elementForSensor = getElementByPath(jsonElement.getAsJsonObject(), prefixedPath); } catch(IllegalArgumentException e) { log.error("Entity {}: bad Chef attribute for sensor {}: {}", new Object[]{ entity.getDisplayName(), Joiner.on('.').join(prefixedPath), sensor.getName(), e.getMessage()}); throw Throwables.propagate(e); } if (elementForSensor != null) { log.debug("Entity {}: apply Chef attribute to sensor with value {}", new Object[]{ entity.getDisplayName(), Joiner.on('.').join(prefixedPath), sensor.getName(), elementForSensor.getAsString()}); break; } } if (elementForSensor != null) { entity.setAttribute(sensor, TypeCoercions.coerce(elementForSensor.getAsString(), sensor.getType())); } else { log.debug("Entity {}: no Chef attribute matching {}; setting sensor to null", new Object[]{ entity.getDisplayName(), chefAttributeName, sensor.getName()}); entity.setAttribute(sensor, null); } } }
Source:
<code><START> public synchronized Object getProperty(Object key) { <END> return properties.get(key); }</code><technical_language>Hmmm want depend Channel monitor... for property access preferential properties monitor object</technical_language>

Target:
public Object getProperty(Object key) { return properties.get(key); }
Source:
<code>private synchronized void onUpdate() { if (bridge != null) { if (pollingJob == null || pollingJob.isCancelled()) { int pollingInterval = DEFAULT_POLLING_INTERVAL; try { <START> pollingInterval = ((BigDecimal) getConfig().get(POLLING_INTERVAL)).intValue(); <END> } catch(NumberFormatException ex) pollingJob = scheduler.scheduleAtFixedRate(pollingRunnable, 1, pollingInterval, TimeUnit.SECONDS); } } }</code><technical_language>Is configuration object for created bridge things? If missing, this (<code>getConfig().get(POLLING_INTERVAL)</code>) return null intValue call raise a NPE</technical_language>

Target:
private synchronized void onUpdate() { if (bridge != null) { if (pollingJob == null || pollingJob.isCancelled()) { int pollingInterval = DEFAULT_POLLING_INTERVAL; try { Object pollingIntervalConfig = getConfig().get(POLLING_INTERVAL); if (pollingIntervalConfig != null) { pollingInterval = ((BigDecimal) pollingIntervalConfig).intValue(); } else { logger.info("Polling interval not configured for this hue bridge. Using default value: {}s", pollingInterval); } } catch (NumberFormatException ex) { logger.info("Wrong configuration value for polling interval. Using default value: {}s", pollingInterval); } pollingJob = scheduler.scheduleAtFixedRate(pollingRunnable, 1, pollingInterval, TimeUnit.SECONDS); } } }
Source:
<code>private SentMessageDetails sendMessageToNicos(NICOSMessage<?> nicosMessage) { <START> SentMessageDetails response = session.sendMessage(nicosMessage); <END> if (!response.isSent()) { disconnect(); } return response; }</code><technical_language>Naming this object "response" is a bit confusing, this SentMessageDetails object contains a ReceiveScriptStatus object is called "response". of renamed. (Same for l. 249.) Also, check naming scheme in this class is consistent (elsewhere, objects called "loginSendMessageDetails" "scriptSentMessageDetails")</technical_language>

Target:
private SentMessageDetails sendMessageToNicos(NICOSMessage<?> nicosMessage) { SentMessageDetails messageSentMessageDetails = session.sendMessage(nicosMessage); if (!messageSentMessageDetails.isSent()) { disconnect(); } return messageSentMessageDetails; }
Source:
<code>private void dumpChanges() { ArrayList<Object[]> adjustedChanges = getAdjustedTemplateChanges(); for (int i = 0; i < mTemplateChanges.size(); i++) { Object[] change = mTemplateChanges.get(i); Object[] adjustedChange = adjustedChanges.get(i); <START> Timber.d("dumpChanges() Change %s is ord/type %s/%s", i, change[0], change[1]); <END> Timber.d("dumpChanges() During save change %s will be ord/type %s/%s", i, adjustedChange[0], adjustedChange[1]); } }</code><technical_language>Nit: Early return if Timber offers .isDebug(), me,</technical_language>

Target:
private void dumpChanges() { if (!BuildConfig.DEBUG) { return; } ArrayList<Object[]> adjustedChanges = getAdjustedTemplateChanges(); for (int i = 0; i < mTemplateChanges.size(); i++) { Object[] change = mTemplateChanges.get(i); Object[] adjustedChange = adjustedChanges.get(i); Timber.d("dumpChanges() Change %s is ord/type %s/%s", i, change[0], change[1]); Timber.d("dumpChanges() During save change %s will be ord/type %s/%s", i, adjustedChange[0], adjustedChange[1]); } }
Source:
<code>public void stateChanged(CuratorFramework client, ConnectionState newState) { if (newState.equals(ConnectionState.RECONNECTED)) { LOG.info("Reconnected to zookeeper, checking if configs are still in sync"); <START> Optional<String> maybeLastReuqestForGroup = loadBalancerDatastore.getLastRequestForGroup(configuration.getLoadBalancerConfiguration().getName()); <END> if (!maybeLastReuqestForGroup.isPresent() || !maybeLastReuqestForGroup.get().equals(mostRecentRequestId.get())) { reapplyConfigsWithRetry(); } } }</code><technical_language>typo</technical_language>

Target:
public void stateChanged(CuratorFramework client, ConnectionState newState) { if (newState == ConnectionState.RECONNECTED) { LOG.info("Reconnected to zookeeper, checking if configs are still in sync"); Optional<String> maybeLastRequestForGroup = loadBalancerDatastore.getLastRequestForGroup(configuration.getLoadBalancerConfiguration().getName()); if (!maybeLastRequestForGroup.isPresent() || !maybeLastRequestForGroup.get().equals(mostRecentRequestId.get())) { reapplyConfigsWithRetry(); } } }
Source:
<code>public static ByteString bitAnd(ByteString b0, ByteString b1) { if (b0.length() != b1.length()) { throw RESOURCE.invalidInputForBitwiseBinaryValue().ex(); } byte[] bytes0 = b0.getBytes(); byte[] bytes1 = b1.getBytes(); byte[] result = new byte[b0.length()]; <START> IntStream.range(0, bytes0.length).forEach(i -> { <END> result[i] = (byte) (bytes0[i] & bytes1[i]); }); return new ByteString(result); }</code><technical_language>Frankly speaking, a good for loop here, streams add complexity benefits. suggestion for (int i = 0; i < bytes0.length; i++) {</technical_language>

Target:
public static ByteString bitAnd(ByteString b0, ByteString b1) { return binaryOperator(b0, b1, (x, y) -> (byte) (x & y)); }
Source:
<code>public Channel createChannel(String id) throws Exception { JGroupsLogger.ROOT_LOGGER.debugf("Creating fork channel %s from channel %s", id, this.channel.getClusterName()); String stackName = this.protocols.isEmpty() ? this.channel.getClusterName() : id; <START> List<Protocol> list = new ArrayList<>(); <END> for (ProtocolConfiguration<? extends Protocol> pc : this.protocols) { Protocol pcProtocol = pc.createProtocol(this.parentFactory.getProtocolStackConfiguration()); list.add(pcProtocol); } return new ForkChannel(this.channel, stackName, id, list.toArray(new Protocol[0])); }</code><technical_language>Unnecessary intermediate collection</technical_language>

Target:
public Channel createChannel(String id) throws Exception { JGroupsLogger.ROOT_LOGGER.debugf("Creating fork channel %s from channel %s", id, this.channel.getClusterName()); final List<ProtocolConfiguration<? extends Protocol>> protocols = this.protocols; String stackName = protocols.isEmpty() ? this.channel.getClusterName() : id; Protocol[] array = new Protocol[protocols.size()]; for (int i = 0; i < protocols.size(); i++) { array[i] = protocols.get(i).createProtocol(this.parentFactory.getProtocolStackConfiguration()); } return new ForkChannel(this.channel, stackName, id, array); }
Source:
<code>private void assertArea(String wkt, double expectedArea) { <START> assertFunctionImprecise(format("ST_Area(to_spherical_geography(ST_GeometryFromText('%s')))", wkt), expectedArea, 1e-4); <END> }</code><technical_language>this change? unrelated</technical_language>

Target:
private void assertArea(String wkt, double expectedArea) { assertFunction(format("ABS(ROUND((ST_Area(to_spherical_geography(ST_GeometryFromText('%s'))) / %f - 1 ) * %d, 0))", wkt, expectedArea, 10000), DOUBLE, 0.0); }
Source:
<code>public void testCreateAccountWithExternalKeyOverLimit() throws Exception { AccountModelDao accountModelDao = createTestAccount(); accountModelDao.setExternalKey("Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis,."); final AccountData accountData = new DefaultAccount(accountModelDao); try { <START> accountUserApi.createAccount(accountData, callContext); <END> } catch (final AccountApiException e) { assertEquals(e.getCode(), ErrorCode.EXTERNAL_KEY_LIMIT_EXCEEDED.getCode()); } }</code><technical_language>Missing Assert.fail()</technical_language>

Target:
public void testCreateAccountWithExternalKeyOverLimit() throws Exception { AccountModelDao accountModelDao = createTestAccount(); accountModelDao.setExternalKey("Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis,."); final AccountData accountData = new DefaultAccount(accountModelDao); try { accountUserApi.createAccount(accountData, callContext); Assert.fail(); } catch (final AccountApiException e) { assertEquals(e.getCode(), ErrorCode.EXTERNAL_KEY_LIMIT_EXCEEDED.getCode()); } }
Source:
<code>private void loadRevision() { <START> AnalyticsTracker.track(Stat.REVISIONS_REVISION_LOADED); <END> showDialogProgress(true); mPostForUndo = mPost.clone(); mPost.setTitle(mRevision.getPostTitle()); mPost.setContent(mRevision.getPostContent()); mPost.setIsLocallyChanged(true); mPost.setDateLocallyChanged(DateTimeUtils.iso8601FromTimestamp(System.currentTimeMillis() / 1000)); refreshEditorContent(); Snackbar.make(mViewPager, getString(R.string.history_loaded_revision), AccessibilityUtils.getSnackbarDuration(EditPostActivity.this, 4000)) .setAction(getString(R.string.undo), new OnClickListener() { @Override public void onClick(View view) { AnalyticsTracker.track(Stat.REVISIONS_LOAD_UNDONE); RemotePostPayload payload = new RemotePostPayload(mPostForUndo, mSite); mDispatcher.dispatch(PostActionBuilder.newFetchPostAction(payload)); mPost = mPostForUndo.clone(); refreshEditorContent(); } }) .show(); showDialogProgress(false); }</code><technical_language>this _is_ technically revision is loaded, move this tracking upstream ***Load*** action button is tapped [here](<LINK_0> for consistency cancelled counterpart [here](<LINK_1></technical_language>

Target:
private void loadRevision() { showDialogProgress(true); mPostForUndo = mPost.clone(); mPost.setTitle(mRevision.getPostTitle()); mPost.setContent(mRevision.getPostContent()); mPost.setIsLocallyChanged(true); mPost.setDateLocallyChanged(DateTimeUtils.iso8601FromTimestamp(System.currentTimeMillis() / 1000)); refreshEditorContent(); Snackbar.make(mViewPager, getString(R.string.history_loaded_revision), AccessibilityUtils.getSnackbarDuration(EditPostActivity.this, 4000)) .setAction(getString(R.string.undo), new OnClickListener() { @Override public void onClick(View view) { AnalyticsTracker.track(Stat.REVISIONS_LOAD_UNDONE); RemotePostPayload payload = new RemotePostPayload(mPostForUndo, mSite); mDispatcher.dispatch(PostActionBuilder.newFetchPostAction(payload)); mPost = mPostForUndo.clone(); refreshEditorContent(); } }) .show(); showDialogProgress(false); }
Source:
<code>public void testCountByChromosomeAndStartAndTypeAndStudy() { List<String> studies = new ArrayList<>(); studies.add("PRJX00001"); Long count = variantEntityRepository.countByChromosomeAndStartAndTypeAndStudyIn("11", 180077, <START> Variant.VariantType.INDEL, <END> studies); assertEquals(new Long(1), count); }</code><technical_language>weird alignment</technical_language>

Target:
public void testCountByChromosomeAndStartAndTypeAndStudy() { List<String> studies = new ArrayList<>(); studies.add("PRJX00001"); Long count = (long) variantEntityRepository.findByChromosomeAndStartAndTypeAndStudyIn("11", 180077, Variant.VariantType.INDEL, studies) .size(); assertEquals(new Long(1), count); }
Source:
<code>protected void executeCommand() { getParameters().setEntityInfo(new EntityInfo(VdcObjectType.Disk, <START> getParameters().getImageList().stream().findFirst().get())); <END> List<Guid> failedGuids = getFailedVolumeIds(); if (failedGuids.isEmpty()) { log.info("Requested images were successfully removed"); setSucceeded(true); persistCommand(getParameters().getParentCommand()); } else { log.error("The following images were not removed: {}", failedGuids); } }</code><technical_language>please replace parameter getParameters().getImageGroupId() - disk id</technical_language>

Target:
protected void executeCommand() { getParameters().setEntityInfo(new EntityInfo(VdcObjectType.Disk, getParameters().getImageGroupId())); List<Guid> failedGuids = getFailedVolumeIds(); if (failedGuids.isEmpty()) { log.info("Requested images were successfully removed"); setSucceeded(true); persistCommand(getParameters().getParentCommand()); } else { log.error("The following images were not removed: {}", failedGuids); } }
Source:
<code>private void writeNetworkInterfaceMetadata() { vnicMetadata.forEach((mac, data) -> { writer.writeStartElement(OVIRT_VM_URI, "device"); writer.writeAttributeString("mac_address", mac); List<String> portMirroring = (List<String>) data.get("portMirroring"); if (portMirroring != null) { writer.writeStartElement(OVIRT_VM_URI, "portMirroring"); <START> portMirroring.forEach(network -> writer.writeElement(OVIRT_VM_URI, "network", network)); <END> writer.writeEndElement(); } writer.writeEndElement(); }); }</code><technical_language>fine for me, working Vdsm side</technical_language>

Target:
private void writeNetworkInterfaceMetadata() { vnicMetadata.forEach((mac, data) -> { writer.writeStartElement("device"); writer.writeAttributeString("mac_address", mac); List<String> portMirroring = (List<String>) data.get("portMirroring"); if (portMirroring != null) { writer.writeStartElement("portMirroring"); portMirroring.forEach(network -> writer.writeElement("network", network)); writer.writeEndElement(); } writer.writeEndElement(); }); }
Source:
<code><START> public void clearDataTable() { <END> getDatabaseService().runPreparedUpdate(getConnection(), "DELETE FROM " + getMetaData().getTableName() + " WHERE NOT branch_type = ?", BranchType.SYSTEM_ROOT); }</code><technical_language>move paren afer getTAbleName()</technical_language>

Target:
public void clearDataTable() { getDatabaseService().runPreparedUpdate(getConnection(), String.format("DELETE FROM %s where NOT branch_type = ?", getMetaData().getTableName()), BranchType.SYSTEM_ROOT); }