auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void process(VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoid) throws AffinityConflictException { VirtualMachine vm = vmProfile.getVirtualMachine(); List<AffinityGroupVMMapVO> vmGroupMappings = _affinityGroupVMMapDao.findByVmIdType(vm.getId(), getType()); for (AffinityGroupVMMapVO vmGroupMapping : vmGroupMappings) { if (vmGroupMapping != null) { AffinityGroupVO group = _affinityGroupDao.findById(vmGroupMapping.getAffinityGroupId()); <START> if (s_logger.isDebugEnabled()) { <END> s_logger.debug("Processing affinity group " + group.getName() + " for VM Id: " + vm.getId()); } List<Long> groupVMIds = _affinityGroupVMMapDao.listVmIdsByAffinityGroup(group.getId()); groupVMIds.remove(vm.getId()); Set<Long> hostIds = new HashSet<>(); for (Long groupVMId : groupVMIds) { VMInstanceVO groupVM = _vmInstanceDao.findById(groupVMId); hostIds.add(groupVM.getHostId()); } List<Long> preferredHostIds = new ArrayList<>(); preferredHostIds.addAll(hostIds); plan.setPreferredHosts(preferredHostIds); } } }</code><technical_language>nested functionality well</technical_language>

Target:
public void process(VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoid) throws AffinityConflictException { VirtualMachine vm = vmProfile.getVirtualMachine(); List<AffinityGroupVMMapVO> vmGroupMappings = _affinityGroupVMMapDao.findByVmIdType(vm.getId(), getType()); if (CollectionUtils.isNotEmpty(vmGroupMappings)) { for (AffinityGroupVMMapVO vmGroupMapping : vmGroupMappings) { processAffinityGroup(vmGroupMapping, plan, vm); } } }
Source:
<code>public Span getSpan(String tenantId, String id) { GetResponse response = null; try { response = client.getClient() .prepareGet(client.getIndex(tenantId), SPAN_TYPE, id) .setRouting(id) .execute() .actionGet(); } catch (IndexMissingException ex) { log.errorf("Missing span index %s", tenantId); return null; } Span span = null; if (!response.isSourceEmpty()) { try { span = deserialize(response.getSourceAsString(), Span.class); if (span.serverSpan() && span.url() == null) { Span clientSpan = getSpan(tenantId, SpanUniqueIdGenerator.getClientId(span.getId())); <START> List<BinaryAnnotation> binaryAnnotations = new ArrayList<>(clientSpan.getBinaryAnnotations()); <END> binaryAnnotations.addAll(span.getBinaryAnnotations()); span = new Span(binaryAnnotations, span.getAnnotations()); } } catch (IOException ex) { log.errorFailedToParse(ex); } } log.tracef("Get span with id[%s] is: %s", id, span); return span; }</code><technical_language>if clientSpan is null? (i.e. client span is found) Copying binary annotations client span issue, misleading for resulting server span. alternative 'set' URL server span (i.e. override potentially derived)</technical_language>

Target:
public Span getSpan(String tenantId, String id) { GetResponse response = null; try { response = client.getClient() .prepareGet(client.getIndex(tenantId), SPAN_TYPE, id) .setRouting(id) .execute() .actionGet(); } catch (IndexMissingException ex) { log.errorf("Missing span index %s", tenantId); return null; } Span span = null; if (!response.isSourceEmpty()) { try { span = deserialize(response.getSourceAsString(), Span.class); if (span.serverSpan() && span.url() == null) { Span clientSpan = getSpan(tenantId, SpanUniqueIdGenerator.getClientId(span.getId())); if (clientSpan != null && clientSpan.url() != null) { BinaryAnnotation httpURLAnnotation = new BinaryAnnotation(); httpURLAnnotation.setKey(Constants.ZIPKIN_BIN_ANNOTATION_HTTP_URL); httpURLAnnotation.setValue(clientSpan.url().toString()); List<BinaryAnnotation> binaryAnnotationsWithURL = new ArrayList<>(span.getBinaryAnnotations()); binaryAnnotationsWithURL.add(httpURLAnnotation); span = new Span(span, binaryAnnotationsWithURL, span.getAnnotations()); } } } catch (IOException ex) { log.errorFailedToParse(ex); } } log.tracef("Get span with id[%s] is: %s", id, span); return span; }
Source:
<code>public static LocalCacheManager create(AlluxioConfiguration conf) throws IOException { MetaStore metaStore = MetaStore.create(); CacheEvictor evictor = CacheEvictor.create(conf); PageStore pageStore = PageStore.create(conf); try { Collection<PageInfo> pageInfos = pageStore.getPages(); <START> LOG.info("Loading existing pages", pageInfos.size()); <END> for (PageInfo pageInfo : pageInfos) { PageId pageId = pageInfo.getPageId(); metaStore.addPage(pageId, pageInfo); evictor.updateOnPut(pageId); } return new LocalCacheManager(conf, metaStore, pageStore, evictor); } catch (Exception e) { try { pageStore.close(); } catch (Exception ex) { e.addSuppressed(ex); } throw new IOException("failed to create local cache manager", e); } }</code><technical_language>this "Creating LocalCacheManager existing pages"</technical_language>

Target:
public static LocalCacheManager create(AlluxioConfiguration conf) throws IOException { MetaStore metaStore = MetaStore.create(); CacheEvictor evictor = CacheEvictor.create(conf); PageStore pageStore = PageStore.create(conf); try { Collection<PageInfo> pageInfos = pageStore.getPages(); LOG.info("Creating LocalCacheManager with existing pages", pageInfos.size()); for (PageInfo pageInfo : pageInfos) { PageId pageId = pageInfo.getPageId(); metaStore.addPage(pageId, pageInfo); evictor.updateOnPut(pageId); } return new LocalCacheManager(conf, metaStore, pageStore, evictor); } catch (Exception e) { try { pageStore.close(); } catch (Exception ex) { e.addSuppressed(ex); } throw new IOException("failed to create local cache manager", e); } }
Source:
<code>private static void createOrDropTrigger(Connection conn, String schema, String table, boolean create) throws SQLException { try (Statement stat = conn.createStatement()) { String trigger = StringUtils.quoteIdentifier(schema) + "." + StringUtils.quoteIdentifier(TRIGGER_PREFIX + table); stat.execute("DROP TRIGGER IF EXISTS " + trigger); if (create) { <START> ResultSet rs = stat.executeQuery("SELECT value FROM information_schema.settings WHERE name = 'MV_STORE'"); <END> boolean multiThread = FullTextTrigger.isMultiThread(conn); StringBuilder buff = new StringBuilder("CREATE TRIGGER IF NOT EXISTS "); buff.append(trigger). append(" AFTER INSERT, UPDATE, DELETE"); if(!multiThread) { buff.append(", ROLLBACK"); } buff.append(" ON "). append(StringUtils.quoteIdentifier(schema)). append('.'). append(StringUtils.quoteIdentifier(table)). append(" FOR EACH ROW CALL \""). append(FullText.FullTextTrigger.class.getName()). append('\"'); stat.execute(buff.toString()); } } }</code><technical_language>leftover</technical_language>

