auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void TestFilterNonAdminOnlyFlowParams() throws IOException, ExecutorManagerException, UserManagerException { final ExecutableFlow flow = createExecutableFlow(); final UserManager manager = TestUtils.createTestXmlUserManager(); final User user = manager.getUser("testUser", "testUser"); <START> Props props = new Props(); <END> HttpRequestUtils.filterAdminOnlyFlowParams(manager, flow.getExecutionOptions(), user, props); Assert.assertFalse(flow.getExecutionOptions().getFlowParameters() .containsKey(ExecutionOptions.FLOW_PRIORITY)); Assert.assertFalse(flow.getExecutionOptions().getFlowParameters() .containsKey(ExecutionOptions.USE_EXECUTOR)); }</code><technical_language>nit: final, applies method below</technical_language>

Target:
public void TestFilterNonAdminOnlyFlowParams() throws IOException, ExecutorManagerException, UserManagerException { final ExecutableFlow flow = createExecutableFlow(); final UserManager manager = TestUtils.createTestXmlUserManager(); final User user = manager.getUser("testUser", "testUser"); final Props props = new Props(); HttpRequestUtils.filterAdminOnlyFlowParams(manager, flow.getExecutionOptions(), user, props); Assert.assertFalse(flow.getExecutionOptions().getFlowParameters() .containsKey(ExecutionOptions.FLOW_PRIORITY)); Assert.assertFalse(flow.getExecutionOptions().getFlowParameters() .containsKey(ExecutionOptions.USE_EXECUTOR)); }
Source:
<code>public void process(StripeNotification notification) { try { var dataObject = objectMapper.readValue(notification.getObject(), DataObject.class); LOGGER.info(String.format("Received an account.updated event for stripe account %s", dataObject.getId()), kv("payouts_enabled", dataObject.isPayoutsEnabled()), kv("requirements", dataObject.getRequirements())); <START> } catch (Exception e) { <END> LOGGER.error("{} notification parsing for source object failed: {}", STRIPE.getName(), e); } }</code><technical_language>this relates a specific gateway account, add a key-value pair for (using LoggingKeys.GATEWAY_ACCOUNT_ID)</technical_language>

Target:
public void process(StripeNotification notification) { try { var dataObject = objectMapper.readValue(notification.getObject(), DataObject.class); LOGGER.info(String.format("Received an account.updated event for stripe account %s", dataObject.getId()), kv("stripe_account_id", dataObject.getId()), kv("payouts_enabled", dataObject.isPayoutsEnabled()), kv("requirements", dataObject.getRequirements())); } catch (Exception e) { LOGGER.error("{} notification parsing for source object failed: {}", STRIPE.getName(), e); } }
Source:
<code>public void flush() { subnet = new ExternalSubnet(); subnet.setName(getName().getEntity()); subnet.setExternalNetwork(getExternalNetwork()); subnet.setCidr(getCidr().getEntity()); subnet.setIpVersion(getIpVersion().getSelectedItem()); subnet.setGateway(getGateway().getEntity()); List<String> dnsServers = new ArrayList<String>(); for (EntityModel<String> dnsServer : getDnsServers().getItems()) { <START> if (dnsServer.getEntity() != null && !dnsServer.getEntity().isEmpty()) { <END> dnsServers.add(dnsServer.getEntity()); } } subnet.setDnsServers(dnsServers); }</code><technical_language>StringHelper.isNullOrEmpty()</technical_language>

Target:
public void flush() { subnet = new ExternalSubnet(); subnet.setName(getName().getEntity()); subnet.setExternalNetwork(getExternalNetwork()); subnet.setCidr(getCidr().getEntity()); subnet.setIpVersion(getIpVersion().getSelectedItem()); subnet.setGateway(getGateway().getEntity()); List<String> dnsServers = new ArrayList<String>(); for (EntityModel<String> dnsServer : getDnsServers().getItems()) { if (StringUtils.isNotEmpty(dnsServer.getEntity())) { dnsServers.add(dnsServer.getEntity()); } } subnet.setDnsServers(dnsServers); }
Source:
<code>public InputStream getInputStream() throws IOException { loadResource(); <START> if (inputStreamDataCache == null) { <END> if (inputStream == null) { throw new IOException(String.format("Tried to get input stream for %s but was null", name)); } inputStreamDataCache = new TemporaryFileBackedOutputStream(32 * 1024); IOUtils.copyLarge(inputStream, inputStreamDataCache); IOUtils.closeQuietly(inputStream); } return inputStreamDataCache.asByteSource().openStream(); }</code><technical_language>I do concurrency concerns dealing 2 attributes updated time initializing inputStreamDataCache is usable. I this method close() synchronized</technical_language>

Target:
public synchronized InputStream getInputStream() throws IOException { if (resourceDataCache == null) { loadResource(); if (inputStream == null) { throw new IOException(String.format("Tried to get input stream for %s but was null", name)); } resourceDataCache = new TemporaryFileBackedOutputStream(FILE_BACKED_OUTPUT_STREAM_THRESHOLD); IOUtils.copyLarge(inputStream, resourceDataCache); IOUtils.closeQuietly(inputStream); streamCloser.register(resourceDataCache); } InputStream newInputStream = resourceDataCache.asByteSource().openStream(); streamCloser.register(newInputStream); return newInputStream; }
Source:
<code>private void assertCorrections_f1fb6b13d57e25be69d1159356655528_afterUpdate() { NationalAppealChamberJudgment judgment = judgmentRepository.findOneBySourceCodeAndSourceJudgmentId( SourceCode.NATIONAL_APPEAL_CHAMBER, "f1fb6b13d57e25be69d1159356655528", NationalAppealChamberJudgment.class); judgment = judgmentRepository.findOneAndInitialize(judgment.getId()); <START> Judge correctedJudge = judgment.getJudge("Adam Jamróz"); <END> List<JudgmentCorrection> judgmentCorrections = judgmentCorrectionRepository.findAllByJudgmentId(judgment.getId()); assertEquals(1, judgmentCorrections.size()); assertTrue(judgmentCorrections.contains( createFor(judgment).update(correctedJudge).property(NAME) .oldValue("sędzia Katarzyna Brzeska").newValue("Katarzyna Brzeska").build())); }</code><technical_language>change judge name "Katarzyna Brzeska"</technical_language>

