auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void cloneOrUpdateWithLock() throws RepositoryException { synchronized (mutex) { try { LOGGER.info("Begin fetching process of '{}' to '{}'", repositoryUri, localFolder); boolean lockFileExists = this.lockFile.exists(); if (!lockFileExists) { <START> LOGGER.info("Creating lock file '{}' for git-repository '{}'", lockFile, repositoryUri); <END> try { this.lockFile.getParentFile().mkdirs(); this.lockFile.createNewFile(); } catch (IOException e) { throw new RepositoryException("Couldn't create lock file " + lockFile.getAbsolutePath()); } } try (FileOutputStream lockFileStream = new FileOutputStream(lockFile, true)) { try (FileLock ignored = lockFileStream.getChannel().lock()) { cloneOrUpdate(); } } } catch (IOException e) { throw new RepositoryException("An unknown error occurred", e); } } }</code><technical_language>suggestion LOGGER.info("Creating lock file '{}' for git-repository '{}'", lockFile.getAbsolutePath(), repositoryUri);</technical_language>

Target:
private void cloneOrUpdateWithLock() throws RepositoryException { synchronized (mutex) { try { LOGGER.info("Begin fetching process of '{}' to '{}'", this.repositoryUri, this.localFolder.getAbsolutePath()); boolean lockFileExists = this.lockFile.exists(); if (!lockFileExists) { LOGGER.info("Creating lock file '{}' for git-repository '{}'", this.lockFile.getAbsolutePath(), this.repositoryUri); try { this.lockFile.getParentFile().mkdirs(); this.lockFile.createNewFile(); } catch (IOException e) { final String message = String.format("Couldn't create lock file '%s'", this.lockFile.getAbsolutePath()); throw new RepositoryException(message, e); } } try (FileOutputStream lockFileStream = new FileOutputStream(lockFile, true)) { try (FileLock ignored = lockFileStream.getChannel().lock()) { cloneOrUpdate(); } } } catch (IOException e) { throw new RepositoryException("An unknown error occurred", e); } } }
Source:
<code>public static UseRestriction buildORRestrictionFromClasses(List<String> ontologyClasses) { List<String> validClasses = ontologyClasses.stream(). filter(s -> !s.isEmpty()). collect(Collectors.toList()); <START> if (validClasses != null && validClasses.size() == 1) { <END> return new Named(validClasses.get(0)); } else if (validClasses != null && validClasses.size() > 1) { Named[] named = validClasses.stream().map(Named::new). toArray(size -> new Named[validClasses.size()]); return new Or(named); } else { return null; } }</code><technical_language>buildAndRestriction CollectionUtils.isNotEmpty ... do for consistency? if (CollectionUtils.isNotEmpty(validClasses)) { if (validClasses.size() == 1) { // validClasses.get(0) } else { // build classes } } else { return null; }</technical_language>

Target:
public static UseRestriction buildORRestrictionFromClasses(List<String> ontologyClasses) throws IllegalArgumentException { List<String> validClasses = ontologyClasses.stream(). filter(s -> !s.isEmpty()). collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(validClasses)) { if (validClasses.size() == 1) { return new Named(validClasses.get(0)); } else { Named[] named = validClasses.stream().map(Named::new). toArray(size -> new Named[validClasses.size()]); return new Or(named); } } throw new IllegalArgumentException("Ontology Classes cannot be empty"); }
Source:
<code>private javax.swing.JPanel getMainPanel() { if (mainPanel == null) { <START> mainPanel = new JPanel(new java.awt.GridBagLayout()); <END> mainPanel.setName("CallbackPanel"); mainPanel.add(getToolBar(), newToolbarGBC()); mainPanel.add(getJScrollPane(), newScrollPaneGBC()); } return mainPanel; }</code><technical_language>Lets BorderLayout instead, require extra configurations (GridBagConstraints)</technical_language>

Target:
private javax.swing.JPanel getMainPanel() { if (mainPanel == null) { mainPanel = new JPanel(new BorderLayout()); mainPanel.setName("CallbackPanel"); mainPanel.add(getToolBar(), BorderLayout.PAGE_START); mainPanel.add(getJScrollPane(), BorderLayout.CENTER); } return mainPanel; }
Source:
<code>public void fetchCartInStoreByCustomerId() { <START> StoreFixtures.withStore(client(), store -> { <END> CustomerFixtures.withCustomer(client(), customer -> { final CartDraft cartDraft = CartDraft.of(DefaultCurrencyUnits.EUR).withStore(store.toResourceIdentifier()).withCustomerId(customer.getId()); final CartCreateCommand cartCreateCommand = CartCreateCommand.of(cartDraft); final Cart cart = client().executeBlocking(cartCreateCommand); final Cart cartInStore = client().executeBlocking(CartInStoreByCustomerIdGet.of(store.getKey(), customer.getId())); assertThat(cartInStore).isNotNull(); assertThat(cartInStore.getId()).isEqualTo(cart.getId()); assertThat(cartInStore.getCustomerId()).isEqualTo(customer.getId()); client().executeBlocking(CartDeleteCommand.of(cart)); }); }); }</code><technical_language>nice a static import - more consistent other code</technical_language>

Target:
public void fetchCartInStoreByCustomerId() { withStore(client(), store -> { CustomerFixtures.withCustomer(client(), customer -> { final CartDraft cartDraft = CartDraft.of(DefaultCurrencyUnits.EUR).withStore(store.toResourceIdentifier()).withCustomerId(customer.getId()); final CartCreateCommand cartCreateCommand = CartCreateCommand.of(cartDraft); final Cart cart = client().executeBlocking(cartCreateCommand); final Cart cartInStore = client().executeBlocking(CartInStoreByCustomerIdGet.of(store.getKey(), customer.getId())); assertThat(cartInStore).isNotNull(); assertThat(cartInStore.getId()).isEqualTo(cart.getId()); assertThat(cartInStore.getCustomerId()).isEqualTo(customer.getId()); client().executeBlocking(CartDeleteCommand.of(cart)); }); }); }
Source:
<code>public void deactivate() { try { shutdown(); <START> metricsConsumer.close(); <END> } catch (InterruptException e) { throwKafkaConsumerInterruptedException(); } }</code><technical_language>I this belongs in shutdown</technical_language>

Target:
public void deactivate() { try { shutdown(); } catch (InterruptException e) { throwKafkaConsumerInterruptedException(); } }
Source:
<code>public MachineDetails getMachineDetails() { MachineDetails details = machineDetails; if (details == null) { <START> synchronized (machineDetailsLock) { <END> details = machineDetails; if (details == null) { machineDetails = details = BasicMachineDetails.forSshMachineLocation(this); } } } return details; }</code><technical_language>insert this this line get indication in GUI: Tasks.setBlockingDetails("Waiting for machine details") (along Tasks.resetBlockingDetails() afterwards)</technical_language>

Target:
public MachineDetails getMachineDetails() { MachineDetails details = machineDetails; if (details == null) { Tasks.setBlockingDetails("Waiting for machine details"); try { synchronized (machineDetailsLock) { details = machineDetails; if (details == null) { machineDetails = details = BasicMachineDetails.forSshMachineLocation(this); } } } finally { Tasks.resetBlockingDetails(); } } return details; }
Source:
<code>private void configureManagementNetwork(SetupNetworksParameters parameters) { VdcReturnValueBase retVal = getBackend().runInternalAction(VdcActionType.SetupNetworks, parameters); if (retVal.getSucceeded()) { <START> retVal = <END> getBackend().runInternalAction(VdcActionType.CommitNetworkChanges, new VdsActionParameters(parameters.getVdsId())); if (!retVal.getSucceeded()) { final AuditLogableBase event = new AuditLogableBase(); event.setVds(host); AuditLogDirector.log(event, AuditLogType.PERSIST_NETWORK_FAILED_FOR_MANAGEMENT_NETWORK, NETWORK_CONFIG_LOG_ERR); throw new NetworkConfiguratorException(MANAGEMENET_NETWORK_CONFIG_ERR); } } else { final AuditLogableBase event = new AuditLogableBase(); event.setVds(host); AuditLogDirector.log(event, AuditLogType.SETUP_NETWORK_FAILED_FOR_MANAGEMENT_NETWORK_CONFIGURATION, NETWORK_CONFIG_LOG_ERR); throw new NetworkConfiguratorException(MANAGEMENET_NETWORK_CONFIG_ERR); } }</code><technical_language>new line is necessary.</technical_language>

Target:
private void configureManagementNetwork(SetupNetworksParameters parameters) { VdcReturnValueBase retVal = getBackend().runInternalAction(VdcActionType.SetupNetworks, parameters); if (retVal.getSucceeded()) { retVal = getBackend().runInternalAction(VdcActionType.CommitNetworkChanges, new VdsActionParameters(parameters.getVdsId())); if (!retVal.getSucceeded()) { AuditLogDirector.log(createEvent(), AuditLogType.PERSIST_NETWORK_FAILED_FOR_MANAGEMENT_NETWORK, NETWORK_CONFIG_LOG_ERR); throw new NetworkConfiguratorException(MANAGEMENET_NETWORK_CONFIG_ERR); } } else { AuditLogDirector.log(createEvent(), AuditLogType.SETUP_NETWORK_FAILED_FOR_MANAGEMENT_NETWORK_CONFIGURATION, NETWORK_CONFIG_LOG_ERR); throw new NetworkConfiguratorException(MANAGEMENET_NETWORK_CONFIG_ERR); } }
Source:
<code><START> public CTInline addChart(int width, int height,String chartRelId) <END> throws InvalidFormatException, IOException { try { CTDrawing drawing = run.addNewDrawing(); CTInline inline = drawing.addNewInline(); String xml = "<a:graphic xmlns:a=\"" + CTGraphicalObject.type.getName().getNamespaceURI() + "\">" + "<a:graphicData uri=\"" + CTChart.type.getName().getNamespaceURI() + "\">" + "<c:chart xmlns:c=\"" + CTChart.type.getName().getNamespaceURI() + "\" xmlns:r=\"<LINK_0>\" r:id=\""+chartRelId+"\" />" + "</a:graphicData>" + "</a:graphic>"; InputSource is = new InputSource(new StringReader(xml)); org.w3c.dom.Document doc = DocumentHelper.readDocument(is); inline.set(XmlToken.Factory.parse(doc.getDocumentElement(), DEFAULT_XML_OPTIONS)); inline.setDistT(0); inline.setDistR(0); inline.setDistB(0); inline.setDistL(0); CTNonVisualDrawingProps docPr = inline.addNewDocPr(); long id = getParent().getDocument().getDrawingIdManager().reserveNew(); docPr.setId(id); docPr.setName("chart " + id); CTPositiveSize2D extent = inline.addNewExtent(); extent.setCx(width); extent.setCy(height); return inline; } catch (XmlException e) { throw new IllegalStateException(e); } catch (SAXException e) { throw new IllegalStateException(e); } }</code><technical_language>@Internal</technical_language>

Target:
public CTInline addChart(int width, int height,String chartRelId) throws InvalidFormatException, IOException { try { CTInline inline = run.addNewDrawing().addNewInline(); String xml = "<a:graphic xmlns:a=\"" + CTGraphicalObject.type.getName().getNamespaceURI() + "\">" + "<a:graphicData uri=\"" + CTChart.type.getName().getNamespaceURI() + "\">" + "<c:chart xmlns:c=\"" + CTChart.type.getName().getNamespaceURI() + "\" xmlns:r=\"<LINK_0>\" r:id=\""+chartRelId+"\" />" + "</a:graphicData>" + "</a:graphic>"; InputSource is = new InputSource(new StringReader(xml)); org.w3c.dom.Document doc = DocumentHelper.readDocument(is); inline.set(XmlToken.Factory.parse(doc.getDocumentElement(), DEFAULT_XML_OPTIONS)); inline.setDistT(0); inline.setDistR(0); inline.setDistB(0); inline.setDistL(0); CTNonVisualDrawingProps docPr = inline.addNewDocPr(); long id = getParent().getDocument().getDrawingIdManager().reserveNew(); docPr.setId(id); docPr.setName("chart " + id); CTPositiveSize2D extent = inline.addNewExtent(); extent.setCx(width); extent.setCy(height); return inline; } catch (XmlException e) { throw new IllegalStateException(e); } catch (SAXException e) { throw new IllegalStateException(e); } }
Source:
<code>public static int toInteger(String string) { try { <START> return Integer.parseInt(string.replaceAll("[^\\d]", "")); <END> } catch (NumberFormatException ex) { return Integer.MIN_VALUE; } }</code><technical_language>if avoid \d for 0-9 instead \d matches non-English digits</technical_language>

Target:
public static int toInteger(String string) throws NumberFormatException{ return Integer.parseInt(string.replaceAll("[^0-9.]", "")); }
Source:
<code>default void inputDetail() { mandatory(directory()); optional(filename()); <START> or(mandatory(host().id()), mandatory(host().name())); <END> }</code><technical_language>I mandatory attributes optional</technical_language>

Target:
default void inputDetail() { or(mandatory(storageDomain().id()), mandatory(storageDomain().name())); optional(exclusive()); }
Source:
<code>private ICPPConstructor getConstructor(IASTDeclaration decl) { if (decl instanceof ICPPASTFunctionDefinition) { ICPPASTFunctionDefinition functionDefinition = (ICPPASTFunctionDefinition) decl; if (functionDefinition.isDeleted()) return null; IBinding binding = functionDefinition.getDeclarator().getName().resolveBinding(); if (binding instanceof ICPPConstructor) { ICPPConstructor constructor = (ICPPConstructor) binding; if (functionDefinition.isDefaulted() && SemanticQueries.isCopyOrMoveConstructor(constructor)) return null; if (constructor.getClassOwner().getKey() == ICompositeType.k_union) return null; <START> for (ICPPASTConstructorChainInitializer memberInitializer : functionDefinition <END> .getMemberInitializers()) { IASTName memberName = memberInitializer.getMemberInitializerId(); if (memberName != null) { IBinding memberBinding = memberName.resolveBinding(); ICPPClassType classType = null; if (memberBinding instanceof ICPPClassType) { classType = (ICPPClassType) memberBinding; } else if (memberBinding instanceof ICPPConstructor) { classType = ((ICPPConstructor) memberBinding).getClassOwner(); } if (classType instanceof ICPPDeferredClassInstance) { classType = ((ICPPDeferredClassInstance) classType).getClassTemplate(); } if (classType != null && classType.isSameType(constructor.getClassOwner())) return null; } } return constructor; } } return null; }</code><technical_language>I a test covering delegating constructors</technical_language>

Target:
private ICPPConstructor getConstructor(IASTDeclaration decl) { if (decl instanceof ICPPASTFunctionDefinition) { ICPPASTFunctionDefinition functionDefinition = (ICPPASTFunctionDefinition) decl; if (functionDefinition.isDeleted()) return null; IBinding binding = functionDefinition.getDeclarator().getName().resolveBinding(); if (binding instanceof ICPPConstructor) { ICPPConstructor constructor = (ICPPConstructor) binding; if (functionDefinition.isDefaulted() && SemanticQueries.isCopyOrMoveConstructor(constructor)) return null; if (constructor.getClassOwner().getKey() == ICompositeType.k_union) return null; for (ICPPASTConstructorChainInitializer memberInitializer : functionDefinition .getMemberInitializers()) { IASTName memberName = memberInitializer.getMemberInitializerId(); if (memberName != null) { IBinding memberBinding = memberName.resolveBinding(); ICPPClassType classType = null; if (memberBinding instanceof ICPPConstructor) { classType = ((ICPPConstructor) memberBinding).getClassOwner(); } if (classType instanceof ICPPDeferredClassInstance) { classType = ((ICPPDeferredClassInstance) classType).getClassTemplate(); } if (classType != null && classType.isSameType(constructor.getClassOwner())) return null; } } return constructor; } } return null; }
Source:
<code>private int clipScrollDelta(int currentValue, int delta, int max) { int newValue = currentValue + delta; if (newValue < 0) { delta = -currentValue; } else { if (max < 0) { delta = 0; } else if (newValue > max) { delta = max - currentValue; } } <START> return delta; <END> }</code><technical_language>do need return data is argument? return a new caller re-assign is passing in. return null modify argument, return a new modifying argument</technical_language>

Target:
private int clipScrollDelta(int currentValue, int delta, int max) { int clippedDelta = delta; int newValue = currentValue + delta; if (newValue < 0) { clippedDelta = -currentValue; } else { if (max < 0) { clippedDelta = 0; } else if (newValue > max) { clippedDelta = max - currentValue; } } return clippedDelta; }
Source:
<code>private void assertTopKeyAccesses(String key, long expected, boolean readAccesses) { final CacheUsageInterceptor topK = getTopKey(); eventuallyEquals("Wrong number of accesses.", expected, () -> { Long value = readAccesses ? topK.getLocalTopGets().get(key) : topK.getLocalTopPuts().get(key); <START> return value == null ? 0 : value; <END> }); }</code><technical_language>getOrDefault(key, 0)</technical_language>

Target:
private void assertTopKeyAccesses(String key, long expected, boolean readAccesses) { final CacheUsageInterceptor topK = getTopKey(); eventuallyEquals("Wrong number of accesses.", expected, () -> readAccesses ? topK.getLocalTopGets().getOrDefault(key, 0L) : topK.getLocalTopPuts().getOrDefault(key, 0L)); }
Source:
<code>public static Text join(Text separator, Text... texts) { <START> switch (texts.length) { <END> case 0: return of(); case 1: return texts[0]; default: TextBuilder builder = builder(); boolean first = true; for (Text text : texts) { if (!first) { builder.append(separator); } else { first = false; } builder.append(text); } return builder.build(); } }</code><technical_language>nice for :)</technical_language>