Target:
private static void createOrDropTrigger(Connection conn, String schema, String table, boolean create) throws SQLException { try (Statement stat = conn.createStatement()) { String trigger = StringUtils.quoteIdentifier(schema) + "." + StringUtils.quoteIdentifier(TRIGGER_PREFIX + table); stat.execute("DROP TRIGGER IF EXISTS " + trigger); if (create) { boolean multiThread = FullTextTrigger.isMultiThread(conn); StringBuilder buff = new StringBuilder( "CREATE TRIGGER IF NOT EXISTS "); buff.append(trigger). append(" AFTER INSERT, UPDATE, DELETE"); if(!multiThread) { buff.append(", ROLLBACK"); } buff.append(" ON "). append(StringUtils.quoteIdentifier(schema)). append('.'). append(StringUtils.quoteIdentifier(table)). append(" FOR EACH ROW CALL \""). append(FullText.FullTextTrigger.class.getName()). append('\"'); stat.execute(buff.toString()); } } }
Source:
<code>public void getNormilizedStringWithoutDashInTheEnd() { String input = RandomStringUtils.random(61, true, true) + "-"; String output = KubernetesStringUtils.getNormalizedString(input); <START> assertTrue(!output.endsWith("-"), "Normilized string can not end with '-'"); <END> }</code><technical_language>normAlized</technical_language>

Target:
public void getNormilizedStringWithoutDashInTheEnd() { String input = RandomStringUtils.random(61, true, true) + "-"; String output = KubernetesStringUtils.getNormalizedString(input); assertTrue(!output.endsWith("-"), "Normalized string can not end with '-'"); }
Source:
<code><START> public static void validateZipOutputFile(String sourceFilename, final File outFile, final File outDir) throws IOException <END> { final File canonicalOutFile = outFile.getCanonicalFile(); final String canonicalOutDir = outDir.getCanonicalPath(); if (!canonicalOutFile.toPath().startsWith(canonicalOutDir)) { throw new ISE( "Unzipped output path[%s] of sourceFile[%s] does not start with outDir[%s].", canonicalOutFile, sourceFilename, outDir ); } }</code><technical_language>This line is longer 120 cols</technical_language>

Target:
public static void validateZipOutputFile( String sourceFilename, final File outFile, final File outDir ) throws IOException { final File canonicalOutFile = outFile.getCanonicalFile(); final String canonicalOutDir = outDir.getCanonicalPath(); if (!canonicalOutFile.toPath().startsWith(canonicalOutDir)) { throw new ISE( "Unzipped output path[%s] of sourceFile[%s] does not start with outDir[%s].", canonicalOutFile, sourceFilename, canonicalOutDir ); } }
Source:
<code>public static void main(String[] args) { String projectId = "your-project"; String member = "your-member"; String role = "roles/logging.logWriter"; CloudResourceManager crmService = null; try { crmService = initializeService(); } catch (IOException | GeneralSecurityException e) { System.out.println("Unable to initialize service: \n" + e.toString()); } addBinding(crmService, projectId, member, role); Policy policy = getPolicy(crmService, projectId); Binding binding = null; List<Binding> bindings = policy.getBindings(); <START> for (Binding b : bindings) { if (b.getRole().equals(role)) { binding = b; break; } } <END> System.out.println("Role: " + binding.getRole()); System.out.print("Members: "); for (String m : binding.getMembers()) { System.out.print("[" + m + "] "); } System.out.println(); removeMember(crmService, projectId, member, role); }</code><technical_language>good b, noticed a lot of reviewers prefer binding, is more idiomatic java</technical_language>

Target:
public static void main(String[] args) { String projectId = "your-project"; String member = "your-member"; String role = "roles/logging.logWriter"; CloudResourceManager crmService = null; try { crmService = initializeService(); } catch (IOException | GeneralSecurityException e) { System.out.println("Unable to initialize service: \n" + e.getMessage() + e.getStackTrace()); } addBinding(crmService, projectId, member, role); Policy policy = getPolicy(crmService, projectId); Binding binding = null; List<Binding> bindings = policy.getBindings(); for (Binding b : bindings) { if (b.getRole().equals(role)) { binding = b; break; } } System.out.println("Role: " + binding.getRole()); System.out.print("Members: "); for (String m : binding.getMembers()) { System.out.print("[" + m + "] "); } System.out.println(); removeMember(crmService, projectId, member, role); }
Source:
<code>public boolean isEnableTestModeButtonVisible() { boolean isButtonVisible = false; try { wait.forElementVisible(enableTestModeButton, 5, 1); isButtonVisible = true; } catch (TimeoutException exception) { isButtonVisible = false; } <START> return isModuleVisible() && isButtonVisible; <END> }</code><technical_language>this method states check button visibility. mention checking module visibility. Please this diversion more precise</technical_language>

Target:
public boolean isEnableTestModeButtonVisible() { boolean isButtonVisible = false; try { wait.forElementVisible(enableTestModeButton, 5, 1); isButtonVisible = true; } catch (TimeoutException e) { isButtonVisible = false; } return isModuleVisible() && isButtonVisible; }
Source:
<code>private static Seq<Long> tenDigitPandigitalsWithProperty() { final CharSeq ALL_DIGITS = CharSeq.of("0123456789"); final List<Integer> DIVISORS = List.of(2, 3, 5, 7, 11, 13, 17); return ALL_DIGITS .combinations(2) .flatMap(CharSeq::permutations) .flatMap(firstTwoDigits -> DIVISORS .foldLeft(List.of(firstTwoDigits), (accumulator, divisor) -> accumulator .flatMap(digitsSoFar -> ALL_DIGITS .removeAll(digitsSoFar) .map(nextDigit -> digitsSoFar.append(nextDigit)) ) <START> .filter(digitsToTest -> Integer.valueOf(digitsToTest.takeRight(3).mkString()) % divisor == 0) <END> ) ) .map(tailDigitsWithProperty -> tailDigitsWithProperty .prepend(ALL_DIGITS .removeAll(tailDigitsWithProperty) .head() ) ) .map(CharSeq::mkString) .map(Long::valueOf); }</code><technical_language>Tempted do breakfast :)</technical_language>