Target:
private void assertCorrections_f1fb6b13d57e25be69d1159356655528_afterUpdate() { NationalAppealChamberJudgment judgment = judgmentRepository.findOneBySourceCodeAndSourceJudgmentId( SourceCode.NATIONAL_APPEAL_CHAMBER, "f1fb6b13d57e25be69d1159356655528", NationalAppealChamberJudgment.class); judgment = judgmentRepository.findOneAndInitialize(judgment.getId()); Judge correctedJudge = judgment.getJudge("Katarzyna Brzeska"); List<JudgmentCorrection> judgmentCorrections = judgmentCorrectionRepository.findAllByJudgmentId(judgment.getId()); assertEquals(1, judgmentCorrections.size()); assertTrue(judgmentCorrections.contains( createFor(judgment).update(correctedJudge).property(NAME) .oldValue("sędzia Katarzyna Brzeska").newValue("Katarzyna Brzeska").build())); }
Source:
<code>public void testRemoveChildOfRootNode(final int childIndex) { final Node child = rootNode.jjtGetChild(childIndex); assertEquals(NUM_CHILDREN, rootNode.jjtGetNumChildren()); assertEquals(rootNode, child.jjtGetParent()); <START> assertEquals(NUM_GRAND_CHILDREN, child.jjtGetNumChildren()); <END> final Node[] grandChildren = new Node[child.jjtGetNumChildren()]; for (int i = 0; i < grandChildren.length; i++) { final Node grandChild = child.jjtGetChild(i); grandChildren[i] = grandChild; assertEquals(child, grandChild.jjtGetParent()); } child.remove(); assertEquals(NUM_CHILDREN - 1, rootNode.jjtGetNumChildren()); assertNull(child.jjtGetParent()); assertEquals(0, child.jjtGetNumChildren()); for (final Node grandChild : grandChildren) { assertNull(grandChild.jjtGetParent()); } }</code><technical_language>asserts checking tree setup correct? shouldn't, tests should: 1. setup 2. exercise tested behavior (in this case remove()) 3. assert output is expected</technical_language>

Target:
public void testRemoveChildOfRootNode(final int childIndex) { final Node child = rootNode.jjtGetChild(childIndex); final Node[] grandChildren = new Node[child.jjtGetNumChildren()]; for (int i = 0; i < grandChildren.length; i++) { final Node grandChild = child.jjtGetChild(i); grandChildren[i] = grandChild; } child.remove(); assertEquals(NUM_CHILDREN - 1, rootNode.jjtGetNumChildren()); assertNull(child.jjtGetParent()); assertEquals(NUM_GRAND_CHILDREN, child.jjtGetNumChildren()); for (final Node grandChild : grandChildren) { assertEquals(child, grandChild.jjtGetParent()); } }
Source:
<code>private MaterialRevisions fanInOffTriangleDependency(MaterialRevisions originalMaterialRevisions, CruiseConfig cruiseConfig) { <START> LOGGER.debug("[Revision Resolution] Triangle Resolution is active for pipeline " + pipelineName); <END> PipelineConfigDependencyGraph dependencyGraph = goConfigService.upstreamDependencyGraphOf(pipelineName, cruiseConfig); if (hasAnyUnsharedMaterialChanged(dependencyGraph, originalMaterialRevisions) || dependencyGraph.isRevisionsOfSharedMaterialsIgnored(originalMaterialRevisions)) { return pipelineService.getRevisionsBasedOnDependencies(dependencyGraph, originalMaterialRevisions); } return null; }</code><technical_language>change</technical_language>

Target:
private MaterialRevisions fanInOffTriangleDependency(MaterialRevisions originalMaterialRevisions, CruiseConfig cruiseConfig) { LOGGER.debug("[Revision Resolution] Triangle Resolution is active for pipeline {}", pipelineName); PipelineConfigDependencyGraph dependencyGraph = goConfigService.upstreamDependencyGraphOf(pipelineName, cruiseConfig); if (hasAnyUnsharedMaterialChanged(dependencyGraph, originalMaterialRevisions) || dependencyGraph.isRevisionsOfSharedMaterialsIgnored(originalMaterialRevisions)) { return pipelineService.getRevisionsBasedOnDependencies(dependencyGraph, originalMaterialRevisions); } return null; }
Source:
<code>public void detectExposureTo3rdPartyUnquotedHREF() throws HttpMalformedHeaderException, URIException { String testURI = "<LINK_1>"; String body = "<html>\n<body>\n<h2>HTML Links</h2>\n" <START> + "<p><a href=<LINK_2>>Testing ZAP</a>" <END> + "</p>\n" + "</body>\n</html>"; HttpMessage msg = createHttpMessageWithRespBody(body); msg.getRequestHeader().setURI(new URI(testURI, false)); rule.scanHttpRequestSend(msg, -1); assertEquals(2, alertsRaised.size()); }</code><technical_language>Lets other example domain (e.g. www.example.org)</technical_language>

Target:
public void detectExposureTo3rdPartyUnquotedHREF() throws HttpMalformedHeaderException, URIException { String testURI = "<LINK_1>"; String body = "<html>\n<body>\n<h2>HTML Links</h2>\n" + "<p><a href=<LINK_0>>Testing ZAP</a>" + "</p>\n" + "</body>\n</html>"; HttpMessage msg = createHttpMessageWithRespBody(body); msg.getRequestHeader().setURI(new URI(testURI, false)); rule.scanHttpResponseReceive(msg, -1, new Source(body)); assertEquals(2, alertsRaised.size()); }
Source:
<code>public static void main(String[] args) throws RunnerException, IOException { Context context = new Context(); context.setUp(); BenchmarkSpatialJoin benchmark = new BenchmarkSpatialJoin(); benchmark.benchmarkJoin(context); benchmark.benchmarkUserOptimizedJoin(context); Options options = new OptionsBuilder() <START> .verbosity(VerboseMode.NORMAL) <END> .include(".*" + BenchmarkSpatialJoin.class.getSimpleName() + ".*") .build(); new Runner(options).run(); }</code><technical_language>A good trick is do this in a method tagged @Test picked part of unit testing. This helps ensure benchmarks break. BenchmarkArrayJoin.verify() example</technical_language>