Target:
public static Text join(Text separator, Text... texts) { switch (texts.length) { case 0: return of(); case 1: return texts[0]; default: TextBuilder builder = builder(); boolean appendSeparator = false; for (Text text : texts) { if (appendSeparator) { builder.append(separator); } else { appendSeparator = true; } builder.append(text); } return builder.build(); } }
Source:
<code>public void abortCheckpointOnBarrier(long checkpointId, Throwable cause, OperatorChain<?, ?> operatorChain) throws IOException { LOG.debug("Aborting checkpoint via cancel-barrier for task {}", checkpointId, taskName); checkpointStorage.clearCacheFor(checkpointId); <START> channelStateWriter.abort(checkpointId, cause, true); <END> env.declineCheckpoint(checkpointId, cause); actionExecutor.runThrowing(() -> operatorChain.broadcastEvent(new CancelCheckpointMarker(checkpointId))); }</code><technical_language>I race condition here. abortCheckpointOnBarrier called CheckpointBarrierUnaligner triggering checkpoint mailbox. aborting, remove checkpoint action mailbox, checkpoint happen afterwards. guarantee #getAndRemoveWriteResult called aborting</technical_language>

Target:
public void abortCheckpointOnBarrier(long checkpointId, Throwable cause, OperatorChain<?, ?> operatorChain) throws IOException { LOG.debug("Aborting checkpoint via cancel-barrier for task {}", checkpointId, taskName); lastCheckpointId = Math.max(lastCheckpointId, checkpointId); Iterator<Long> iterator = abortedCheckpointIds.iterator(); while (iterator.hasNext()) { long next = iterator.next(); if (next < lastCheckpointId) { iterator.remove(); } else { break; } } checkpointStorage.clearCacheFor(checkpointId); channelStateWriter.abort(checkpointId, cause, true); env.declineCheckpoint(checkpointId, cause); actionExecutor.runThrowing(() -> operatorChain.broadcastEvent(new CancelCheckpointMarker(checkpointId))); }
Source:
<code>public boolean hasValidJdkLocation() { File javaDir = getJavaDir(); <START> return javaDir != null && JdkLocationStep.validateJdkLocation(javaDir.getAbsolutePath()) == null; <END> }</code><technical_language>..and another :-)</technical_language>