Target:
private static Seq<Long> tenDigitPandigitalsWithProperty() { final CharSeq ALL_DIGITS = CharSeq.of("0123456789"); final List<Integer> DIVISORS = List.of(2, 3, 5, 7, 11, 13, 17); return ALL_DIGITS .combinations(2) .flatMap(CharSeq::permutations) .flatMap(firstTwoDigits -> DIVISORS .foldLeft(List.of(firstTwoDigits), (accumulator, divisor) -> accumulator .flatMap(digitsSoFar -> ALL_DIGITS .removeAll(digitsSoFar) .map(nextDigit -> digitsSoFar.append(nextDigit)) ) .filter(digitsToTest -> digitsToTest.takeRight(3).parseInt() % divisor == 0) ) ) .map(tailDigitsWithProperty -> tailDigitsWithProperty .prepend(ALL_DIGITS .removeAll(tailDigitsWithProperty) .head() ) ) .map(CharSeq::parseLong); }
Source:
<code>public void execute(DelegateExecution execution) throws Exception { final Pool pool = (Pool) execution.getVariable(CoreProcessVariables.POOL); @SuppressWarnings("unchecked") List<Machine> machines = (List<Machine>) execution.getVariable(CoreProcessVariables.MACHINES); checkNotNull(machines, "expecting to find the list of machines as process variable"); <START> processEngine.getIdentityService().setAuthenticatedUserId("kermit"); <END> List<String> processIds = Lists.newArrayList(); for (Machine machine : machines) { final String businessKey = String.format("%s-%s-%s", execution.getProcessBusinessKey(), type, machine.getExternalId()); ProcessInstance instance = processEngine.getRuntimeService().startProcessInstanceByKey( processKey, businessKey, ImmutableMap.<String, Object>of(CoreProcessVariables.POOL, pool, "machine", machine)); LOG.info("Started background '" + type + "' process ({}) for machine {}", new Object[]{businessKey, instance.getId(), machine.getExternalId()}); processIds.add(instance.getId()); } LOG.info("Saving process IDs as {}", processIds, resultVariable); execution.setVariable(resultVariable, processIds); }</code><technical_language>I export this a constant - in places already. In future supply user name configuration</technical_language>

Target:
public void execute(DelegateExecution execution) throws Exception { final Pool pool = (Pool) execution.getVariable(CoreProcessVariables.POOL); @SuppressWarnings("unchecked") List<Machine> machines = (List<Machine>) execution.getVariable(CoreProcessVariables.MACHINES); checkNotNull(machines, "expecting to find the list of machines as process variable"); processEngine.getIdentityService().setAuthenticatedUserId(CoreConstants.ACTIVITI_EXPLORER_DEFAULT_USER); List<String> processIds = Lists.newArrayList(); for (Machine machine : machines) { final String businessKey = String.format("%s-%s-%s", execution.getProcessBusinessKey(), type, machine.getExternalId()); ProcessInstance instance = processEngine.getRuntimeService().startProcessInstanceByKey( processKey, businessKey, ImmutableMap.<String, Object>of(CoreProcessVariables.POOL, pool, "machine", machine)); LOG.info("Started background '" + type + "' process ({}) for machine {}", new Object[]{businessKey, instance.getId(), machine.getExternalId()}); processIds.add(instance.getId()); } LOG.info("Saving process IDs as {}", processIds, resultVariable); execution.setVariable(resultVariable, processIds); }
Source:
<code><START> public HashSet<String> getDomainHosts() throws Exception{ <END> HashSet<String> hosts = new HashSet<String>(); readRootNode(); if (rootNode.isDefined()) if (rootNode.get("host").isDefined()){ List<ModelNode> listNodes = rootNode.get("host").asList(); for (ModelNode listNode : listNodes) { hosts.add(listNode.keys().toString()); } } return hosts; }</code><technical_language>Return a Set<String> instead of HashSet<String></technical_language>

Target:
public Set<String> getDomainHosts() throws Exception{ Set<String> hosts = new HashSet<String>(); readRootNode(); if (rootNode.isDefined()) if (rootNode.hasDefined("host")) hosts.addAll(rootNode.get("host").keys()); return hosts; }
Source:
<code>public void checkConstraintRule( ConstraintRule rule, DynamicRecord record, RecordAccess records, CheckerEngine<DynamicRecord,ConsistencyReport.SchemaConsistencyReport> engine ) { checkSchema( rule, record, records, engine ); <START> if ( rule.getConstraintDescriptor().type().enforcesUniqueness() ) <END> { DynamicRecord previousObligation = indexObligations.put( rule.getOwnedIndex(), record.clone() ); if ( previousObligation != null ) { engine.report().duplicateObligation( previousObligation ); } } }</code><technical_language>I love readability improvement here. able improve further, ConstraintDescriptor enforcesUniqueness() method (and enforcesPropertyExistence() method) delegates state of type holds. In fact, if change ConstraintDescriptor.Type enum need a public enforcesUniqueness() enforcesPropertyExistence() method, places methods pattern of a ConstraintDescriptor invoking type() method of in order invoke enforcesUniqueness() enforcesPropertyExistence() method result. In fact ConstraintDescriptor.Type need methods all, ConstraintDescriptor access fields of class directly</technical_language>

Target:
public void checkConstraintRule( ConstraintRule rule, DynamicRecord record, RecordAccess records, CheckerEngine<DynamicRecord,ConsistencyReport.SchemaConsistencyReport> engine ) { checkSchema( rule, record, records, engine ); if ( rule.getConstraintDescriptor().enforcesUniqueness() ) { DynamicRecord previousObligation = indexObligations.put( rule.getOwnedIndex(), record.clone() ); if ( previousObligation != null ) { engine.report().duplicateObligation( previousObligation ); } } }
Source:
<code>public CloseableIterator<R> iterator() { if (stream == null) { <START> return removableIterator(Closeables.iterator(getOrCreateStream())); <END> } else { return Closeables.iterator(getOrCreateStream()); } }</code><technical_language>nitpick: if stream is null, worth invoke a createStream avoid double checking? logic applied else branch passing stream directly</technical_language>