Target:
public static void main(String[] args) throws Exception { new BenchmarkSpatialJoin().verify(); Options options = new OptionsBuilder() .verbosity(VerboseMode.NORMAL) .include(".*" + BenchmarkSpatialJoin.class.getSimpleName() + ".*") .build(); new Runner(options).run(); }
Source:
<code>void read() throws IOException { final XMLReader xr; try { xr = XMLReaderFactory.createXMLReader(); } catch (SAXException e) { throw new IOException(JGitText.get().noXMLParserAvailable); } xr.setContentHandler(this); final FileInputStream in = new FileInputStream(filename); try { xr.parse(new InputSource(in)); } catch (SAXException e) { <START> throw new IOException(MessageFormat.format( <END> RepoText.get().errorParsingFromFile, filename), e); } finally { in.close(); } }</code><technical_language>this constructor in Java 5</technical_language>

Target:
void read() throws IOException { final XMLReader xr; try { xr = XMLReaderFactory.createXMLReader(); } catch (SAXException e) { throw new IOException(JGitText.get().noXMLParserAvailable); } xr.setContentHandler(this); final FileInputStream in = new FileInputStream(filename); try { xr.parse(new InputSource(in)); } catch (SAXException e) { IOException error = new IOException(MessageFormat.format( RepoText.get().errorParsingManifestFile, filename)); error.initCause(e); throw error; } finally { in.close(); } }
Source:
<code>private static boolean getSystemProperty(final String name, boolean defaultValue) { final SecurityManager sm = System.getSecurityManager(); String systemProperty; <START> if(sm == null) { <END> systemProperty = System.getProperty(name); } else { systemProperty = AccessController.doPrivileged((PrivilegedAction<String>) () -> System.getProperty(name)); } if (systemProperty == null) { return defaultValue; } else { return Boolean.parseBoolean(systemProperty); } }</code><technical_language>btw do "if (System.getSecurityManager() == null) {" dont need reference</technical_language>

Target:
private static boolean getSystemProperty(final String name, boolean defaultValue) { String systemProperty; if(System.getSecurityManager() == null) { systemProperty = System.getProperty(name); } else { systemProperty = AccessController.doPrivileged((PrivilegedAction<String>) () -> System.getProperty(name)); } if (systemProperty == null) { return defaultValue; } else { return Boolean.parseBoolean(systemProperty); } }
Source:
<code>public static Bind parse(String serialized) { try { String[] parts = serialized.split(":"); switch (parts.length) { case 2: { return new Bind(parts[0], new Volume(parts[1])); } <START> case 4: { <END> parts = new String[]{parts[0] + ":" + parts[1], parts[2], parts[3]}; } case 3: { String[] flags = parts[2].split(","); AccessMode accessMode = AccessMode.DEFAULT; SELContext seMode = SELContext.DEFAULT; Boolean nocopy = null; PropagationMode propagationMode = PropagationMode.DEFAULT_MODE; for (String p : flags) { if (p.length() == 2) { accessMode = AccessMode.valueOf(p.toLowerCase()); } else if ("nocopy".equals(p)) { nocopy = true; } else if (PropagationMode.SHARED.toString().equals(p)) { propagationMode = PropagationMode.SHARED; } else if (PropagationMode.SLAVE.toString().equals(p)) { propagationMode = PropagationMode.SLAVE; } else if (PropagationMode.PRIVATE.toString().equals(p)) { propagationMode = PropagationMode.PRIVATE; } else { seMode = SELContext.fromString(p); } } return new Bind(parts[0], new Volume(parts[1]), accessMode, seMode, nocopy, propagationMode); } default: { throw new IllegalArgumentException(); } } } catch (Exception e) { throw new IllegalArgumentException("Error parsing Bind '" + serialized + "'", e); } }</code><technical_language>please put 3rd case</technical_language>

Target:
public static Bind parse(String serialized) { try { String[] parts = serialized.split(":(?!\\\\)"); switch (parts.length) { case 2: { return new Bind(parts[0], new Volume(parts[1])); } case 3: { String[] flags = parts[2].split(","); AccessMode accessMode = AccessMode.DEFAULT; SELContext seMode = SELContext.DEFAULT; Boolean nocopy = null; PropagationMode propagationMode = PropagationMode.DEFAULT_MODE; for (String p : flags) { if (p.length() == 2) { accessMode = AccessMode.valueOf(p.toLowerCase()); } else if ("nocopy".equals(p)) { nocopy = true; } else if (PropagationMode.SHARED.toString().equals(p)) { propagationMode = PropagationMode.SHARED; } else if (PropagationMode.SLAVE.toString().equals(p)) { propagationMode = PropagationMode.SLAVE; } else if (PropagationMode.PRIVATE.toString().equals(p)) { propagationMode = PropagationMode.PRIVATE; } else { seMode = SELContext.fromString(p); } } return new Bind(parts[0], new Volume(parts[1]), accessMode, seMode, nocopy, propagationMode); } default: { throw new IllegalArgumentException(); } } } catch (Exception e) { throw new IllegalArgumentException("Error parsing Bind '" + serialized + "'", e); } }
Source:
<code>private static final long[] splitRangeIntoEqualParts(long start, long end, int n) { long delta = (end - start); if <START> (delta < 0) { <END> throw new IllegalArgumentException("End value must be greater than start value"); } double stepSize = delta / ((double) n - 1); long[] result = new long[n]; double curTime = start; for (int i = 0; i < n; i++) { result[i] = (long) Math.ceil(curTime); curTime += stepSize; } return result; }</code><technical_language>n >= 0 1 too</technical_language>

Target:
private static final long[] splitRangeIntoEqualParts(long start, long end, int n) { if (n < 1) { throw new IllegalArgumentException("Number of entries must be greater than 1"); } long delta = (end - start); if (delta < 0) { throw new IllegalArgumentException("End value must be greater than start value"); } double stepSize = delta / ((double) n - 1); long[] result = new long[n]; double curTime = start; for (int i = 0; i < n; i++) { result[i] = (long) Math.ceil(curTime); curTime += stepSize; } return result; }
Source:
<code>private void calculateDropoutMetrics(final Collection<GcBiasDetailMetrics> details, final GcBiasSummaryMetrics summary) { double totalReads = 0; double totalWindows = 0; for (final GcBiasDetailMetrics detail : details) { totalReads += detail.READ_STARTS; totalWindows += detail.WINDOWS; } double atDropout = 0; double gcDropout = 0; for (final GcBiasDetailMetrics detail : details) { final double relativeReads = detail.READ_STARTS / totalReads; final double relativeWindows = detail.WINDOWS / totalWindows; final double dropout = (relativeWindows - relativeReads) * 100; if (dropout > 0) { if (detail.GC <= 50) atDropout += dropout; <START> if (detail.GC >= 50) gcDropout += dropout; <END> } } summary.AT_DROPOUT = atDropout; summary.GC_DROPOUT = gcDropout; }</code><technical_language>This if / else</technical_language>