Target:
public boolean hasValidJdkLocation() { File javaDir = getJavaDir(); return javaDir != null && JdkLocationStep.validateJdkLocation(javaDir) == null; }
Source:
<code><START> public ChannelWriteController( <END> ApplicationConfigurationFetcher appConfigFetcher, ChannelStore store, ModelReader reader, ChannelModelTransformer channelTransformer ) { this.appConfigFetcher = checkNotNull(appConfigFetcher); this.store = checkNotNull(store); this.reader = checkNotNull(reader); this.channelTransformer = checkNotNull(channelTransformer); }</code><technical_language>Constructor private. a static factory method</technical_language>

Target:
private ChannelWriteController( ApplicationConfigurationFetcher appConfigFetcher, ChannelStore store, ModelReader reader, ChannelModelTransformer channelTransformer ) { this.appConfigFetcher = checkNotNull(appConfigFetcher); this.store = checkNotNull(store); this.reader = checkNotNull(reader); this.channelTransformer = checkNotNull(channelTransformer); }
Source:
<code>public V map(String hostname) { if (hostname != null) { hostname = normalize(hostname); V value = map.get(hostname); if (value != null) { return value; } int idx = hostname.indexOf('.'); if (idx != -1) { <START> value = map.get('*' + hostname.substring(idx)); <END> if (value != null) { return value; } } } return defaultValue; }</code><technical_language>Optional idea: If a user adds a wildcard domain *.netty.io, normalized .netty.io, stored in map. cheaper for this line check if present, string concatenation needed. check substring. I fast want go</technical_language>