Target:
public CloseableIterator<R> iterator() { if (stream == null) { return removableIterator(Closeables.iterator(createStream())); } else { return Closeables.iterator(stream); } }
Source:
<code><START> public OperatingSystemToOperatingSystem(final OperatingSystemToOsFamily operatingSystemToOsFamily) { <END> this.operatingSystemToOsFamily = operatingSystemToOsFamily; }</code><technical_language>Add @Inject annotation remove public modifier constructor package private ([background](<LINK_0></technical_language>

Target:
OperatingSystemToOperatingSystem(final OperatingSystemToOsFamily operatingSystemToOsFamily) { this.operatingSystemToOsFamily = operatingSystemToOsFamily; }
Source:
<code>public void setupTest() throws Exception { this.mockQuery = Mockito.mock(Query.class); this.mockResult = Mockito.mock(Result.class); this.mockDgSocket = Mockito.mock(DatagramSocket.class); this.mockLog = Mockito.mock(Logger.class); <START> this.mockServer = Mockito.mock(Server.class); <END> PowerMockito.whenNew(DatagramSocket.class).withAnyArguments().thenReturn(this.mockDgSocket); testValues = ImmutableMap.<String, Object>of("x-att1-x", "120021"); Mockito.when(this.mockResult.getValues()).thenReturn(testValues); Mockito.when(this.mockResult.getAttributeName()).thenReturn("X-ATT-X"); Mockito.when(this.mockResult.getClassName()).thenReturn("X-DOMAIN.PKG.CLASS-X"); Mockito.when(this.mockResult.getTypeName()).thenReturn("Type=x-type-x"); Mockito.when(this.mockServer.getLabel()).thenReturn("myhostname"); Map<String, Object> settings = newHashMap(); settings.put("host", "localhost"); settings.put("port", 8923); this.writer = TCollectorUDPWriter.builder() .setDebugEnabled(false) .setHost("localhost") .setPort(1234) .build(); Whitebox.setInternalState(TCollectorUDPWriter.class, Logger.class, this.mockLog); }</code><technical_language>need for a mock</technical_language>

Target:
public void setupTest() throws Exception { this.mockQuery = Mockito.mock(Query.class); this.mockResult = Mockito.mock(Result.class); this.mockDgSocket = Mockito.mock(DatagramSocket.class); this.mockLog = Mockito.mock(Logger.class); PowerMockito.whenNew(DatagramSocket.class).withAnyArguments().thenReturn(this.mockDgSocket); testValues = ImmutableMap.<String, Object>of("x-att1-x", "120021"); Mockito.when(this.mockResult.getValues()).thenReturn(testValues); Mockito.when(this.mockResult.getAttributeName()).thenReturn("X-ATT-X"); Mockito.when(this.mockResult.getClassName()).thenReturn("X-DOMAIN.PKG.CLASS-X"); Mockito.when(this.mockResult.getTypeName()).thenReturn("Type=x-type-x"); Map<String, Object> settings = newHashMap(); settings.put("host", "localhost"); settings.put("port", 8923); this.writer = TCollectorUDPWriter.builder() .setDebugEnabled(false) .setHost("localhost") .setPort(1234) .build(); Whitebox.setInternalState(TCollectorUDPWriter.class, Logger.class, this.mockLog); }
Source:
<code>public List<SimplePage> getSitePages(String siteId) { DetachedCriteria d = DetachedCriteria.forClass(SimplePage.class).add(Restrictions.eq("siteId", siteId)) <START> .add(Restrictions.disjunction() <END> .add(Restrictions.isNull("owner")) .add(Restrictions.conjunction().add(Restrictions.isNotNull("owner")).add(Restrictions.eq("owned", true))) ); List<SimplePage> l = (List<SimplePage>) getHibernateTemplate().findByCriteria(d); if (l != null && l.size() > 0) { return l; } else { return null; } }</code><technical_language>Indentation is place here</technical_language>

Target:
public List<SimplePage> getSitePages(String siteId) { DetachedCriteria d = DetachedCriteria.forClass(SimplePage.class).add(Restrictions.eq("siteId", siteId)) .add(Restrictions.disjunction() .add(Restrictions.isNull("owner")) .add(Restrictions.eq("owned", true)) ); List<SimplePage> l = (List<SimplePage>) getHibernateTemplate().findByCriteria(d); if (l != null && l.size() > 0) { return l; } else { return null; } }
Source:
<code><START> private void decrementLatchAndHandle(int count) { <END> if (latch.addAndGet(-count) > 0) { return; } Map<Integer, Object> result = createHashMap(partitionResults.length()); for (int partitionId = 0; partitionId < partitionResults.length(); partitionId++) { Object partitionResult = partitionResults.get(partitionId); if (partitionResult instanceof Throwable) { future.setResult(partitionResult); if (callback != null) { callback.onFailure((Throwable) partitionResult); } return; } if (partitionResult != null) { result.put(partitionId, partitionResult == NULL_RESULT ? null : partitionResult); } } future.setResult(result); if (callback != null) { callback.onResponse(result); } }</code><technical_language>feels error-prone situation return results for number of partitions requested. unclear situations indicate: skipped/forgot some partitions processed results. problematic cases recently, EPs skipping partitions silently hard diagnose/debug this. do, some kind of a logging in FirstAttemptExecutionCallback.onResponse helpful; a more safe option is completely disallow situations reporting exceptional result future</technical_language>

Target:
private void decrementLatchAndHandle(int count) { if (latch.addAndGet(-count) > 0) { return; } Map<Integer, Object> result = createHashMap(partitionResults.length()); for (int partitionId = 0; partitionId < partitionResults.length(); partitionId++) { Object partitionResult = partitionResults.get(partitionId); if (partitionResult instanceof Throwable) { future.setResult(partitionResult); return; } if (partitionResult != null) { result.put(partitionId, partitionResult == NULL_RESULT ? null : partitionResult); } } future.setResult(result); }
Source:
<code>public void test() { DepositTestUtils.makeTestDir(depositsDirectory, job.getDepositUUID(), new File("src/test/resources/biomedDspaceMETS.zip")); long start = System.currentTimeMillis(); job.run(); log.info("Run dspace mets: {}", (System.currentTimeMillis() - start)); Model model = job.getWritableModel(); assertFalse("Model was empty", model.isEmpty()); Bag depositBag = model.getBag(job.getDepositPID().getURI()); assertNotNull("Deposit object not found", depositBag); Resource primaryResource = (Resource) depositBag.iterator().next(); assertNotNull("Main object from the deposit not found", primaryResource); NodeIterator childIt = model.getBag(primaryResource).iterator(); <START> int childCount = 0; <END> while (childIt.hasNext()) { childCount++; Resource child = (Resource) childIt.next(); verifyStagingLocationExists(child, job.getDepositDirectory(), "Child content"); } assertEquals("Incorrect aggregate child count", 5, childCount); }</code><technical_language>good isAggregate removed, verify primaryResource is a Work. boils a primaryResource.hasProperty call I</technical_language>

Target:
public void test() { DepositTestUtils.makeTestDir(depositsDirectory, job.getDepositUUID(), new File("src/test/resources/biomedDspaceMETS.zip")); long start = System.currentTimeMillis(); job.run(); log.info("Run dspace mets: {}", (System.currentTimeMillis() - start)); Model model = job.getWritableModel(); assertFalse("Model was empty", model.isEmpty()); Bag depositBag = model.getBag(job.getDepositPID().getURI()); assertNotNull("Deposit object not found", depositBag); Resource primaryResource = (Resource) depositBag.iterator().next(); assertNotNull("Main object from the deposit not found", primaryResource); assertTrue("Main object is not a work", primaryResource.hasProperty(RDF.type, Cdr.Work)); NodeIterator childIt = model.getBag(primaryResource).iterator(); int childCount = 0; while (childIt.hasNext()) { childCount++; Resource child = (Resource) childIt.next(); verifyStagingLocationExists(child, job.getDepositDirectory(), "Child content"); } assertEquals("Incorrect aggregate child count", 5, childCount); }
Source:
<code>public ActivityLogEntry(String servlet, String act, AccountAttributes acc, String params, String link, String unregisteredUserCourse, String unregisteredUserEmail) { time = System.currentTimeMillis(); servletName = servlet; action = act; toShow = true; message = params; url = link; if (acc == null){ role = "Unknown"; name = "Unknown"; email = "Unknown"; UserType userType = GateKeeper.inst().getCurrentUser(); googleId = userType != null ? userType.id : "Unknown"; } else { role = acc.isInstructor ? "Instructor" : "Student"; name = acc.name; googleId = acc.googleId; email = acc.email; } <START> if (googleId.contentEquals("Unknown") && unregisteredUserCourse != null && unregisteredUserEmail != null) { <END> id = unregisteredUserEmail + "%" + unregisteredUserCourse + "%" + formatTimeForId(new Date(time)); } else { id = googleId + formatTimeForId(new Date(time)); } role = changeRoleToAutoIfAutomatedActions(servletName, role); }</code><technical_language>is good assign conditions this a local variable explanatory name</technical_language>

Target:
public ActivityLogEntry(String servlet, String act, AccountAttributes acc, String params, String link, String unregisteredUserCourse, String unregisteredUserEmail) { time = System.currentTimeMillis(); servletName = servlet; action = act; toShow = true; message = params; url = link; if (acc == null){ role = "Unknown"; name = "Unknown"; email = "Unknown"; UserType userType = GateKeeper.inst().getCurrentUser(); googleId = userType != null ? userType.id : "Unknown"; } else { role = acc.isInstructor ? "Instructor" : "Student"; name = acc.name; googleId = acc.googleId; email = acc.email; } boolean isUnregisteredStudent = googleId.contentEquals("Unknown") && unregisteredUserCourse != null && unregisteredUserEmail != null; if (isUnregisteredStudent) { id = unregisteredUserEmail + "%" + unregisteredUserCourse + "%" + formatTimeForId(new Date(time)); } else { id = googleId + "%" + formatTimeForId(new Date(time)); } role = changeRoleToAutoIfAutomatedActions(servletName, role); }
Source:
<code>protected void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); final Context ctx = getApplicationContext(); final PackageManager packageManager = ctx.getPackageManager(); hasLocationFeature = packageManager.hasSystemFeature(PackageManager.FEATURE_LOCATION) || packageManager.hasSystemFeature(PackageManager.FEATURE_LOCATION_GPS) || packageManager.hasSystemFeature(PackageManager.FEATURE_LOCATION_NETWORK); this.locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE); this.marker_icon = BitmapFactory.decodeResource(ctx.getResources(), R.drawable.marker); final Boolean dark = PreferenceManager.getDefaultSharedPreferences(ctx) .getString("theme", "light").equals("dark"); <START> final int mTheme = dark ? R.style.ConversationsTheme_Dark : R.style.ConversationsTheme; <END> setTheme(mTheme); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && savedInstanceState == null) { requestPermissions(REQUEST_CODE_CREATE); } final IConfigurationProvider config = Configuration.getInstance(); config.load(ctx, getPreferences()); config.setUserAgentValue(BuildConfig.APPLICATION_ID + "_" + BuildConfig.VERSION_CODE); final File f = new File(ctx.getCacheDir() + "/tiles"); try { f.mkdirs(); } catch (final SecurityException ignored) { } if (f.exists() && f.isDirectory() && f.canRead() && f.canWrite()) { Log.d(Config.LOGTAG, "Using tile cache at: " + f.getAbsolutePath()); config.setOsmdroidTileCache(f.getAbsoluteFile()); } }</code><technical_language>themes now. Dark / light in 3 font sizes. is a class util/ThemeHelper do settings theme id conversion</technical_language>