Target:
private void calculateDropoutMetrics(final Collection<GcBiasDetailMetrics> details, final GcBiasSummaryMetrics summary) { double totalReads = 0; double totalWindows = 0; for (final GcBiasDetailMetrics detail : details) { totalReads += detail.READ_STARTS; totalWindows += detail.WINDOWS; } double atDropout = 0; double gcDropout = 0; for (final GcBiasDetailMetrics detail : details) { final double relativeReads = detail.READ_STARTS / totalReads; final double relativeWindows = detail.WINDOWS / totalWindows; final double dropout = (relativeWindows - relativeReads) * 100; if (dropout > 0) { if (detail.GC <= 50) atDropout += dropout; else{ gcDropout += dropout; } } } summary.AT_DROPOUT = atDropout; summary.GC_DROPOUT = gcDropout; }
Source:
<code>public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) { <START> return isInitialized == 1; <END> } if (!hasYear()) { memoizedIsInitialized = 0; return false; } if (!hasMonth()) { memoizedIsInitialized = 0; return false; } if (!hasDayOfMonth()) { memoizedIsInitialized = 0; return false; } if (!hasDayOfWeek()) { memoizedIsInitialized = 0; return false; } if (!hasHour()) { memoizedIsInitialized = 0; return false; } if (!hasMinute()) { memoizedIsInitialized = 0; return false; } if (!hasSecond()) { memoizedIsInitialized = 0; return false; } memoizedIsInitialized = 1; return true; }</code><technical_language>4 spaces</technical_language>

Target:
public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; if (!hasYear()) { memoizedIsInitialized = 0; return false; } if (!hasMonth()) { memoizedIsInitialized = 0; return false; } if (!hasDayOfMonth()) { memoizedIsInitialized = 0; return false; } if (!hasDayOfWeek()) { memoizedIsInitialized = 0; return false; } if (!hasHour()) { memoizedIsInitialized = 0; return false; } if (!hasMinute()) { memoizedIsInitialized = 0; return false; } if (!hasSecond()) { memoizedIsInitialized = 0; return false; } memoizedIsInitialized = 1; return true; }
Source:
<code>public static Slice stSphericalAsText(@SqlType(SPHERICAL_GEOGRAPHY_TYPE_NAME) Slice input) { if (input == null) { <START> return utf8Slice("POINT EMPTY"); <END> } return utf8Slice(wktFromJtsGeometry(deserialize(input))); }</code><technical_language>If input is null, output null. ScalarFunctions do this automatically, @SqlNullable annotation</technical_language>

Target:
public static Slice stSphericalAsText(@SqlType(SPHERICAL_GEOGRAPHY_TYPE_NAME) Slice input) { return utf8Slice(wktFromJtsGeometry(deserialize(input))); }
Source:
<code>public ItemRest patchTemplateItem(Item item, JsonNode jsonNode) throws SQLException, AuthorizeException { ObjectMapper mapper = new ObjectMapper(); JsonPatchConverter patchConverter = new JsonPatchConverter(mapper); Patch patch = patchConverter.convert(jsonNode); <START> ItemRest patchedItemRest = itemPatch.patch(itemConverter.fromModel(item), patch.getOperations()); <END> updateDSpaceObject(item, patchedItemRest); return itemConverter.fromModel(item); }</code><technical_language>is ned for itemPatch variable used, existing dsoPatch variable, this is set in constructor of this repository</technical_language>

Target:
public ItemRest patchTemplateItem(Item item, JsonNode jsonNode) throws SQLException, AuthorizeException { ObjectMapper mapper = new ObjectMapper(); JsonPatchConverter patchConverter = new JsonPatchConverter(mapper); Patch patch = patchConverter.convert(jsonNode); ItemRest patchedItemRest = dsoPatch.patch(converter.toRest(item, Projection.DEFAULT), patch.getOperations()); updateDSpaceObject(item, patchedItemRest); return converter.toRest(item, Projection.DEFAULT); }
Source:
<code>public void deleteTopicFromRegistry(String topicName, String subscriptionId) throws QueueManagerException { try { UserRegistry userRegistry = Utils.getUserRegistry(); String resourcePathForQueue = null; <START> String resourcePathForTopic = null; <END> if (subscriptionId.contains(":")) { resourcePathForQueue = QueueManagementConstants.MB_QUEUE_STORAGE_PATH + "/" + subscriptionId.split(":")[1]; resourcePathForTopic = CommonsUtil.getSubscriptionID(topicName, subscriptionId.split(":")[1]); userRegistry.delete(resourcePathForTopic); userRegistry.delete(resourcePathForQueue); } } catch (RegistryException e) { String message = e.getMessage(); throw new QueueManagerException("Failed to delete topic: " + topicName + " from " + "registry " + message, e); } }</code><technical_language>move declarations if block</technical_language>

Target:
public void deleteTopicFromRegistry(String topicName, String subscriptionId) throws QueueManagerException { try { UserRegistry userRegistry = Utils.getUserRegistry(); if (subscriptionId.contains(":")) { String resourcePathForQueue = null; String resourcePathForTopic = null; resourcePathForQueue = QueueManagementConstants.MB_QUEUE_STORAGE_PATH + "/" + subscriptionId.split(":")[1]; resourcePathForTopic = CommonsUtil.getSubscriptionID(topicName, subscriptionId.split(":")[1]); userRegistry.delete(resourcePathForTopic); userRegistry.delete(resourcePathForQueue); } } catch (RegistryException e) { String message = e.getMessage(); throw new QueueManagerException("Failed to delete topic: " + topicName + " from " + "registry " + message, e); } }
Source:
<code>public QuickAccessElement[] getElements() { if (!allCommandsRetrieved) { ICommandService commandService = getCommandService(); Collection<String> commandIds = commandService.getDefinedCommandIds(); for (String commandId : commandIds) { retrieveCommand(commandId); } allCommandsRetrieved = true; } return <START> idToCommand.values().toArray( <END> new QuickAccessElement[idToCommand.values().size()]); }</code><technical_language>please guard map for concurrent access. Iterator in values() call cry if map is changed ifrom another thread, in retrieveCommand (which IS called threads)</technical_language>