Target:
public V map(String hostname) { if (hostname != null) { hostname = normalize(hostname); V value = map.get(hostname); if (value != null) { return value; } int idx = hostname.indexOf('.'); if (idx != -1) { value = map.get(hostname.substring(idx)); if (value != null) { return value; } } } return defaultValue; }
Source:
<code>public Diagram getWorkflow() { <START> Process process = modelInstance.getModelElementsByType(Process.class).iterator().next(); <END> return new Diagram(process); }</code><technical_language>Is a NPE if getModelElementsByType iterator call returning null</technical_language>

Target:
public Diagram getWorkflow() throws IOException { Process process = modelInstance.getModelElementsByType(Process.class).iterator().next(); if (Objects.isNull(process)) { throw new IOException("It looks that given file contains invalid BPMN diagram!"); } return new Diagram(process); }
Source:
<code>public void reopenThread() { waitForElementByCss("div.msg-toolbar"); executeScript("document.getElementsByClassName(\"buttons\")[1].style.display = \"block\""); waitForElementByElement(moreButton); mouseOver(moreButtonCss); executeScript("document.querySelectorAll(\"div.msg-toolbar nav.wikia-menu-button.secondary.combined\")[0].click()"); mouseOver(".WikiaMenuElement .reopen-thread"); jQueryNthElemClick(".WikiaMenuElement .reopen-thread", 0); <START> driver.navigate().refresh(); <END> PageObjectLogging.log("reopenThread", "Thread is reopen", true, driver); }</code><technical_language>try js</technical_language>

Target:
public void reopenThread() { waitForElementByElement(msgToolbar); setStyle(".buttons", "1", "block"); secondaryCombinedMoreButton.click(); mouseOver(reopenThreadCSS); click(reopenThread); refreshPage(); PageObjectLogging.log("reopenThread", "Thread is reopen", true); }
Source:
<code>public Object lookupPreference(long userId, String key, Object defaultValue) { String methodName = "get" + key.substring(0, 1).toUpperCase() + key.substring(1); Object preference; Object serverPreference = null; Object userPreference = null; try { Method method = null; method = User.class.getMethod(methodName, (Class<?>[]) null); if (method != null) { userPreference = method.invoke(users.get(userId), (Object[]) null); } method = null; method = Server.class.getMethod(methodName, (Class<?>[]) null); if (method != null) { serverPreference = method.invoke(server, (Object[]) null); } <START> } catch (NoSuchMethodException | SecurityException | IllegalAccessException <END> | IllegalArgumentException | InvocationTargetException exception) { return defaultValue; } if (server.getForceSettings()) { preference = serverPreference != null ? serverPreference : userPreference; } else { preference = userPreference != null ? userPreference : serverPreference; } return preference != null ? preference : defaultValue; }</code><technical_language>of exceptions combined ReflectiveOperationException. else fine</technical_language>

Target:
public Object lookupPreference(long userId, String key, Object defaultValue) { String methodName = "get" + key.substring(0, 1).toUpperCase() + key.substring(1); Object preference; Object serverPreference = null; Object userPreference = null; try { Method method = null; method = User.class.getMethod(methodName, (Class<?>[]) null); if (method != null) { userPreference = method.invoke(users.get(userId), (Object[]) null); } method = null; method = Server.class.getMethod(methodName, (Class<?>[]) null); if (method != null) { serverPreference = method.invoke(server, (Object[]) null); } } catch (ReflectiveOperationException | SecurityException | IllegalArgumentException exception) { return defaultValue; } if (server.getForceSettings()) { preference = serverPreference != null ? serverPreference : userPreference; } else { preference = userPreference != null ? userPreference : serverPreference; } return preference != null ? preference : defaultValue; }
Source:
<code>private void restoreVmConfigFromSnapshot() { snapshotDao.updateStatus(getParameters().getDstSnapshotId(), SnapshotStatus.IN_PREVIEW); snapshotDao.updateStatus(snapshotDao.getId(getVm().getId(), SnapshotType.PREVIEW, SnapshotStatus.LOCKED), SnapshotStatus.OK); getSnapshotsManager().attempToRestoreVmConfigurationFromSnapshot(getVm(), getDstSnapshot(), snapshotDao.getId(getVm().getId(), SnapshotType.ACTIVE), getImagesToPreview(), getCompensationContext(), getCurrentUser(), new VmInterfaceManager(getMacPool()), isRestoreMemory(), isLeaseInfoUpdateNeeded()); if (!isRestoreLease()) { <START> vmStaticDao.updateVmLeaseStorageDomainId(getVm().getId(), null); <END> } if (getParameters().getDstLeaseDomainId() != null && !getParameters().getDstLeaseDomainId() .equals(OvfUtils.fetchLeaseDomainId(getDstSnapshot().getVmConfiguration()))) { vmStaticDao.updateVmLeaseStorageDomainId(getVm().getId(), getParameters().getDstLeaseDomainId()); } }</code><technical_language>in vmDynamicDao now? <LINK_0></technical_language>