Target:
protected void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); final Context ctx = getApplicationContext(); setTheme(ThemeHelper.find(this)); final PackageManager packageManager = ctx.getPackageManager(); hasLocationFeature = packageManager.hasSystemFeature(PackageManager.FEATURE_LOCATION) || packageManager.hasSystemFeature(PackageManager.FEATURE_LOCATION_GPS) || packageManager.hasSystemFeature(PackageManager.FEATURE_LOCATION_NETWORK); this.locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE); this.marker_icon = BitmapFactory.decodeResource(ctx.getResources(), R.drawable.marker); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && savedInstanceState == null) { requestPermissions(REQUEST_CODE_CREATE); } final IConfigurationProvider config = Configuration.getInstance(); config.load(ctx, getPreferences()); config.setUserAgentValue(BuildConfig.APPLICATION_ID + "_" + BuildConfig.VERSION_CODE); final File f = new File(ctx.getCacheDir() + "/tiles"); try { f.mkdirs(); } catch (final SecurityException ignored) { } if (f.exists() && f.isDirectory() && f.canRead() && f.canWrite()) { Log.d(Config.LOGTAG, "Using tile cache at: " + f.getAbsolutePath()); config.setOsmdroidTileCache(f.getAbsoluteFile()); } }
Source:
<code>public QueryRequest process(QueryRequest input) throws PluginExecutionException, StopProcessingException { QueryTypeFilterDelegate queryType = new QueryTypeFilterDelegate(); Set<String> sourceIds = getSourceIds(input); try { filterAdapter.adapt(input.getQuery(), queryType); <START> if (queryType.isComparison()) { sourceIds.forEach(sourceId -> incrementCounter(sourceId, "comparison")); } if (queryType.isSpatial()) { sourceIds.forEach(sourceId -> incrementCounter(sourceId, "spatial")); } if (queryType.isFuzzy()) { sourceIds.forEach(sourceId -> incrementCounter(sourceId, "fuzzy")); } if (queryType.isTemporal()) { sourceIds.forEach(sourceId -> incrementCounter(sourceId, "temporal")); } if (queryType.isFunction()) { sourceIds.forEach(sourceId -> incrementCounter(sourceId, "function")); } if (isNone(queryType)) { sourceIds.forEach(sourceId -> incrementCounter(sourceId, "none")); } } catch (UnsupportedQueryException e) { END> } addStartTime(input); return input; }</code><technical_language>need DEBUG add TRACE logging for conditions</technical_language>