Target:
public QuickAccessElement[] getElements() { if (!allCommandsRetrieved) { ICommandService commandService = getCommandService(); Collection<String> commandIds = commandService.getDefinedCommandIds(); for (String commandId : commandIds) { retrieveCommand(commandId); } allCommandsRetrieved = true; } return idToCommand.values().stream().toArray(QuickAccessElement[]::new); }
Source:
<code>public void detachView() { super.detachView(); <START> mSubscriptions.unsubscribe(); <END> }</code><technical_language>@mayank-kgp mSubscriptions.clear()</technical_language>

Target:
public void detachView() { super.detachView(); mSubscriptions.clear(); }
Source:
<code>public void processLockRelease() { log.debug("Lock released"); isLeader.set(false); stopLogReplication(); interClusterReplicationService.getLogReplicationServer().setLeadership(false); <START> recordLockRelease(lockAcquireSample); <END> }</code><technical_language>need pass lockAcquireSample, right? a class level variable</technical_language>

Target:
public void processLockRelease() { log.debug("Lock released"); isLeader.set(false); stopLogReplication(); interClusterReplicationService.getLogReplicationServer().setLeadership(false); recordLockRelease(); }
Source:
<code>String value() default ""; EmptyHandling onEmpty() default EmptyHandling.THROW; enum EmptyHandling { VOID, NULL, THROW, <START> EMPTY_LIST <END> }</code><technical_language>Is a reason define empty list? useful behavior original suggestion of defining a (Java, String) null? skipping define entirely..</technical_language>

Target:
String value() default ""; EmptyHandling onEmpty() default EmptyHandling.THROW; enum EmptyHandling { VOID((stmt, name) -> stmt.define(name, "")), @Deprecated NULL((stmt, name) -> stmt.define(name, "null")), NULL_STRING((stmt, name) -> stmt.define(name, "null")), NULL_VALUE((stmt, name) -> stmt.define(name, null)), THROW((stmt, name) -> { throw new IllegalArgumentException("argument is null or empty; this was explicitly forbidden on this instance of BindList"); }); private final BiConsumer<SqlStatement, String> rendering; EmptyHandling(BiConsumer<SqlStatement, String> rendering) { this.rendering = rendering; } public void define(SqlStatement stmt, String name) { rendering.accept(stmt, name); } }
Source:
<code>public void testOverriddenExtendedNestedClass() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(FinalClassCheck.class); <START> final String[] expected = {}; <END> verify(checkConfig, getPath("InputFinalClassExtendedOverriddenNested.java"), expected); }</code><technical_language>CommonUtils.EMPTY_STRING_ARRAY</technical_language>

Target:
public void testOverriddenExtendedNestedClass() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(FinalClassCheck.class); verify(checkConfig, getPath("InputFinalClassExtendedOverriddenNested.java"), EMPTY_STRING_ARRAY); }
Source:
<code>public OpenIDServerAssociationStore(String associationsType) { try { SecureRandom secureRandom = SecureRandom.getInstance(SHA_1_PRNG); storeId = secureRandom.nextInt(9999); } catch (NoSuchAlgorithmException e) { if (log.isDebugEnabled()) { <START> log.debug(e.getMessage(), e); <END> } } timestamp = Long.toString(new Date().getTime()); counter = 0; cache = OpenIDAssociationCache.getCacheInstance(); dao = new OpenIDAssociationDAO(associationsType); }</code><technical_language>Instead of e.getMessage() add a meaningful message. Ex: 'Ignoring NoSuchAlgorithmException'</technical_language>

Target:
public OpenIDServerAssociationStore(String associationsType) { try { SecureRandom secureRandom = SecureRandom.getInstance(SHA_1_PRNG); storeId = secureRandom.nextInt(9999); } catch (NoSuchAlgorithmException e) { throw new RuntimeException("SHA1PRNG algorithm could not be found."); } timestamp = Long.toString(new Date().getTime()); counter = 0; cache = OpenIDAssociationCache.getCacheInstance(); dao = OpenIDAssociationDAO.getInstance(associationsType); }
Source:
<code>private <R> CompletionStage<PublisherResult<R>> handleSpecificEntries(boolean parallelPublisher, Set<K> keysToInclude, Set<K> keysToExclude, DeliveryGuarantee deliveryGuarantee, Function<? super Publisher<CacheEntry<K, V>>, ? extends CompletionStage<R>> collator, Function<? super Publisher<R>, ? extends CompletionStage<R>> finalizer) { AdvancedCache<K, V> cache = deliveryGuarantee == DeliveryGuarantee.AT_MOST_ONCE ? this.cache : remoteCache; return handleSpecificObjects(parallelPublisher, keysToInclude, keysToExclude, keyFlowable -> keyFlowable.concatMapMaybe(k -> { CompletableFuture<CacheEntry<K, V>> future = cache.getCacheEntryAsync(k); future.thenApply(entry -> { if (entry instanceof MVCCEntry) { entry = new ImmortalCacheEntry(entry.getKey(), entry.getValue()); } return entry; }); <START> return RxJavaInterop.completionStageToMaybe(future); <END> }).filter(e -> e != NullCacheEntry.getInstance()) , collator, finalizer); }</code><technical_language>need pass CompletableFuture returned thenApply RxJavaInterop.completionStageToMaybe</technical_language>

Target:
private <R> CompletionStage<PublisherResult<R>> handleSpecificEntries(boolean parallelPublisher, Set<K> keysToInclude, Set<K> keysToExclude, DeliveryGuarantee deliveryGuarantee, Function<? super Publisher<CacheEntry<K, V>>, ? extends CompletionStage<R>> collator, Function<? super Publisher<R>, ? extends CompletionStage<R>> finalizer) { AdvancedCache<K, V> cache = deliveryGuarantee == DeliveryGuarantee.AT_MOST_ONCE ? this.cache : remoteCache; return handleSpecificObjects(parallelPublisher, keysToInclude, keysToExclude, keyFlowable -> keyFlowable.concatMapMaybe(k -> { CompletableFuture<CacheEntry<K, V>> future = cache.getCacheEntryAsync(k); future = future.thenApply(entry -> { if (entry instanceof MVCCEntry) { entry = new ImmortalCacheEntry(entry.getKey(), entry.getValue()); } return entry; }); return RxJavaInterop.completionStageToMaybe(future); }).filter(e -> e != NullCacheEntry.getInstance()) , collator, finalizer); }
Source:
<code>public void dispose() { if (fLaunch != null && fLaunch.canTerminate() && !isTerminating) { isTerminating = true; try { fLaunch.terminate(); } catch (DebugException e) { <START> GdbTraceCorePlugin.logError(GDB_EXCEPTION, <END> e); } fLaunch = null; } }</code><technical_language>e.getMessage()</technical_language>