Target:
private void restoreVmConfigFromSnapshot() { snapshotDao.updateStatus(getParameters().getDstSnapshotId(), SnapshotStatus.IN_PREVIEW); snapshotDao.updateStatus(snapshotDao.getId(getVm().getId(), SnapshotType.PREVIEW, SnapshotStatus.LOCKED), SnapshotStatus.OK); getSnapshotsManager().attempToRestoreVmConfigurationFromSnapshot(getVm(), getDstSnapshot(), snapshotDao.getId(getVm().getId(), SnapshotType.ACTIVE), getImagesToPreview(), getCompensationContext(), getCurrentUser(), new VmInterfaceManager(getMacPool()), isRestoreMemory(), isLeaseInfoUpdateNeeded()); if (!isRestoreLease()) { vmStaticDao.updateVmLeaseStorageDomainId(getVm().getId(), null); } Guid dstLeaseStorageDomainId = OvfUtils.fetchLeaseDomainId(getDstSnapshot().getVmConfiguration()); if (getParameters().getDstLeaseDomainId() != null && !getParameters().getDstLeaseDomainId() .equals(dstLeaseStorageDomainId)) { vmStaticDao.updateVmLeaseStorageDomainId(getVm().getId(), getParameters().getDstLeaseDomainId()); } }
Source:
<code>public void abortProcessInstances(String serverTemplateId, Map<String, List<Long>> containerInstances) { ProcessServicesClient client = getClient(serverTemplateId, ProcessServicesClient.class); containerInstances.entrySet().stream().forEach((entry -> { client.abortProcessInstances(entry.getKey(), <START> entry.getValue()); <END> })); }</code><technical_language>this: containerInstances.forEach((container, instances) -> client.abortProcessInstances(container, instances));</technical_language>

Target:
public void abortProcessInstances(String serverTemplateId, Map<String, List<Long>> containerInstances) { ProcessServicesClient client = getClient(serverTemplateId, ProcessServicesClient.class); containerInstances.forEach((container, instances) -> client.abortProcessInstances(container, instances) ); }
Source:
<code><START> public void parseChildren(final XMLExtendedStreamReader reader, PathAddress parentAddress, List<ModelNode> list, ModelNode op) throws XMLStreamException { <END> if (children.size() == 0) { if (flushRequired && attributeGroups.isEmpty() && attributeElements.isEmpty()) { ParseUtils.requireNoContent(reader); } if (childAlreadyRead) { throw ParseUtils.unexpectedElement(reader); } } else { Map<String, PersistentResourceXMLDescription> children = getChildrenMap(); if (childAlreadyRead) { PersistentResourceXMLDescription decoratorChild = children.get(reader.getLocalName()); if (decoratorChild != null && decoratorChild.decoratorElement != null) { decoratorChild.parseDecorator(reader, parentAddress, list); } } if (childAlreadyRead || (reader.hasNext() && reader.nextTag() != XMLStreamConstants.END_ELEMENT)) { do { PersistentResourceXMLDescription child = children.get(reader.getLocalName()); if (child != null) { child.parse(reader, parentAddress, list); } else if (attributeElements.containsKey(reader.getLocalName())) { AttributeDefinition ad = attributeElements.get(reader.getLocalName()); ad.getParser().parseElement(ad, reader, op); } else if (customChildParsers.containsKey(reader.getLocalName())) { customChildParsers.get(reader.getLocalName()).parse(reader, parentAddress, list); } else { throw ParseUtils.unexpectedElement(reader, children.keySet()); } } while (reader.hasNext() && reader.nextTag() != XMLStreamConstants.END_ELEMENT); } } }</code><technical_language>public</technical_language>

Target:
private void parseChildren(final XMLExtendedStreamReader reader, PathAddress parentAddress, List<ModelNode> list, ModelNode op) throws XMLStreamException { if (children.size() == 0) { if (flushRequired && attributeGroups.isEmpty() && attributeElements.isEmpty()) { ParseUtils.requireNoContent(reader); } if (childAlreadyRead) { throw ParseUtils.unexpectedElement(reader); } } else { Map<String, PersistentResourceXMLDescription> children = getChildrenMap(); if (childAlreadyRead) { PersistentResourceXMLDescription decoratorChild = children.get(reader.getLocalName()); if (decoratorChild != null && decoratorChild.decoratorElement != null) { decoratorChild.parseDecorator(reader, parentAddress, list); } } if (childAlreadyRead || (reader.hasNext() && reader.nextTag() != XMLStreamConstants.END_ELEMENT)) { do { PersistentResourceXMLDescription child = children.get(reader.getLocalName()); if (child != null) { child.parse(reader, parentAddress, list); } else if (attributeElements.containsKey(reader.getLocalName())) { AttributeDefinition ad = attributeElements.get(reader.getLocalName()); ad.getParser().parseElement(ad, reader, op); } else if (customChildParsers.containsKey(reader.getLocalName())) { customChildParsers.get(reader.getLocalName()).parse(reader, parentAddress, list); } else { throw ParseUtils.unexpectedElement(reader, children.keySet()); } } while (reader.hasNext() && reader.nextTag() != XMLStreamConstants.END_ELEMENT); } } }
Source:
<code>public String sendAddOperation(String userid, Collection<PID> destinations, Collection<PID> added, Collection<PID> reordered, String depositId) { Element contentEl = createAtomEntry(userid, destinations.iterator().next(), CDRActions.ADD); Element add = new Element("add", CDR_MESSAGE_NS); contentEl.addContent(add); if (depositId != null) { add.addContent(new Element("depositId", CDR_MESSAGE_NS).setText(depositId)); } for (PID destination : destinations) { <START> add.addContent(new Element("parent", CDR_MESSAGE_NS).setText(destination.toString())); <END> } Element subjects = new Element("subjects", CDR_MESSAGE_NS); add.addContent(subjects); for (PID sub : added) { subjects.addContent(new Element("pid", CDR_MESSAGE_NS).setText(sub.toString())); } if (reordered != null) { Element reorderedEl = new Element("reordered", CDR_MESSAGE_NS); add.addContent(reorderedEl); for (PID re : reordered) { reorderedEl.addContent(new Element("pid", CDR_MESSAGE_NS).setText(re.toString())); } } Document msg = contentEl.getDocument(); sendMessage(msg); LOG.debug("sent add operation JMS message using JMS template: {}", this.getJmsTemplate()); return getMessageId(msg); }</code><technical_language>I naming of methods in PID class need some revisiting, for cases other logging I suggest getRepositoryPath instead of toString, treated toString part of contract for interact a PID, mocked</technical_language>