Target:
public QueryRequest process(QueryRequest input) throws PluginExecutionException, StopProcessingException { QueryTypeFilterDelegate queryType = new QueryTypeFilterDelegate(); Set<String> sourceIds = getSourceIds(input); try { filterAdapter.adapt(input.getQuery(), queryType); if (queryType.isComparison()) { sourceIds.forEach(sourceId -> incrementCounter(sourceId, "comparison")); } if (queryType.isSpatial()) { sourceIds.forEach(sourceId -> incrementCounter(sourceId, "spatial")); } if (queryType.isFuzzy()) { sourceIds.forEach(sourceId -> incrementCounter(sourceId, "fuzzy")); } if (queryType.isTemporal()) { sourceIds.forEach(sourceId -> incrementCounter(sourceId, "temporal")); } if (queryType.isFunction()) { sourceIds.forEach(sourceId -> incrementCounter(sourceId, "function")); } if (isNone(queryType)) { sourceIds.forEach(sourceId -> incrementCounter(sourceId, "none")); } } catch (UnsupportedQueryException e) { LOGGER.debug("Unable to detect query type due to unsupported query.", e); sourceIds.forEach(sourceId -> incrementCounter(sourceId, "unsupported")); } addStartTime(input); return input; }
Source:
<code>public BreakButtonsUI(String name, BreakPanelToolbarFactory breakToolbarFactory) { requestButton = breakToolbarFactory.getBtnBreakRequest(); responseButton = breakToolbarFactory.getBtnBreakResponse(); allButton = breakToolbarFactory.getBtnBreakAll(); brkOnJsButton = breakToolbarFactory.getBtnBreakOnJavaScript(); brkOnCSSAndFontsButton = breakToolbarFactory.getBtnBreakOnCSSAndFonts(); brkOnMultimediaButton = breakToolbarFactory.getBtnBreakOnMultimedia(); brkOnlyOnScopeButton = breakToolbarFactory.getBtnOnlyBreakOnScope(); toolBar = new JToolBar(); toolBar.setFloatable(false); toolBar.setBorder(BorderFactory.createEmptyBorder()); toolBar.setRollover(true); toolBar.setName(name); toolBar.add(requestButton); toolBar.add(responseButton); toolBar.add(allButton); toolBar.add(breakToolbarFactory.getBtnStep()); toolBar.add(breakToolbarFactory.getBtnContinue()); toolBar.add(breakToolbarFactory.getBtnDrop()); toolBar.add(breakToolbarFactory.getBtnBreakPoint()); <START> toolBar.add(brkOnJsButton); <END> toolBar.add(brkOnCSSAndFontsButton); toolBar.add(brkOnMultimediaButton); toolBar.add(brkOnlyOnScopeButton); }</code><technical_language>worth adding a separator this scope button, behaviour</technical_language>

Target:
public BreakButtonsUI(String name, BreakPanelToolbarFactory breakToolbarFactory) { requestButton = breakToolbarFactory.getBtnBreakRequest(); responseButton = breakToolbarFactory.getBtnBreakResponse(); allButton = breakToolbarFactory.getBtnBreakAll(); separatorForBreakOnButtons = new JToolBar.Separator(); brkOnJavaScriptButton = breakToolbarFactory.getBtnBreakOnJavaScript(); brkOnCssAndFontsButton = breakToolbarFactory.getBtnBreakOnCssAndFonts(); brkOnMultimediaButton = breakToolbarFactory.getBtnBreakOnMultimedia(); separatorForBreakOnlyScopeButton = new JToolBar.Separator(); brkOnlyOnScopeButton = breakToolbarFactory.getBtnOnlyBreakOnScope(); toolBar = new JToolBar(); toolBar.setFloatable(false); toolBar.setBorder(BorderFactory.createEmptyBorder()); toolBar.setRollover(true); toolBar.setName(name); toolBar.add(requestButton); toolBar.add(responseButton); toolBar.add(allButton); toolBar.add(breakToolbarFactory.getBtnStep()); toolBar.add(breakToolbarFactory.getBtnContinue()); toolBar.add(breakToolbarFactory.getBtnDrop()); toolBar.add(breakToolbarFactory.getBtnBreakPoint()); toolBar.add(separatorForBreakOnButtons); toolBar.add(brkOnJavaScriptButton); toolBar.add(brkOnCssAndFontsButton); toolBar.add(brkOnMultimediaButton); toolBar.add(separatorForBreakOnlyScopeButton); toolBar.add(brkOnlyOnScopeButton); }
Source:
<code>public void send(RiemannEvent event) { try { EventDSL eventDSL = createEvent() .description(event.description) .service(machineName + " " + event.service) .state(event.state) .time(System.currentTimeMillis() / 1000L) .metric(event.metric) .ttl(event.ttl == null ? DEFAULT_TTL_SEC : event.ttl) .tag("storm") .tags(event.tags) .attributes(event.customAttributes); if(event.host != null) { eventDSL.host(event.host); } <START> logger.debug("Event sent - {}", event); <END> eventDSL.send(); } catch (Throwable t) { logger.warn("Riemann error during event ("+ event.description+") send attempt: ", t); } }</code><technical_language>put log send</technical_language>