Target:
public void dispose() { if (fLaunch != null && fLaunch.canTerminate() && !isTerminating) { isTerminating = true; try { fLaunch.terminate(); } catch (DebugException e) { GdbTraceCorePlugin.logError(e.getMessage(), e); } fLaunch = null; } }
Source:
<code>static Map<String, Set<String>> findIslands(final Map<String, List<Polygon>> polygons) { final Set<String> seaTerritories = filterSeaTerritories(polygons.keySet()); final Set<String> landTerritories = filterNotSeaTerritories(polygons.keySet()); return seaTerritories.stream() .collect( <START> Collectors.toMap(sea -> sea, findIslandsForSeaTerritory(landTerritories, polygons))); <END> }</code><technical_language>Function.identity() work here</technical_language>

Target:
static Map<String, Set<String>> findIslands(final Map<String, List<Polygon>> polygons) { final Set<String> seaTerritories = filterSeaTerritories(polygons.keySet()); final Set<String> landTerritories = filterNotSeaTerritories(polygons.keySet()); return seaTerritories.stream() .collect( Collectors.toMap( Function.identity(), findIslandsForSeaTerritory(landTerritories, polygons))); }
Source:
<code>public SortedSet<String> getRequestedProjects() { if (requestedProjects == null) { requestedProjects <START> = getRequestedProjects("project", "group", OPEN_GROK_PROJECT); <END> } return requestedProjects; }</code><technical_language>define "group" this final static string</technical_language>

Target:
public SortedSet<String> getRequestedProjects() { if (requestedProjects == null) { requestedProjects = getRequestedProjects(PROJECT_PARAM_NAME, GROUP_PARAM_NAME, OPEN_GROK_PROJECT); } return requestedProjects; }
Source:
<code>public CantAttackUnlessPaysAttachedEffect(ManaCosts manaCosts, AttachmentType attachmentType) { <START> super(Duration.WhileOnBattlefield, Outcome.Detriment, RestrictType.ATTACK_AND_BLOCK, manaCosts); <END> staticText = (attachmentType.equals(AttachmentType.AURA) ? "Enchanted " : "Equipped ") + "creature can't attack unless its controller pays " + (manaCosts == null ? "" : manaCosts.getText()); }</code><technical_language>restrict type RestrictType.ATTACK</technical_language>

Target:
public CantAttackUnlessPaysAttachedEffect(ManaCosts manaCosts, AttachmentType attachmentType) { super(Duration.WhileOnBattlefield, Outcome.Detriment, RestrictType.ATTACK, manaCosts); staticText = (attachmentType.equals(AttachmentType.AURA) ? "Enchanted " : "Equipped ") + "creature can't attack unless its controller pays " + (manaCosts == null ? "" : manaCosts.getText()); }
Source:
<code>private boolean cleanPrivateStorage() { cleanPrivateFiles("Images"); cleanPrivateFiles("Videos"); cleanPrivateFiles("Files"); <START> cleanPrivateFiles("Recordings"); <END> return true; }</code><technical_language>moving strings Images, Videos, Files Records a static List iterating it</technical_language>

Target:
private boolean cleanPrivateStorage() { for(String type : Arrays.asList("Images", "Videos", "Files", "Recordings")) { cleanPrivateFiles(type); } return true; }
Source:
<code>protected void map(NullWritable key, ViewInfoTracker value, Context context) { final Configuration config = context.getConfiguration(); if (this.multiViewJobStatusTracker == null) { initMultiViewJobStatusTracker(config); } <START> LOGGER.debug(String.format("Deleting from view %s, TenantID %s, and TTL value: %d", <END> value.getViewName(), value.getTenantId(), value.getViewTtl())); try (PhoenixConnection connection =(PhoenixConnection) ConnectionUtil.getInputConnection(config) ){ if (value.getTenantId() != null && !value.getTenantId().equals("NULL")) { try (PhoenixConnection tenantConnection = (PhoenixConnection)PhoenixViewTtlUtil. buildTenantConnection(connection.getURL(), value.getTenantId())) { deletingExpiredRows(tenantConnection, value, config); } } else { deletingExpiredRows(connection, value, config); } } catch (SQLException e) { LOGGER.error("Mapper got an exception while deleting expired rows : " + e.getErrorCode() + e.getSQLState(), e.getStackTrace()); } }</code><technical_language>log debug level if debug level enabled</technical_language>

Target:
protected void map(NullWritable key, ViewInfoTracker value, Context context) throws IOException { try { final Configuration config = context.getConfiguration(); if (this.multiViewJobStatusTracker == null) { initMultiViewJobStatusTracker(config); } LOGGER.debug(String.format("Deleting from view %s, TenantID %s, and TTL value: %d", value.getViewName(), value.getTenantId(), value.getViewTtl())); try (PhoenixConnection connection = (PhoenixConnection) ConnectionUtil.getInputConnection(config)) { if (value.getTenantId() != null && !value.getTenantId().equals("NULL")) { try (PhoenixConnection tenantConnection = (PhoenixConnection) PhoenixMultiInputUtil. buildTenantConnection(connection.getURL(), value.getTenantId())) { deletingExpiredRows(tenantConnection, value, config); } } else { deletingExpiredRows(connection, value, config); } } } catch (SQLException e) { LOGGER.error("Mapper got an exception while deleting expired rows : " + e.getMessage() ); throw new IOException(e.getMessage(), e.getCause()); } catch (Exception e) { LOGGER.error("Getting IOException while running View TTL Deletion Job mapper with error : " + e.getMessage()); throw new IOException(e.getMessage(), e.getCause()); } }
Source:
<code>public ArrayDefinition createDefinition(IDefinitionScope definitionScope, @NonNull String fieldName, BitBuffer input) throws CTFReaderException { alignRead(input); <START> if(isString()){ <END> byte[] data = new byte[fLength]; input.get(data); return new FixedStringDefintion(this, definitionScope, fieldName, new String(data)); } List<Definition> definitions = read(input, definitionScope, fieldName); return new CompoundDefinition(this, definitionScope, fieldName, definitions); }</code><technical_language>spacing</technical_language>