Target:
public String sendAddOperation(String userid, Collection<PID> destinations, Collection<PID> added, Collection<PID> reordered, String depositId) { Element contentEl = createAtomEntry(userid, destinations.iterator().next(), CDRActions.ADD); Element add = new Element("add", CDR_MESSAGE_NS); contentEl.addContent(add); if (depositId != null) { add.addContent(new Element("depositId", CDR_MESSAGE_NS).setText(depositId)); } for (PID destination : destinations) { add.addContent(new Element("parent", CDR_MESSAGE_NS).setText(destination.getRepositoryPath())); } Element subjects = new Element("subjects", CDR_MESSAGE_NS); add.addContent(subjects); for (PID sub : added) { subjects.addContent(new Element("pid", CDR_MESSAGE_NS).setText(sub.getRepositoryPath())); } if (reordered != null) { Element reorderedEl = new Element("reordered", CDR_MESSAGE_NS); add.addContent(reorderedEl); for (PID re : reordered) { reorderedEl.addContent(new Element("pid", CDR_MESSAGE_NS).setText(re.getRepositoryPath())); } } Document msg = contentEl.getDocument(); sendMessage(msg); LOG.debug("sent add operation JMS message using JMS template: {}", this.getJmsTemplate()); return getMessageId(msg); }
Source:
<code>public void visit(AssignNode assignNode) { super.visit(assignNode); String var = assignNode.getVariable().getName(); try { VarDeclNode decl = scope.getVarDeclNode(var); if (decl.isMethodVariable()) { mv.visitInsn(DUP); <START> mv.visitVarInsn(ASTORE, 1 + decl.getOffset()); <END> } else if (decl.isClassField()) { System.out.println("Putting field: " + decl.getName()); mv.visitVarInsn(ALOAD, 0); mv.visitFieldInsn(PUTFIELD, ((ClazzNode) decl.getScope().getNode()).getName(), decl.getName(), "Lorg/twnc/runtime/BObject;"); } else { System.out.println("Should not happen?"); } } catch (VariableNotDeclaredException e) { e.printStackTrace(); } }</code><technical_language>This is decl.getOffset() instead of 1 + decl.getOffset() - this is a decl offset 0</technical_language>

Target:
public void visit(AssignNode assignNode) { super.visit(assignNode); String var = assignNode.getVariable().getName(); try { VarDeclNode decl = scope.getVarDeclNode(var); if (decl.isMethodVariable()) { mv.visitInsn(DUP); mv.visitVarInsn(ASTORE, 1 + decl.getOffset()); } else if (decl.isClassField()) { mv.visitVarInsn(ALOAD, 0); mv.visitInsn(SWAP); mv.visitFieldInsn(PUTFIELD, ((ClazzNode) decl.getScope().getNode()).getName(), decl.getName(), "Lorg/twnc/runtime/BObject;"); } else { throw new UnknownVariableDeclarationLocation(); } } catch (VariableNotDeclaredException e) { e.printStackTrace(); } }
Source:
<code>public synchronized int read(byte[] b, int off, int len) throws IOException { if (len == 0) return len; len = (int)getMaxRead(remoteOffset, len); if (len == 0) return -1; try { outStream.write(("READ " + remoteOffset + " " + len + "\r\n").getBytes(Sage.BYTE_CHARSET)); inStream.readFully(b, off, len); <START> outStream.flush(); <END> } catch (IOException e) { reconnect(); outStream.write(("READ " + remoteOffset + " " + len + "\r\n").getBytes(Sage.BYTE_CHARSET)); inStream.readFully(b, off, len); outStream.flush(); } remoteOffset += len; return len; }</code><technical_language>This flush() call 7 lines need moved read stream</technical_language>

Target:
public synchronized int read(byte[] b, int off, int len) throws IOException { if (len == 0) return len; len = (int)getMaxRead(remoteOffset, len); if (len == 0) return -1; try { outStream.write(("READ " + remoteOffset + " " + len + "\r\n").getBytes(Sage.BYTE_CHARSET)); outStream.flush(); inStream.readFully(b, off, len); } catch (IOException e) { reconnect(); outStream.write(("READ " + remoteOffset + " " + len + "\r\n").getBytes(Sage.BYTE_CHARSET)); outStream.flush(); inStream.readFully(b, off, len); } remoteOffset += len; return len; }
Source:
<code>public static void listJobs(String projectId, String location) throws IOException { try (TranscoderServiceClient transcoderServiceClient = TranscoderServiceClient.create()) { var listJobsRequest = ListJobsRequest.newBuilder() .setParent(LocationName.of(projectId, location).toString()) .build(); TranscoderServiceClient.ListJobsPagedResponse response = transcoderServiceClient.listJobs(listJobsRequest); System.out.println("Jobs:"); for (Job jt : response.iterateAll()) { <START> System.out.println(jt); <END> } } }</code><technical_language>ditto Do want print out entire payload name</technical_language>

Target:
public static void listJobs(String projectId, String location) throws IOException { try (TranscoderServiceClient transcoderServiceClient = TranscoderServiceClient.create()) { var listJobsRequest = ListJobsRequest.newBuilder() .setParent(LocationName.of(projectId, location).toString()) .build(); TranscoderServiceClient.ListJobsPagedResponse response = transcoderServiceClient.listJobs(listJobsRequest); System.out.println("Jobs:"); for (Job job : response.iterateAll()) { System.out.println(job.getName()); } } }
Source:
<code>protected void execute() { long lastSend = controller.getLastSend(); <START> logger.info("Check thread current idle ms "+(System.currentTimeMillis() - lastSend)); <END> if ((System.currentTimeMillis() - lastSend) > restartTimeout) { resetTellstick(); } if ((System.currentTimeMillis() - lastRefresh) > updateFromTellstickInterval) { refreshFromTellstick(); } }</code><technical_language>please decrease log level DEBUG</technical_language>