Target:
public void send(RiemannEvent event) { try { EventDSL eventDSL = createEvent() .description(event.description) .service(machineName + " " + event.service) .state(event.state) .time(System.currentTimeMillis() / 1000L) .metric(event.metric) .ttl(event.ttl == null ? DEFAULT_TTL_SEC : event.ttl) .tag("storm") .tags(event.tags) .attributes(event.customAttributes); if(event.host != null) { eventDSL.host(event.host); } eventDSL.send(); if (logger.isDebugEnabled()) { logger.debug("Event sent - {}", event); } } catch (Throwable t) { logger.warn("Riemann error during event ("+ event.description+") send attempt: ", t); } }
Source:
<code>public void setup() throws Exception { discoverListener = PowerMockito.spy(new MyDiscoverListener()); listeners.add(discoverListener); nodeDiscovery = PowerMockito.spy(new NodeDiscovery(Mockito.mock(XBeeDevice.class))); PowerMockito.doAnswer(new Answer<Object>() { @Override public Object answer(InvocationOnMock invocation) throws Throwable { Object[] args = invocation.getArguments(); RemoteXBeeDevice remote = (RemoteXBeeDevice) args[1]; discoverListener.deviceDiscovered(remote); return null; } <START> }).when(nodeDiscovery, NOTIFY_DEVICE_DISCOVERED, Mockito.any(ArrayList.class), (RemoteXBeeDevice) Mockito.any()); <END> PowerMockito.doAnswer(new Answer<Object>() { @Override public Object answer(InvocationOnMock invocation) throws Throwable { Object[] args = invocation.getArguments(); String error = (String) args[1]; discoverListener.discoveryError(error); return null; } }).when(nodeDiscovery, NOTIFY_DISCOVERY_ERROR, Mockito.any(ArrayList.class), Mockito.anyString()); PowerMockito.doAnswer(new Answer<Object>() { @Override public Object answer(InvocationOnMock invocation) throws Throwable { Object[] args = invocation.getArguments(); String error = (String) args[1]; discoverListener.discoveryFinished(error); return null; } }).when(nodeDiscovery, NOTIFY_DISCOVERY_FINISHED, Mockito.any(ArrayList.class), Mockito.anyString()); }</code><technical_language>I guess need change parameter type List.class: java }).when(nodeDiscovery, NOTIFY_DEVICE_DISCOVERED, Mockito.any(List.class), (RemoteXBeeDevice) Mockito.any());</technical_language>

Target:
public void setup() throws Exception { discoverListener = PowerMockito.spy(new MyDiscoverListener()); listeners.add(discoverListener); nodeDiscovery = PowerMockito.spy(new NodeDiscovery(Mockito.mock(XBeeDevice.class))); PowerMockito.doAnswer(new Answer<Object>() { @Override public Object answer(InvocationOnMock invocation) throws Throwable { Object[] args = invocation.getArguments(); RemoteXBeeDevice remote = (RemoteXBeeDevice) args[1]; discoverListener.deviceDiscovered(remote); return null; } }).when(nodeDiscovery, NOTIFY_DEVICE_DISCOVERED, Mockito.any(List.class), (RemoteXBeeDevice) Mockito.any()); PowerMockito.doAnswer(new Answer<Object>() { @Override public Object answer(InvocationOnMock invocation) throws Throwable { Object[] args = invocation.getArguments(); String error = (String) args[1]; discoverListener.discoveryError(error); return null; } }).when(nodeDiscovery, NOTIFY_DISCOVERY_ERROR, Mockito.any(List.class), Mockito.anyString()); PowerMockito.doAnswer(new Answer<Object>() { @Override public Object answer(InvocationOnMock invocation) throws Throwable { Object[] args = invocation.getArguments(); String error = (String) args[1]; discoverListener.discoveryFinished(error); return null; } }).when(nodeDiscovery, NOTIFY_DISCOVERY_FINISHED, Mockito.any(List.class), Mockito.anyString()); }
Source:
<code>public Map<String, String> getHeaders() { Map<String, String> headers = new HashMap<>(); <START> Optional.ofNullable(idempotencyKey).ifPresent(idempotencyKey -> headers.put("Idempotency-Key", idempotencyKey)); <END> headers.putAll(AuthUtil.getStripeAuthHeader(stripeGatewayConfig, gatewayAccount.isLive())); return headers; }</code><technical_language>Similar for shadowing field idempotencyKey -></technical_language>

Target:
public Map<String, String> getHeaders() { Map<String, String> headers = new HashMap<>(); Optional.ofNullable(idempotencyKey).ifPresent(key -> headers.put("Idempotency-Key", key)); headers.putAll(AuthUtil.getStripeAuthHeader(stripeGatewayConfig, gatewayAccount.isLive())); return headers; }
Source:
<code><START> @Test public void testInterceptSource() { <END> String srcRegex = "word1"; String replaceString = "word2"; RegexMountPointResolvedDstPathReplaceInterceptor interceptor = new RegexMountPointResolvedDstPathReplaceInterceptor(srcRegex, replaceString); String sourcePath = "/a/b/l3/dd"; sourcePath = interceptor.interceptSource(sourcePath); }</code><technical_language>Nits: please add annotation in separate line above. want change for lines above</technical_language>

Target:
public void testInterceptSource() { String srcRegex = "word1"; String replaceString = "word2"; RegexMountPointResolvedDstPathReplaceInterceptor interceptor = new RegexMountPointResolvedDstPathReplaceInterceptor(srcRegex, replaceString); String sourcePath = "/a/b/l3/dd"; Assert.assertEquals(sourcePath, interceptor.interceptSource(sourcePath)); }
Source:
<code><START> public static String map(org.ovirt.engine.core.common.businessentities.gluster.GlusterHookStage hookStage, <END> String template) { switch (hookStage) { case POST: return org.ovirt.engine.core.common.businessentities.gluster.GlusterHookStage.POST.toString(); case PRE: return org.ovirt.engine.core.common.businessentities.gluster.GlusterHookStage.PRE.toString(); default: return null; } }</code><technical_language>this mapping happen public enum mapping backend enum string</technical_language>