Target:
public ArrayDefinition createDefinition(IDefinitionScope definitionScope, @NonNull String fieldName, BitBuffer input) throws CTFReaderException { alignRead(input); if(isString()){ byte[] data = new byte[fLength]; input.get(data); return new FixedStringDefinition(this, definitionScope, fieldName, new String(data)); } List<Definition> definitions = read(input, definitionScope, fieldName); return new CompoundDefinition(this, definitionScope, fieldName, definitions); }
Source:
<code>public void onDeleteListConfirmed(int position) { dataSource.deleteList(nameListsAdapter.getItem(position)); preferencesManager.removeNameList(nameListsAdapter.getItem(position)); nameListsAdapter.deleteItem(position); <START> nameListsAdapter.notifyItemRemoved(position); <END> setNoContent(); }</code><technical_language>nit: feedback above. absorb notifyItemRemoved deleteItem() implementation</technical_language>

Target:
public void onDeleteListConfirmed(int position) { dataSource.deleteList(nameListsAdapter.getItem(position)); preferencesManager.removeNameList(nameListsAdapter.getItem(position)); nameListsAdapter.deleteItem(position); }
Source:
<code>public void close() throws IOException, TimeoutException { try { delegate.close(); } finally { <START> recoveryCleanup(); <END> } }</code><technical_language>Is this change related delay calculation back-off</technical_language>

Target:
public void close() throws IOException, TimeoutException { try { delegate.close(); } finally { for (String consumerTag : consumerTags) { this.connection.deleteRecordedConsumer(consumerTag); } this.connection.unregisterChannel(this); } }
Source:
<code>public void onCompletion(RecordMetadata md, Exception e) { if ( e != null ) { e.printStackTrace(); } else { try { if ( LOGGER.isDebugEnabled()) { LOGGER.debug("-> " + md.topic() + ":" + md.offset()); <START> LOGGER.debug(" partition:" + md.partition()); <END> LOGGER.debug(" " + event.toJSON()); LOGGER.debug(" " + event.getNextBinlogPosition()); LOGGER.debug(""); } config.setInitialPosition(event.getNextBinlogPosition()); } catch (IOException | SQLException e1) { e1.printStackTrace(); } } }</code><technical_language>moved line above</technical_language>

Target:
public void onCompletion(RecordMetadata md, Exception e) { if ( e != null ) { e.printStackTrace(); } else { try { if ( LOGGER.isDebugEnabled()) { LOGGER.debug("-> topic:" + md.topic() + ", partition:" +md.partition() + ", offset:" + md.offset()); LOGGER.debug(" " + event.toJSON()); LOGGER.debug(" " + event.getNextBinlogPosition()); LOGGER.debug(""); } config.setInitialPosition(event.getNextBinlogPosition()); } catch (IOException | SQLException e1) { e1.printStackTrace(); } } }
Source:
<code>public Persister<Message>[] getPersister() { <START> return new Persister[]{OpenWireMessagePersister.getInstance()}; <END> }</code><technical_language>Cache if instead of allocating time</technical_language>

Target:
public Persister<Message>[] getPersister() { return OPENWIRE_MESSAGE_PERSISTER; }
Source:
<code>public void withdrawConsentRemovesDataGroups() throws Exception { account.setConsentSignatureHistory(SUBPOP_GUID, ImmutableList.of(CONSENT_SIGNATURE)); when(subpopulation.getDataGroupsAssignedWhileConsented()).thenReturn(TestConstants.USER_DATA_GROUPS); when(subpopService.getSubpopulation(study.getStudyIdentifier(), SUBPOP_GUID)).thenReturn(subpopulation); <START> when(accountDao.getAccount(any())).thenReturn(account); <END> consentService.withdrawConsent(study, SUBPOP_GUID, PARTICIPANT, CONTEXT, WITHDRAWAL, WITHDREW_ON); assertTrue(account.getDataGroups().isEmpty()); verify(subpopulation).getDataGroupsAssignedWhileConsented(); verify(subpopulation, never()).getSubstudyIdsAssignedOnConsent(); }</code><technical_language>account start data groups in question (and a extra ones), verify are, in fact, removed. Similarly for withdrawFromStudyRemovesDataGroups()</technical_language>

Target:
public void withdrawConsentRemovesDataGroups() throws Exception { Set<String> dataGroups = Sets.newHashSet(TestConstants.USER_DATA_GROUPS); dataGroups.add("leaveBehind1"); dataGroups.add("leaveBehind2"); account.setConsentSignatureHistory(SUBPOP_GUID, ImmutableList.of(CONSENT_SIGNATURE)); account.setDataGroups(dataGroups); when(subpopulation.getDataGroupsAssignedWhileConsented()).thenReturn(TestConstants.USER_DATA_GROUPS); when(subpopService.getSubpopulation(study.getStudyIdentifier(), SUBPOP_GUID)).thenReturn(subpopulation); when(accountDao.getAccount(any())).thenReturn(account); consentService.withdrawConsent(study, SUBPOP_GUID, PARTICIPANT, CONTEXT, WITHDRAWAL, WITHDREW_ON); assertEquals(ImmutableSet.of("leaveBehind1", "leaveBehind2"), account.getDataGroups()); verify(subpopulation).getDataGroupsAssignedWhileConsented(); verify(subpopulation, never()).getSubstudyIdsAssignedOnConsent(); }
Source:
<code>public void testAddFieldThrowsWhenInitialized() throws Exception { assertThrows(IllegalStateException.class, () -> { StructField mapEntryStructField = new StructField("entry", 5); mapEntryStructField.addField(new StringField("key", 1)); mapEntryStructField.init(); <START> mapEntryStructField.addField(new StringField("val", 2)); <END> }); }</code><technical_language>this line in assertThrows</technical_language>

Target:
public void testAddFieldThrowsWhenInitialized() throws Exception { StructField mapEntryStructField = new StructField("entry", 5); mapEntryStructField.addField(new StringField("key", 1)); mapEntryStructField.init(); assertThrows(IllegalStateException.class, () -> { mapEntryStructField.addField(new StringField("val", 2)); }); }
Source:
<code>public void close() { if(closed.getAndSet(true)){ return; } NettyClientBase client = null; try { client = manager.getConnection(getTajoMasterAddr(), TajoMasterClientProtocol.class, false); TajoMasterClientProtocolService.BlockingInterface tajoMaster = client.getStub(); tajoMaster.removeSession(null, sessionId); } catch (Throwable e) { } finally { <START> manager.cleanup(client); <END> } }</code><technical_language>This is a static function</technical_language>