Target:
protected void execute() { long lastSend = controller.getLastSend(); logger.trace("Check thread current idle ms " + (System.currentTimeMillis() - lastSend)); if ((System.currentTimeMillis() - lastSend) > restartTimeout) { resetTellstick(); } if ((System.currentTimeMillis() - lastRefresh) > updateFromTellstickInterval) { refreshFromTellstick(); } }
Source:
<code>public void onAccountChanged(OnAccountChanged event) { if (mAccountStore.hasAccessToken()) { mBottomNav.showNoteBadge(mAccountStore.getAccount().getHasUnseenNotes()); <START> if (AppPrefs.getShouldTrackMagicLinkSignup()) { <END> AccountModel account = mAccountStore.getAccount(); if (!TextUtils.isEmpty(account.getUserName()) && !TextUtils.isEmpty(account.getEmail())) { mLoginAnalyticsListener.trackCreatedAccount(account.getUserName(), account.getEmail()); mLoginAnalyticsListener.trackSignupMagicLinkSucceeded(); AppPrefs.removeShouldTrackMagicLinkSignup(); } } } }</code><technical_language>discussed call, I a good improvement this logic in a helper method. private void trackMagicLinkSignupIfNecessary() { if (AppPrefs.getShouldTrackMagicLinkSignup()) { AccountModel account = mAccountStore.getAccount(); if (!TextUtils.isEmpty(account.getUserName()) && !TextUtils.isEmpty(account.getEmail())) { mLoginAnalyticsListener.trackCreatedAccount(account.getUserName(), account.getEmail()); mLoginAnalyticsListener.trackSignupMagicLinkSucceeded(); AppPrefs.removeShouldTrackMagicLinkSignup(); } } }</technical_language>