Target:
public static String map(org.ovirt.engine.core.common.businessentities.gluster.GlusterHookStage hookStage, String template) { switch (hookStage) { case POST: return Stage.POST.toString(); case PRE: return Stage.PRE.toString(); default: return null; } }
Source:
<code>protected void executeCommand() { TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { getCompensationContext().snapshotEntity(getVmPool()); setPoolBeingDestroyed(); setPrestartedToZero(); getCompensationContext().stateChanged(); return null; } }); setCommandShouldBeLogged(false); log(); stopVms(); if (allVmsDown) { <START> getParameters().setTaskGroupSuccess(true); <END> endSuccessfully(); } else { setSucceeded(true); } }</code><technical_language>this line is redundant call endSuccessfully</technical_language>

Target:
protected void executeCommand() { TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { getCompensationContext().snapshotEntity(getVmPool()); setPoolBeingDestroyed(); setPrestartedToZero(); getCompensationContext().stateChanged(); return null; } }); setCommandShouldBeLogged(false); log(); stopVms(); if (allVmsDown) { endSuccessfully(); } else { setSucceeded(true); } }
Source:
<code>private void classifyNics(List<Bond> nonEmptyBonds, List<Nic> independentNics, Map<String, List<Nic>> bondToNics, Map<String, List<Vlan>> nicToVlans) { <START> for (VdsNetworkInterface i : getOriginalItems()) { <END> if (i instanceof Bond) { nonEmptyBonds.add((Bond) i); } else if (i instanceof Nic) { if (i.getBondName() == null) { independentNics.add((Nic) i); } else { if (bondToNics.containsKey(i.getBondName())) { bondToNics.get(i.getBondName()).add((Nic) i); } else { List<Nic> nicList = new ArrayList<Nic>(); nicList.add((Nic) i); bondToNics.put(i.getBondName(), nicList); } } } else { String nameWithoutVlan = i.getName().substring(0, i.getName().lastIndexOf('.')); if (nicToVlans.containsKey(nameWithoutVlan)) { nicToVlans.get(nameWithoutVlan).add((Vlan) i); } else { List<Vlan> vlanList = new ArrayList<Vlan>(); vlanList.add((Vlan) i); nicToVlans.put(nameWithoutVlan, vlanList); } } } }</code><technical_language>I "I" is a good name. change "interface"</technical_language>

Target:
private void classifyNics(List<Bond> nonEmptyBonds, List<Nic> independentNics, Map<String, List<Nic>> bondToNics, Map<String, List<Vlan>> nicToVlans) { for (VdsNetworkInterface nic : getOriginalItems()) { if (nic instanceof Bond) { nonEmptyBonds.add((Bond) nic); } else if (nic instanceof Nic) { if (nic.getBondName() == null) { independentNics.add((Nic) nic); } else { if (bondToNics.containsKey(nic.getBondName())) { bondToNics.get(nic.getBondName()).add((Nic) nic); } else { List<Nic> nicList = new ArrayList<Nic>(); nicList.add((Nic) nic); bondToNics.put(nic.getBondName(), nicList); } } } else if (nic instanceof Vlan) { String nameWithoutVlan = nic.getName().substring(0, nic.getName().lastIndexOf('.')); if (nicToVlans.containsKey(nameWithoutVlan)) { nicToVlans.get(nameWithoutVlan).add((Vlan) nic); } else { List<Vlan> vlanList = new ArrayList<Vlan>(); vlanList.add((Vlan) nic); nicToVlans.put(nameWithoutVlan, vlanList); } } } }
Source:
<code>public InputStatus pollNext(ReaderOutput<Integer> sourceOutput) throws Exception { boolean finished = !waitingForMoreSplits; currentSplitIndex = 0; while (currentSplitIndex < assignedSplits.size() && !assignedSplits.get(currentSplitIndex).isAvailable()) { finished &= assignedSplits.get(currentSplitIndex).isFinished(); currentSplitIndex++; } if (currentSplitIndex < assignedSplits.size()) { sourceOutput.collect(assignedSplits.get(currentSplitIndex).getNext(false)[0]); return InputStatus.MORE_AVAILABLE; <START> } else { if (finished) { <END> return InputStatus.END_OF_INPUT; } else { if (markIdleOnNoSplits) { sourceOutput.markIdle(); } markUnavailable(); return InputStatus.NOTHING_AVAILABLE; } } }</code><technical_language>nit: flatten nested else { if } else if {}</technical_language>

Target:
public InputStatus pollNext(ReaderOutput<Integer> sourceOutput) throws Exception { boolean finished = !waitingForMoreSplits; currentSplitIndex = 0; while (currentSplitIndex < assignedSplits.size() && !assignedSplits.get(currentSplitIndex).isAvailable()) { finished &= assignedSplits.get(currentSplitIndex).isFinished(); currentSplitIndex++; } if (currentSplitIndex < assignedSplits.size()) { sourceOutput.collect(assignedSplits.get(currentSplitIndex).getNext(false)[0]); return InputStatus.MORE_AVAILABLE; } else if (finished) { return InputStatus.END_OF_INPUT; } else { if (markIdleOnNoSplits) { sourceOutput.markIdle(); } markUnavailable(); return InputStatus.NOTHING_AVAILABLE; } }
Source:
<code>public StreamingAppMasterService(ApplicationAttemptId appAttemptID) { super(StreamingAppMasterService.class.getName()); this.appAttemptID = appAttemptID; <START> Integer nodeManagerKillTimeout = Integer.getInteger("org.apache.apex.nodemanager.kill.timeout"); <END> if (nodeManagerKillTimeout != null) { REMOVE_CONTAINER_TIMEOUT = nodeManagerKillTimeout; } else { REMOVE_CONTAINER_TIMEOUT = 30 * 1000; } }</code><technical_language>REMOVE_CONTAINER_TIMEOUT = Integer.getInteger("org.apache.apex.nodemanager.kill.timeout", 30 * 1000);</technical_language>

Target:
public StreamingAppMasterService(ApplicationAttemptId appAttemptID) { super(StreamingAppMasterService.class.getName()); this.appAttemptID = appAttemptID; }