Target:
public void close() { if(closed.getAndSet(true)){ return; } NettyClientBase client = null; try { client = manager.getClient(getTajoMasterAddr(), TajoMasterClientProtocol.class, false); TajoMasterClientProtocolService.BlockingInterface tajoMaster = client.getStub(); tajoMaster.removeSession(null, sessionId); } catch (Throwable e) { } finally { RpcClientManager.cleanup(client); } }
Source:
<code>public void endVisitByUuid(String uuid, Visit visit, DefaultVisitsCallback callbackListener) { restApi.endVisitByUUID(uuid, visit).enqueue(new Callback<Visit>() { @Override public void onResponse(@NonNull Call<Visit> call, @NonNull Response<Visit> response) { if (response.isSuccessful()) { <START> if (callbackListener != null) { <END> callbackListener.onSuccess(response.body().getStopDatetime()); } } else { if (callbackListener != null) { callbackListener.onFailure(response.message()); } } } @Override public void onFailure(@NonNull Call<Visit> call, @NonNull Throwable t) { if (callbackListener != null) { callbackListener.onFailure(t.getMessage()); } } }); }</code><technical_language>Move this condition up, response.isSuccessful() condition nested. check if callbackListener is null return error message</technical_language>

Target:
public void endVisitByUuid(String uuid, Visit visit, DefaultVisitsCallback callbackListener) { restApi.endVisitByUUID(uuid, visit).enqueue(new Callback<Visit>() { @Override public void onResponse(@NonNull Call<Visit> call, @NonNull Response<Visit> response) { if (callbackListener != null) { if (response.isSuccessful()) { callbackListener.onSuccess(response.body().getStopDatetime()); } else { callbackListener.onFailure(response.message()); } } } @Override public void onFailure(@NonNull Call<Visit> call, @NonNull Throwable t) { if (callbackListener != null) { callbackListener.onFailure(t.getMessage()); } } }); }
Source:
<code>public SubnetworkList getSubnetworkList(Region region, Compute compute, String projectId, List<String> subnetIds, String sharedProjectId) throws IOException { <START> SubnetworkList subnetworkList; if (subnetIds != null && subnetIds.isEmpty()) { subnetworkList = compute.subnetworks() .list(projectId, region.value()).execute(); } else { if (!Strings.isNullOrEmpty(sharedProjectId)) { subnetworkList = new SubnetworkList().setItems(new ArrayList<>()); for (String subnetId : subnetIds) { Subnetwork subnetwork = compute.subnetworks().get(sharedProjectId, region.value(), subnetId).execute(); subnetworkList.getItems().add(subnetwork); } } else { subnetworkList = new SubnetworkList().setItems(new ArrayList<>()); for (String subnetId : subnetIds) { Subnetwork subnetwork = compute.subnetworks().get(projectId, region.value(), subnetId).execute(); subnetworkList.getItems().add(subnetwork); } } } return subnetworkList; <END> }</code><technical_language>this a bit complicated simplified. instead of query subnet list filter result. private SubnetworkList getSubnetworkList(Region region, Compute compute, String projectId, List<String> subnetIds, String sharedProjectId) throws IOException { String projectIdToQuery = StringUtils.isNotBlank(sharedProjectId) ? sharedProjectId : projectId; SubnetworkList subnetworkList = compute.subnetworks().list(projectIdToQuery, region.value()).execute(); if (subnetIds.isEmpty()) { return subnetworkList; } else { List<Subnetwork> filteredSubnets = subnetworkList.getItems().stream() .filter(subnetwork -> subnetIds.contains(subnetwork.getName())) .collect(Collectors.toList()); return new SubnetworkList().setItems(filteredSubnets); } }</technical_language>

Target:
private SubnetworkList getSubnetworkList(Region region, Compute compute, String projectId, List<String> subnetIds, String sharedProjectId) throws IOException { SubnetworkList subnetworkList; validateSubnetRequest(subnetIds, sharedProjectId); if (subnetIds.isEmpty()) { subnetworkList = compute.subnetworks().list(projectId, region.value()).execute(); } else { String tmpProjectId = !Strings.isNullOrEmpty(sharedProjectId) ? sharedProjectId : projectId; subnetworkList = new SubnetworkList().setItems(new ArrayList<>()); for (String subnetId : subnetIds) { Subnetwork subnetwork = compute.subnetworks().get(tmpProjectId, region.value(), subnetId).execute(); subnetworkList.getItems().add(subnetwork); } } return subnetworkList; }
Source:
<code>public Predicate createPredicateAndJoin(String filterString, Root<T> root) { LogicalOperatorRulesLexer lexer = new LogicalOperatorRulesLexer(new ANTLRInputStream(filterString)); LogicalOperatorRulesParser parser = new LogicalOperatorRulesParser(new CommonTokenStream(lexer)); parser.addErrorListener(new OsiamAntlrErrorListener()); ParseTree tree = parser.parse(); EvalVisitor<T> visitor = new EvalVisitor<>(this, root); <START> return (Predicate) visitor.visit(tree); <END> }</code><technical_language>Is this cast necessary</technical_language>

Target:
public Predicate createPredicateAndJoin(String filterString, Root<T> root) { LogicalOperatorRulesLexer lexer = new LogicalOperatorRulesLexer(new ANTLRInputStream(filterString)); LogicalOperatorRulesParser parser = new LogicalOperatorRulesParser(new CommonTokenStream(lexer)); parser.addErrorListener(new OsiamAntlrErrorListener()); ParseTree tree = parser.parse(); EvalVisitor<T> visitor = new EvalVisitor<>(this, root); return visitor.visit(tree); }
Source:
<code><START> public void testDeleteNic() { <END> nicApi().deleteNic(testNic.dataCenterId(), testServer.id(), testNic.id()); assertNicRemoved(testNic); }</code><technical_language>able test this if update test fails</technical_language>

Target:
public void testDeleteNic() { nicApi().delete(testNic.dataCenterId(), testServer.id(), testNic.id()); assertNicRemoved(testNic); }