Target:
public void onAccountChanged(OnAccountChanged event) { if (mAccountStore.hasAccessToken()) { mBottomNav.showNoteBadge(mAccountStore.getAccount().getHasUnseenNotes()); if (AppPrefs.getShouldTrackMagicLinkSignup()) { trackMagicLinkSignupIfNeeded(); } } }
Source:
<code>public static Map<String, Object> createVmMemoryDeviceMap(VmDevice vmDevice) { Map<String, Object> memDeviceData = new HashMap<>(); memDeviceData.put(VdsProperties.Type, vmDevice.getType().getValue()); memDeviceData.put(VdsProperties.Device, vmDevice.getDevice()); if (StringUtils.isNotBlank(vmDevice.getAddress())) { memDeviceData.put(VdsProperties.Address, StringMapUtils.string2Map(vmDevice.getAddress())); } memDeviceData.put(VdsProperties.SpecParams, vmDevice.getSpecParams()); memDeviceData.put(VdsProperties.DeviceId, vmDevice.getId().getDeviceId().toString()); if <START> (!vmDevice.getAlias().equals("")) { <END> memDeviceData.put(VdsProperties.Alias, vmDevice.getAlias()); } memDeviceData.put("size", VmDeviceCommonUtils.getSizeOfMemoryDeviceMb(vmDevice).orElse(0)); memDeviceData.put("node", VmDeviceCommonUtils.getSpecParamsIntValue(vmDevice, VmDeviceCommonUtils.SPEC_PARAM_NODE) .orElse(0)); return memDeviceData; }</code><technical_language>replacing "isEmpty"? (String#isEmpty)</technical_language>

Target:
public static Map<String, Object> createVmMemoryDeviceMap(VmDevice vmDevice) { Map<String, Object> memDeviceData = new HashMap<>(); memDeviceData.put(VdsProperties.Type, vmDevice.getType().getValue()); memDeviceData.put(VdsProperties.Device, vmDevice.getDevice()); if (StringUtils.isNotBlank(vmDevice.getAddress())) { memDeviceData.put(VdsProperties.Address, StringMapUtils.string2Map(vmDevice.getAddress())); } memDeviceData.put(VdsProperties.SpecParams, vmDevice.getSpecParams()); memDeviceData.put(VdsProperties.DeviceId, vmDevice.getId().getDeviceId().toString()); if (!vmDevice.getAlias().isEmpty()) { memDeviceData.put(VdsProperties.Alias, vmDevice.getAlias()); } memDeviceData.put("size", VmDeviceCommonUtils.getSizeOfMemoryDeviceMb(vmDevice).orElse(0)); memDeviceData.put("node", VmDeviceCommonUtils.getSpecParamsIntValue(vmDevice, VmDeviceCommonUtils.SPEC_PARAM_NODE) .orElse(0)); return memDeviceData; }
Source:
<code>public void testPreserveContentTypeHeader() throws Exception { String proxyServiceUrl = getProxyServiceURLHttp("PreserveContentTypeHeaderCharSetTest"); String requestPayload = "<soapenv:Envelope xmlns:soapenv=\"<LINK_0>\">\n" + " <soapenv:Header/>\n" + " <soapenv:Body>\n" + " <p:getSimpleQuote xmlns:p=\"http://services.samples\">\n" + " <xs:symbol xmlns:xs=\"http://services.samples\">IBM</xs:symbol>\n" + " </p:getSimpleQuote>\n" + " </soapenv:Body>\n" + "</soapenv:Envelope>"; Map<String, String> headers = new HashMap<String, String>(); headers.put("SOAPAction", "urn:mediate"); headers.put("Content-type", "text/xml;charset=UTF-8"); HttpRequestUtil.doPost(new URL(proxyServiceUrl), requestPayload, headers); String wireResponse = wireMonitorServer.getCapturedMessage(); String[] wireResponseList = wireResponse.split(System.lineSeparator()); <START> Assert.assertTrue(wireResponse.contains("Content-Type")); <END> boolean isCharSetPreserved = false; for (String line : wireResponseList) { if (line.contains("Content-Type")) { if (line.contains("text/xml; charset=UTF-8")) { isCharSetPreserved = true; } } } Assert.assertTrue(isCharSetPreserved, "Charset has been dropped from Content-Type header"); }</code><technical_language>a message assert</technical_language>

Target:
public void testPreserveContentTypeHeader() throws Exception { String proxyServiceUrl = getProxyServiceURLHttp("PreserveContentTypeHeaderCharSetTest"); String requestPayload = "<soapenv:Envelope xmlns:soapenv=\"<LINK_0>\">\n" + " <soapenv:Header/>\n" + " <soapenv:Body>\n" + " <p:getSimpleQuote xmlns:p=\"http://services.samples\">\n" + " <xs:symbol xmlns:xs=\"http://services.samples\">IBM</xs:symbol>\n" + " </p:getSimpleQuote>\n" + " </soapenv:Body>\n" + "</soapenv:Envelope>"; Map<String, String> headers = new HashMap<String, String>(); headers.put("SOAPAction", "urn:mediate"); headers.put("Content-type", "text/xml;charset=UTF-8"); HttpRequestUtil.doPost(new URL(proxyServiceUrl), requestPayload, headers); String wireResponse = wireMonitorServer.getCapturedMessage(); String[] wireResponseList = wireResponse.split(System.lineSeparator()); Assert.assertTrue(wireResponse.contains("Content-Type"), "Request to the backend doesn't contain Content-Type header"); boolean isCharSetPreserved = false; for (String line : wireResponseList) { if (line.contains("Content-Type")) { if (line.contains("text/xml; charset=UTF-8")) { isCharSetPreserved = true; } } } Assert.assertTrue(isCharSetPreserved, "Charset has been dropped from Content-Type header"); }
Source:
<code>public long getAgedQueuedFlowSize() { <START> logger.error("Unsupported Function: getQueuedFlowSize() - Retrieving of Aged flows that are " <END> + "waiting in queue"); return 0; }</code><technical_language>get**Aged**QueuedFlowSize() in message</technical_language>

Target:
public long getAgedQueuedFlowSize() { logger.error("Unsupported Function: getAgedQueuedFlowSize() - Retrieving of Aged flows that are" + " waiting in queue"); return 0; }
Source:
<code>public boolean nextKeyValue() throws IOException, InterruptedException { if (currentRecordReader == null) { if (recordReaders.isEmpty()) { return false; } currentRecordReader = recordReaders.remove().createRecordReader(); } while (!currentRecordReader.nextKeyValue()) { if (currentRecordReader != null) { currentRecordReader.close(); } if (recordReaders.isEmpty()) { <START> currentRecordReader = null; <END> return false; } currentRecordReader = recordReaders.remove().createRecordReader(); currentRecordReaderIndex++; setKeyValue(key, value); } return true; }</code><technical_language>minor : setting null done right .close();</technical_language>

Target:
public boolean nextKeyValue() throws IOException, InterruptedException { while (true) { if (currentRecordReader == null && recordReaders.isEmpty()) { return false; } else if (currentRecordReader != null) { if (currentRecordReader.nextKeyValue()) { return true; } currentRecordReader.close(); currentRecordReader = null; } if (recordReaders.isEmpty()) { return false; } currentRecordReader = recordReaders.remove().createRecordReader(); currentRecordReaderIndex++; setKeyValue(key, value); } }
Source:
<code>public Task<AuthResult> then(@NonNull Task<AuthResult> task) throws Exception { mAuthResult = task.getResult(); FirebaseUser firebaseUser = mAuthResult.getUser(); String name = firebaseUser.getDisplayName(); Uri photoUri = firebaseUser.getPhotoUrl(); if (!TextUtils.isEmpty(name) && photoUri != null) { return Tasks.forResult(mAuthResult); } User user = mIdpResponse.getUser(); if (TextUtils.isEmpty(name)) { name = user.getName(); } if (photoUri == null) { photoUri = user.getPhotoUri(); } firebaseUser.updateProfile( new UserProfileChangeRequest.Builder() .setDisplayName(name) .setPhotoUri(photoUri) .build()) .addOnCompleteListener(this) .addOnFailureListener(new TaskFailureLogger(TAG, "Error updating profile")); <START> return mProfileUpdateCompleteTask.getTask(); <END> }</code><technical_language>This pattern is strange. removing TaskCompletionSource doing: java Task<AuthResult> updateTask = firebaseUser.updateProfile(....); updateTask.addOnFailureListener(new TaskFailureLogger(...)); return updateTask; this class implement OnCompleteListener</technical_language>

Target:
public Task<AuthResult> then(@NonNull Task<AuthResult> task) throws Exception { final AuthResult authResult = task.getResult(); FirebaseUser firebaseUser = authResult.getUser(); String name = firebaseUser.getDisplayName(); Uri photoUri = firebaseUser.getPhotoUrl(); if (!TextUtils.isEmpty(name) && photoUri != null) { return Tasks.forResult(authResult); } User user = mIdpResponse.getUser(); if (TextUtils.isEmpty(name)) { name = user.getName(); } if (photoUri == null) { photoUri = user.getPhotoUri(); } return firebaseUser.updateProfile( new UserProfileChangeRequest.Builder() .setDisplayName(name) .setPhotoUri(photoUri) .build()) .addOnFailureListener(new TaskFailureLogger(TAG, "Error updating profile")) .continueWithTask(new Continuation<Void, Task<AuthResult>>() { @Override public Task<AuthResult> then(@NonNull Task<Void> task) throws Exception { return Tasks.forResult(authResult); } }); }
Source:
<code>static String filesystemFriendlyNameOf(ExtensionContext context) { <START> String displayName = context.getDisplayName(); <END> if (isBlank(displayName)) { return UNKNOWN_NAME; } return replaceIllegalCharacters(displayName.trim()); }</code><technical_language>getUniqueId() some escaping (e.g. URL encoded)? human readable unique strings like: [engine:junit-jupiter]/[class:com.example.MyTest]/[test-factory:parameterizedTest()]/[dynamic-test:#3]</technical_language>

Target:
static String filesystemFriendlyNameOf(ExtensionContext context) { String contextId = context.getUniqueId(); try { return (isBlank(contextId)) ? UNKNOWN_NAME : URLEncoder.encode(contextId, UTF_8.toString()); } catch (UnsupportedEncodingException e) { return UNKNOWN_NAME; } }
Source:
<code>public void addCurrentReviewers(ChangeAttribute a, Change change) throws OrmException { <START> a.currentReviewers = Lists.newArrayList(); <END> ArrayList<Object> accountIdlist = Lists.newArrayList(); PatchSet.Id psid = change.currentPatchSetId(); for (PatchSetApproval psa : db.get().patchSetApprovals().byPatchSet(psid)) { Account.Id accountId = psa.getAccountId(); if (!accountIdlist.contains(accountId)) { accountIdlist.add(accountId); a.currentReviewers.add(asAccountAttribute(psa.getAccountId())); } } if (a.currentReviewers.isEmpty()) { a.currentReviewers = null; } }</code><technical_language>create this if necessary (i.e. if reviewers). need cleared line 179</technical_language>

Target:
public void addCurrentReviewers(ChangeAttribute a, Change change) throws OrmException { ResultSet<PatchSetApproval> approvals = db.get().patchSetApprovals().byChange(change.getId()); if (approvals.iterator().hasNext()) { a.currentReviewers = Lists.newArrayList(); ArrayList<Object> accountIdlist = Lists.newArrayList(); for (PatchSetApproval psa : approvals) { Account.Id accountId = psa.getAccountId(); if (!accountIdlist.contains(accountId)) { accountIdlist.add(accountId); a.currentReviewers.add(asAccountAttribute(psa.getAccountId())); } } } }