auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Future<PlanResult> execute(final Plan plan) { return mainExecutor.submit(new Callable<PlanResult>() { @Override public PlanResult call() throws Exception { if (plan.getEvaluatorsToAdd().isEmpty() && plan.getTransferSteps().isEmpty()) { return new PlanResultImpl(); } executingPlan = new ExecutingPlan(plan, dolphinDriver.get()); for (final String evaluatorToAdd : plan.getEvaluatorsToAdd()) { LOG.log(Level.INFO, "Add new evaluator {0}", evaluatorToAdd); <START> elasticMemory.add(1, 512, 1, new ContextActiveHandler()); <END> } executingPlan.awaitActiveContexts(); LOG.log(Level.INFO, "All evaluators were added, will transfer data."); try { for (final TransferStep transferStep : plan.getTransferSteps()) { elasticMemory.move( transferStep.getDataInfo().getDataType(), transferStep.getDataInfo().getNumUnits(), transferStep.getSrcId(), executingPlan.getActualContextId(transferStep.getDstId()), new DataTransferredHandler(), new MovedHandler()); } } catch (final Exception e) { LOG.log(Level.WARNING, "Caught Exception, closing Evaluators.", e); executingPlan.onSynchronizedExecutionFailed(); } executingPlan.awaitDataTransfers(); LOG.log(Level.INFO, "All data transfers were completed, will submit evaluators and applyUpdates on pause."); driverSync.execute(new SynchronizedExecutionHandler(executingPlan), new SynchronizedExecutionFailedHandler(executingPlan)); executingPlan.awaitSynchronizedExecution(); executingPlan = null; return new PlanResultImpl(); } }); }</code><technical_language>evaluator size is fixed 512MB, a command line parameter for evaluator sizes I here. though; else (or me) care of in another issue</technical_language>

Target:
public Future<PlanResult> execute(final Plan plan) { return mainExecutor.submit(new Callable<PlanResult>() { @Override public PlanResult call() throws Exception { if (plan.getEvaluatorsToAdd().isEmpty() && plan.getTransferSteps().isEmpty()) { return new PlanResultImpl(); } executingPlan = new ExecutingPlan(plan, dolphinDriver.get()); for (final String evaluatorToAdd : plan.getEvaluatorsToAdd()) { LOG.log(Level.INFO, "Add new evaluator {0}", evaluatorToAdd); elasticMemory.add(1, evalSize, 1, new ContextActiveHandler()); } executingPlan.awaitActiveContexts(); LOG.log(Level.INFO, "All evaluators were added, will transfer data."); try { for (final TransferStep transferStep : plan.getTransferSteps()) { elasticMemory.move( transferStep.getDataInfo().getDataType(), transferStep.getDataInfo().getNumUnits(), transferStep.getSrcId(), executingPlan.getActualContextId(transferStep.getDstId()), new DataTransferredHandler(), new MovedHandler()); } } catch (final Exception e) { LOG.log(Level.WARNING, "Caught Exception, closing Evaluators.", e); executingPlan.onSynchronizedExecutionFailed(); } executingPlan.awaitDataTransfers(); LOG.log(Level.INFO, "All data transfers were completed, will submit evaluators and applyUpdates on pause."); driverSync.execute(new SynchronizedExecutionHandler(executingPlan), new SynchronizedExecutionFailedHandler(executingPlan)); executingPlan.awaitSynchronizedExecution(); executingPlan = null; return new PlanResultImpl(); } }); }
Source:
<code>private void compactLog() { long lastApplied = raft.getLastApplied(); if (raft.getLog().isCompactable(lastApplied) && raft.getLog().getCompactableIndex(lastApplied) > lastCompacted) { this.lastCompacted = lastApplied; List<DefaultServiceContext> services = new ArrayList<>(this.services.values()); List<CompletableFuture<Void>> futures = services.stream() .map(context -> { long snapshotIndex = context.takeSnapshot().join(); return context.completeSnapshot(snapshotIndex); }) .collect(Collectors.toList()); CompletableFuture.allOf(futures.toArray(new CompletableFuture[futures.size()])) .whenCompleteAsync((result, error) -> { logger.info("Compacting logs up to index {}", lastApplied); log.compact(lastApplied); <START> scheduleCompaction(); <END> }, threadContext); } }</code><technical_language>log.compact throw? Want miss next scheduleCompaction</technical_language>

Target:
private void compactLog() { long lastApplied = raft.getLastApplied(); if (raft.getLog().isCompactable(lastApplied) && raft.getLog().getCompactableIndex(lastApplied) > lastCompacted) { this.lastCompacted = lastApplied; List<DefaultServiceContext> services = new ArrayList<>(this.services.values()); List<CompletableFuture<Void>> futures = services.stream() .map(context -> { long snapshotIndex = context.takeSnapshot().join(); return context.completeSnapshot(snapshotIndex); }) .collect(Collectors.toList()); CompletableFuture.allOf(futures.toArray(new CompletableFuture[futures.size()])) .whenCompleteAsync((result, error) -> { logger.info("Compacting logs up to index {}", lastApplied); try { log.compact(lastApplied); } catch (Exception e) { logger.error("An exception occurred during log compaction: {}", e); } finally { scheduleCompaction(); } }, threadContext); } }
Source:
<code>protected abstract Set<Capability> getCapabilities( AzkabanSequenceFileReader.Reader reader) throws Exception; protected abstract void displaySequenceFile( AzkabanSequenceFileReader.Reader reader, PrintWriter output, int startLine, int endLine) throws IOException; public Set<Capability> getCapabilites(FileSystem fs, Path file) { Set<Capability> result = EnumSet.noneOf(Capability.class); AzkabanSequenceFileReader.Reader reader = null; try { reader = new AzkabanSequenceFileReader.Reader(fs, file, new Configuration()); result = getCapabilities(reader); } catch (Exception e) { return EnumSet.noneOf(Capability.class); } finally { if (reader != null) { try { reader.close(); } <START> catch (IOException e) { <END> } } } return result; }</code><technical_language>add a printStackTrace here</technical_language>

Target:
protected abstract Set<Capability> getCapabilities( AzkabanSequenceFileReader.Reader reader) throws Exception; protected abstract void displaySequenceFile( AzkabanSequenceFileReader.Reader reader, PrintWriter output, int startLine, int endLine) throws IOException; public Set<Capability> getCapabilites(FileSystem fs, Path file) { Set<Capability> result = EnumSet.noneOf(Capability.class); AzkabanSequenceFileReader.Reader reader = null; try { reader = new AzkabanSequenceFileReader.Reader(fs, file, new Configuration()); result = getCapabilities(reader); } catch (Exception e) { return EnumSet.noneOf(Capability.class); } finally { if (reader != null) { try { reader.close(); } catch (IOException e) { e.printStackTrace(); } } } return result; }
Source:
<code>private static HeldLocksToken acquireLock(LockService lockService, LockRequest lockRequest) { int failureCount = 0; while (true) { HeldLocksToken response; try { response = lockService.lockAndGetHeldLocks(LockClient.ANONYMOUS.getClientId(), lockRequest); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new RuntimeException(e); } if (response == null) { RuntimeException ex = new LockAcquisitionException( "Failed to lock using the provided lock request: " + lockRequest); log.warn("Count not lock successfully", ex); ++failureCount; if (failureCount >= NUM_RETRIES) { log.warn("Failing after tries", failureCount, ex); throw ex; } AbstractTransactionManager.sleepForBackoff(failureCount); <START> continue; <END> } else { return response; } } }</code><technical_language>nit: this statement, this needed</technical_language>

Target:
private static HeldLocksToken acquireLock(LockService lockService, LockRequest lockRequest) { int failureCount = 0; while (true) { HeldLocksToken response; try { response = lockService.lockAndGetHeldLocks(LockClient.ANONYMOUS.getClientId(), lockRequest); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new RuntimeException(e); } if (response == null) { RuntimeException ex = new LockAcquisitionException( "Failed to lock using the provided lock request: " + lockRequest); log.warn("Count not lock successfully", ex); ++failureCount; if (failureCount >= NUM_RETRIES) { log.warn("Failing after tries", failureCount, ex); throw ex; } AbstractTransactionManager.sleepForBackoff(failureCount); } else { return response; } } }
Source:
<code>public HashSet<String> getNoStatsColumns() throws StandardException { if (costEstimate == null) throw new RuntimeException("Should not be null"); HashSet<String> noStatsColumns = new HashSet<>(); CollectNodesVisitor cnv = new CollectNodesVisitor(ColumnReference.class); for (OrderedColumn oc : groupingList) { oc.accept(cnv); } <START> for (AggregateNode an : aggregateVector) { <END> an.accept(cnv); } List<ColumnReference> columnRefNodes = cnv.getList(); for (ColumnReference cr : columnRefNodes) { if (!cr.useRealColumnStatistics()) noStatsColumns.add(cr.getSource().getSchemaName() + "." + cr.getSource().getFullName()); } return noStatsColumns; }</code><technical_language>do need stats columns aggregate function. is need visit aggregate function nodes</technical_language>

Target:
public HashSet<String> getNoStatsColumns() throws StandardException { assert costEstimate != null : "Trying to get columns missing statistic but there is no cost estimation."; HashSet<String> noStatsColumns = new HashSet<>(); CollectNodesVisitor cnv = new CollectNodesVisitor(ColumnReference.class); for (OrderedColumn oc : groupingList) { oc.accept(cnv); } List<ColumnReference> columnRefNodes = cnv.getList(); for (ColumnReference cr : columnRefNodes) { if (!cr.useRealColumnStatistics()) noStatsColumns.add(cr.getSource().getSchemaName() + "." + cr.getSource().getFullName()); } return noStatsColumns; }
Source:
<code>public void experimentSelected(TmfExperimentSelectedSignal signal) { if (signal != null) { if (fExperiment == null || signal.getExperiment().toString().compareTo(fExperiment.toString()) != 0) { fStatsViewers.clear(); fExperiment = signal.getExperiment(); createStatisticsViewers(); fStatsViewers.layout(); TmfStatisticsViewer statViewer; for (ITmfViewer viewer : fStatsViewers.getViewers()) { statViewer = (TmfStatisticsViewer) viewer; setInput(statViewer, fExperiment.getTraces()); } <START> if (fRequestData) { <END> TmfExperimentRangeUpdatedSignal updateSignal = new TmfExperimentRangeUpdatedSignal(null, fExperiment, fExperiment.getTimeRange()); TmfStatisticsViewer statsViewer; for (ITmfViewer viewer : fStatsViewers.getViewers()) { statsViewer = (TmfStatisticsViewer) viewer; statsViewer.experimentRangeUpdated(updateSignal); } fRequestData = false; } } } }</code><technical_language>calling a signal handler of signal TmfExperimentRangeUpdatedSignal coalescing of requests sending request experiment. Experiment this point more request is coming dispatches request separately. need do a trick achieve coalescing of requests of multiple viewers. need call fExperiment.startSynch(new TmfStartSynchSignal(0)); loop fExperiment.endSynch(new TmfEndSynchSignal(0)); loop. I 2 viewers works</technical_language>

Target:
public void experimentSelected(TmfExperimentSelectedSignal signal) { if (signal != null) { if (fExperiment == null || signal.getExperiment().toString().compareTo(fExperiment.toString()) != 0) { fStatsViewers.clear(); fExperiment = signal.getExperiment(); createStatisticsViewers(); fStatsViewers.layout(); TmfStatisticsViewer statViewer; for (ITmfViewer viewer : fStatsViewers.getViewers()) { if (!(viewer instanceof TmfStatisticsViewer)) { Activator.getDefault().logError("Error - cannot cast viewer to a statistics viewer"); continue; } statViewer = (TmfStatisticsViewer) viewer; setInput(statViewer, fExperiment.getTraces()); } if (fRequestData) { TmfExperimentRangeUpdatedSignal updateSignal = new TmfExperimentRangeUpdatedSignal(null, fExperiment, fExperiment.getTimeRange()); TmfStatisticsViewer statsViewer; fExperiment.startSynch(new TmfStartSynchSignal(0)); for (ITmfViewer viewer : fStatsViewers.getViewers()) { if (!(viewer instanceof TmfStatisticsViewer)) { Activator.getDefault().logError("Error - cannot cast viewer to a statistics viewer"); continue; } statsViewer = (TmfStatisticsViewer) viewer; statsViewer.experimentRangeUpdated(updateSignal); } fExperiment.endSynch(new TmfEndSynchSignal(0)); fRequestData = false; } } } }
Source:
<code>public void test() throws Exception { <START> Verifier verifier = getVerifier("/368985_licenseFeature", false); <END> verifier.getCliOptions().add("-DnewVersion=" + NEW_MAVEN_VERSION); verifier.getCliOptions().add("-Dartifacts=licenseFeature"); verifier.executeGoal("org.eclipse.tycho:tycho-versions-plugin:" + TychoVersion.getTychoVersion() + ":set-version"); verifier.verifyErrorFreeLog(); File licenseFeatureDir = new File(verifier.getBasedir(), "feature.license"); Feature licenseFeature = Feature.read(new File(licenseFeatureDir, "feature.xml")); assertEquals(NEW_OSGI_VERSION, licenseFeature.getVersion()); File otherFeatureDir = new File(verifier.getBasedir(), "feature"); Feature otherFeature = Feature.read(new File(otherFeatureDir, "feature.xml")); assertEquals(NEW_OSGI_VERSION, otherFeature.getLicenseFeatureVersion()); assertNotEquals(NEW_OSGI_VERSION, otherFeature.getVersion()); }</code><technical_language>a maven profile for running in parallel (which speeds a lot). this works (kind of) reliably if distinct tests distinct test resources. separate test resources specific for this test here</technical_language>

Target:
public void test() throws Exception { Verifier verifier = getVerifier("/424945_setLicenseFeatureVersion", false); verifier.getCliOptions().add("-DnewVersion=" + NEW_MAVEN_VERSION); verifier.executeGoal("org.eclipse.tycho:tycho-versions-plugin:" + TychoVersion.getTychoVersion() + ":set-version"); verifier.verifyErrorFreeLog(); File licenseFeatureDir = new File(verifier.getBasedir(), "license.feature"); Feature licenseFeature = Feature.read(new File(licenseFeatureDir, "feature.xml")); assertEquals(NEW_OSGI_VERSION, licenseFeature.getVersion()); File otherFeatureDir = new File(verifier.getBasedir(), "other.feature"); Feature otherFeature = Feature.read(new File(otherFeatureDir, "feature.xml")); assertEquals(NEW_OSGI_VERSION, otherFeature.getLicenseFeatureVersion()); }
Source:
<code>private void setParentInvoice(final InvoiceModelDao invoice, final List<Tag> invoicesTags, final EntitySqlDaoWrapperFactory entitySqlDaoWrapperFactory, final InternalTenantContext childContext) { final InvoiceParentChildrenSqlDao invoiceParentChildrenSqlDao = entitySqlDaoWrapperFactory.become(InvoiceParentChildrenSqlDao.class); final List<InvoiceParentChildModelDao> mappings = invoiceParentChildrenSqlDao.getParentChildMappingsByChildInvoiceIds(ImmutableList.of(invoice.getId().toString()), childContext); if (mappings.isEmpty()) { return; } <START> Preconditions.checkState(mappings.size() == 1, String.format("Expected only one parent mapping for invoice", invoice.getId())); <END> final UUID parentInvoiceId = mappings.get(0).getParentInvoiceId(); final InvoiceSqlDao invoiceSqlDao = entitySqlDaoWrapperFactory.become(InvoiceSqlDao.class); final InvoiceModelDao parentInvoice = invoiceSqlDao.getById(parentInvoiceId.toString(), childContext); final Long parentAccountRecordId = internalCallContextFactory.getRecordIdFromObject(parentInvoice.getAccountId(), ObjectType.ACCOUNT, internalCallContextFactory.createTenantContext(childContext)); final InternalTenantContext parentContext = internalCallContextFactory.createInternalTenantContext(childContext.getTenantRecordId(), parentAccountRecordId); populateChildren(parentInvoice, invoicesTags, entitySqlDaoWrapperFactory, parentContext); invoice.addParentInvoice(parentInvoice); }</code><technical_language>Missing format parameter in String.format (also, Preconditions.checkState call String.format for - check varargs signature one)</technical_language>

Target:
private void setParentInvoice(final InvoiceModelDao invoice, final List<Tag> invoicesTags, final EntitySqlDaoWrapperFactory entitySqlDaoWrapperFactory, final InternalTenantContext childContext) { final InvoiceParentChildrenSqlDao invoiceParentChildrenSqlDao = entitySqlDaoWrapperFactory.become(InvoiceParentChildrenSqlDao.class); final List<InvoiceParentChildModelDao> mappings = invoiceParentChildrenSqlDao.getParentChildMappingsByChildInvoiceIds(ImmutableList.of(invoice.getId().toString()), childContext); if (mappings.isEmpty()) { return; } Preconditions.checkState(mappings.size() == 1, String.format("Expected only one parent mapping for invoice %s", invoice.getId())); final UUID parentInvoiceId = mappings.get(0).getParentInvoiceId(); final InvoiceSqlDao invoiceSqlDao = entitySqlDaoWrapperFactory.become(InvoiceSqlDao.class); final InvoiceModelDao parentInvoice = invoiceSqlDao.getById(parentInvoiceId.toString(), childContext); final Long parentAccountRecordId = internalCallContextFactory.getRecordIdFromObject(parentInvoice.getAccountId(), ObjectType.ACCOUNT, internalCallContextFactory.createTenantContext(childContext)); final InternalTenantContext parentContext = internalCallContextFactory.createInternalTenantContext(childContext.getTenantRecordId(), parentAccountRecordId); populateChildren(parentInvoice, invoicesTags, entitySqlDaoWrapperFactory, parentContext); invoice.addParentInvoice(parentInvoice); }
Source:
<code>public SystemExitException usage(String error) { <START> err.println("Usage: " + programName + " projects [project]"); <END> showCommonOptions(); return systemExit(error); }</code><technical_language>[project] -> [name] workflows command</technical_language>

Target:
public SystemExitException usage(String error) { err.println("Usage: " + programName + " projects [name]"); showCommonOptions(); return systemExit(error); }
Source:
<code>public Response act(final Request req) throws IOException { final Href href = new RqHref.Base(req).href(); final Iterator<String> token = href.param("token").iterator(); String tokenkey = ""; final Inbox inbox; <START> long number = 0; <END> while (token.hasNext()) { tokenkey = token.next(); } if (tokenkey.isEmpty()) { inbox = new RqAlias(this.base, req).alias().inbox(); } else if (this.tokens.containsKey(tokenkey)) { final Object[] cache = this.tokens.get(tokenkey); final Date today = new Date(); final long diff = today.getTime() - ((Date) cache[0]).getTime(); if ((TimeUnit.MILLISECONDS.toDays(diff)) <= 2) { inbox = (Inbox) cache[1]; } else { this.tokens.remove(tokenkey); inbox = new RqAlias(this.base, req).alias().inbox(); } } else { inbox = new RqAlias(this.base, req).alias().inbox(); this.tokens.put(tokenkey, new Object[] {new Date(), inbox}); } number = inbox.start(); final Bout bout = inbox.bout(number); final StringBuilder msg = new StringBuilder( String.format("new bout #%d started", number) ); this.rename(bout, msg, href); this.invite(bout, msg, href); final Iterator<String> post = href.param("post").iterator(); while (post.hasNext()) { try { bout.messages().post(post.next()); } catch (final Messages.BrokenPostException ex) { this.discard(bout); throw new RsFailure(ex); } msg.append(", message posted"); } throw new RsForward( new RsFlash(msg.toString()), new RqHref.Smart(new RqHref.Base(req)).home().path("b").path( Long.toString(number) ) ); }</code><technical_language>@prahladyeri declare this in line 110 below, assigned result of inbox.start(). final well</technical_language>

Target:
public Response act(final Request req) throws IOException { final Href href = new RqHref.Base(req).href(); final Iterator<String> token = href.param("token").iterator(); String key = ""; long diff = 0; final Inbox inbox; while (token.hasNext()) { key = token.next(); } if (key.isEmpty()) { inbox = new RqAlias(this.base, req).alias().inbox(); } else if (this.tokens.containsKey(key)) { final Pair<Date, Inbox> cached = this.tokens.get(key); diff = (new Date()).getTime() - (cached.getLeft()).getTime(); if ((TimeUnit.MILLISECONDS.toDays(diff)) <= 2) { inbox = cached.getRight(); } else { this.tokens.remove(key); inbox = new RqAlias(this.base, req).alias().inbox(); } } else { inbox = new RqAlias(this.base, req).alias().inbox(); this.tokens.put(key, Pair.of(new Date(), inbox)); } diff = (new Date()).getTime() - checked.getTime(); if ((TimeUnit.MILLISECONDS.toHours(diff)) >= 1) { checked = new Date(); clearCache(); } final long number = inbox.start(); final Bout bout = inbox.bout(number); final StringBuilder msg = new StringBuilder( String.format("new bout #%d started", number) ); this.rename(bout, msg, href); this.invite(bout, msg, href); final Iterator<String> post = href.param("post").iterator(); while (post.hasNext()) { try { bout.messages().post(post.next()); } catch (final Messages.BrokenPostException ex) { this.discard(bout); throw new RsFailure(ex); } msg.append(", message posted"); } throw new RsForward( new RsFlash(msg.toString()), new RqHref.Smart(new RqHref.Base(req)).home().path("b").path( Long.toString(number) ) ); }
Source:
<code>private void validatePositionOfPortOnContainer(String containerName, String portName) { SWTBotGefEditPart swtbotContainerEditPart = editor.getEditPart(containerName); assertNotNull("No container edit part found with the name \"" + containerName + "\"", swtbotContainerEditPart); EditPart containerSquareEP = swtbotContainerEditPart.part(); assertTrue("The parent edit part of the container label is not a AbstractBorderedShapeEditPart", containerSquareEP.getParent() instanceof AbstractBorderedShapeEditPart); final AbstractBorderedShapeEditPart containerEP = (AbstractBorderedShapeEditPart) containerSquareEP.getParent(); final AbstractDiagramBorderNodeEditPart portEP = findPortInContainer(containerEP, portName); assertNotNull("No port edit part found with the name \"" + portName + "\"", portEP); if (ARE_PINNED_PORTS) { pinDiagramElement((DDiagramElement) ((Node) portEP.getModel()).getElement()); } boolean validateEdgeFromPortDoesNotCrossParentContainer = validateEdgeFromPortDoesNotCrossParentContainer(containerEP, portEP); assertTrue("The port " + portName + " has an edge that cross the parent container " + containerName, validateEdgeFromPortDoesNotCrossParentContainer); boolean <START> validateEdgeFromPortHaveBendpointsReseted = <END> validateEdgeFromPortHaveBendpointsReseted(containerEP, portEP); assertTrue("The port " + portName + " has an edge that don't have its bendpoints reseted " + containerName, validateEdgeFromPortHaveBendpointsReseted); }</code><technical_language>validateEdgeFromPortHaveBendpointsReset</technical_language>

Target:
private void validatePositionOfPortOnContainer(String containerName, String portName) { SWTBotGefEditPart swtbotContainerEditPart = editor.getEditPart(containerName); assertNotNull("No container edit part found with the name \"" + containerName + "\"", swtbotContainerEditPart); EditPart containerSquareEP = swtbotContainerEditPart.part(); assertTrue("The parent edit part of the container label is not a AbstractBorderedShapeEditPart", containerSquareEP.getParent() instanceof AbstractBorderedShapeEditPart); final AbstractBorderedShapeEditPart containerEP = (AbstractBorderedShapeEditPart) containerSquareEP.getParent(); final AbstractDiagramBorderNodeEditPart portEP = findPortInContainer(containerEP, portName); assertNotNull("No port edit part found with the name \"" + portName + "\"", portEP); if (ARE_PINNED_PORTS) { pinDiagramElement((DDiagramElement) ((Node) portEP.getModel()).getElement()); } boolean validateEdgeFromPortDoesNotCrossParentContainer = validateEdgeFromPortDoesNotCrossParentContainer(containerEP, portEP); assertTrue("The port " + portName + " has an edge that cross the parent container " + containerName, validateEdgeFromPortDoesNotCrossParentContainer); boolean validateEdgeFromPortHaveBendpointsReset = validateEdgeFromPortHaveBendpointsReset(containerEP, portEP); assertTrue("The port " + portName + " has an edge that don't have its bendpoints reset " + containerName, validateEdgeFromPortHaveBendpointsReset); }
Source:
<code><START> private SecurityGroup generateSecurityGroup(ClaudiaData claudiaData, TierInstance tierInstance) throws EntityNotFoundException { <END> SecurityGroup securityGroup = new SecurityGroup(); securityGroup.setName("sg_" + claudiaData.getService() + "_" + claudiaData.getVdc() + "_" + tierInstance.getName()); log.info("Generate Object Security Group " + "sg_" + claudiaData.getService() + "_" + claudiaData.getVdc() + "_" + tierInstance.getTier().getRegion() + "_" + tierInstance.getName()); List<Rule> rules = getDefaultRules(); if (tierInstance.getTier().getProductReleases() != null) { for (ProductRelease productRelease : tierInstance.getTier().getProductReleases()) { getRulesFromProduct(productRelease, rules); } } securityGroup.setRules(rules); return securityGroup; }</code><technical_language>120 chars</technical_language>

Target:
private SecurityGroup generateSecurityGroup(ClaudiaData claudiaData, TierInstance tierInstance) throws EntityNotFoundException { SecurityGroup securityGroup = new SecurityGroup(); securityGroup.setName("sg_" + claudiaData.getService() + "_" + claudiaData.getVdc() + "_" + tierInstance.getName()); log.info("Generate Object Security Group " + "sg_" + claudiaData.getService() + "_" + claudiaData.getVdc() + "_" + tierInstance.getTier().getRegion() + "_" + tierInstance.getName()); List<Rule> rules = getDefaultRules(); List<ProductRelease> productReleases = tierInstance.getTier().getProductReleases(); if (productReleases != null) { for (ProductRelease productRelease : tierInstance.getTier().getProductReleases()) { getRulesFromProduct(productRelease, rules); } } securityGroup.setRules(rules); return securityGroup; }
Source:
<code>public Integer fromProto(Commons.IPSubnet value, Type clazz) { return <START> IPv4Addr.apply(value.getAddress()).toInt(); <END> }</code><technical_language>Mask prefix of subnet</technical_language>

Target:
public Integer fromProto(Commons.IPSubnet value, Type clazz) { return new IPv4Subnet(value.getAddress(), value.getPrefixLength()) .getIntAddress(); }
Source:
<code>public void close() throws IOException { databases.clear(); functions.clear(); indexes.clear(); <START> indexes.clear(); <END> }</code><technical_language>variable indexes is cleared twice</technical_language>

Target:
public void close() throws IOException { databases.clear(); functions.clear(); indexes.clear(); }
Source:
<code>void setItemName(String name) { <START> if (name != null && !name.trim().isEmpty()) { <END> nameLabel.setText(name + ":"); } else { nameLabel.setText(name); } }</code><technical_language>check for if name ends ':' do a double one</technical_language>

Target:
void setItemName(String name) { if (name != null && !name.trim().isEmpty() && !name.endsWith(":")) { nameLabel.setText(name + ":"); } else { nameLabel.setText(name); } }
Source:
<code>public static void updateSettingsBasedOnCurrentSystemProperties() { ourOptmizeSingleElementInExpression = !("true".equals(System.getProperty(HFJ_FORCE_IN_CLAUSES_HF_50))); <START> if (ourOptmizeSingleElementInExpression) { <END> ourLog.warn("Forcing IN(..) clauses for single element SQL predicates"); } }</code><technical_language>I this if needs reversed. if (!ourO..</technical_language>

Target:
public static void updateSettingsBasedOnCurrentSystemProperties() { ourOptmizeSingleElementInExpression = !("true".equals(System.getProperty(HFJ_FORCE_IN_CLAUSES_HF_50))); if (!ourOptmizeSingleElementInExpression) { ourLog.warn("Forcing IN(..) clauses for single element SQL predicates"); } }
Source:
<code>public void writeToParcel(Parcel parcel, int flags) { parcel.writeString(namespace); parcel.writeString(text); parcel.writeString(fragment); <START> parcel.writeParcelable(properties, flags); <END> parcel.writeParcelable(site, flags); parcel.writeString(thumbUrl); parcel.writeString(description); }</code><technical_language>this line site</technical_language>

Target:
public void writeToParcel(Parcel parcel, int flags) { parcel.writeString(namespace); parcel.writeString(text); parcel.writeString(fragment); parcel.writeParcelable(site, flags); if (hasProperties()) { parcel.writeParcelable(properties, flags); } parcel.writeString(thumbUrl); parcel.writeString(description); }
Source:
<code>public void testBodyConversion() throws Throwable { try ( Connection conn = cf.createConnection(); ) { Session sess = conn.createSession(); MessageProducer producer = sess.createProducer(queue); MessageConsumer cons = sess.createConsumer(queue); conn.start(); BytesMessage bytesMessage = sess.createBytesMessage(); producer.send(bytesMessage); Message msg = cons.receiveNoWait(); <START> if (conn instanceof org.apache.qpid.jms.JmsConnection) { <END> Assert.assertEquals(null, msg.getBody(String.class)); } else if (conn instanceof org.apache.activemq.artemis.jms.client.ActiveMQConnection) { try { msg.getBody(String.class); fail("Exception expected"); } catch (Exception e) { } } } }</code><technical_language>this kept</technical_language>

Target:
public void testBodyConversion() throws Throwable { try ( Connection conn = cf.createConnection(); ) { Session sess = conn.createSession(); MessageProducer producer = sess.createProducer(queue); MessageConsumer cons = sess.createConsumer(queue); conn.start(); BytesMessage bytesMessage = sess.createBytesMessage(); BytesMessage bytesMessage2 = sess.createBytesMessage(); bytesMessage2.writeInt(42); bytesMessage2.reset(); producer.send(bytesMessage); Message msg = cons.receiveNoWait(); producer.send(bytesMessage2); Message msg2 = cons.receiveNoWait(); assertNotNull(msg); assertNotNull(msg2); Assert.assertNull(msg.getBody(java.lang.Object.class)); Assert.assertNull(msg.getBody(byte[].class)); Assert.assertNull(msg.getBody(String.class)); Assert.assertNotNull(msg2.getBody(byte[].class)); Assert.assertNotNull(msg2.getBody(java.lang.Object.class)); } }
Source:
<code>private Germplasm generateTestGermplasm(final int gid, final int methodId) { final Germplasm germplasm = new Germplasm(); germplasm.setGid(gid); germplasm.setGnpgs(2); final Method method = new Method(methodId); if(methodId > 1) { method.setMname("Backcross"); <START> germplasm.setGpid1(0); <END> germplasm.setGpid2(0); } germplasm.setMethod(method); germplasm.setMethodId(methodId); this.germplasmMap.put(new CropGermplasmKey(AncestryTreeServiceTest.MAIZE, gid), germplasm); this.methodsMap.put(new CropMethodKey(AncestryTreeServiceTest.MAIZE, methodId), method); return germplasm; }</code><technical_language>non-zero parent GIDs</technical_language>

Target:
private Germplasm generateTestGermplasm(final int gid, final int methodId) { final Germplasm germplasm = new Germplasm(); germplasm.setGid(gid); germplasm.setGnpgs(2); final Method method = new Method(methodId); germplasm.setMethod(method); germplasm.setMethodId(methodId); this.germplasmMap.put(new CropGermplasmKey(AncestryTreeServiceTest.MAIZE, gid), germplasm); this.methodsMap.put(new CropMethodKey(AncestryTreeServiceTest.MAIZE, methodId), method); return germplasm; }
Source:
<code>public DatastreamTaskImpl(DatastreamTaskImpl predecessor, Collection<String> partitionsV2) { if (!predecessor.isLocked() && !predecessor.getPartitionsV2().isEmpty()) { throw new DatastreamTransientException("task " + predecessor.getDatastreamTaskName() + " is not locked, " + "the previous assignment has not be picked up"); } _datastreams = predecessor._datastreams; _taskPrefix = predecessor._taskPrefix; _connectorType = predecessor._connectorType; _id = UUID.randomUUID().toString(); _transportProviderName = predecessor._transportProviderName; _partitions = new ArrayList<>(); <START> _partitionsV2 = new ArrayList<>(partitionsV2); <END> _zkAdapter = predecessor._zkAdapter; _eventProducer = predecessor._eventProducer; _checkpoints = predecessor._checkpoints; _transportProviderName = predecessor._transportProviderName; _destinationSerDes = predecessor._destinationSerDes; _dependencies = new ArrayList<>(); _dependencies.add(predecessor.getDatastreamTaskName()); if (partitionsV2.size() > MAX_PARTITION_NUM) { LOG.warn("It's suggest to keep the the size of parition v2 under to avoid hitting Znode size limit" , MAX_PARTITION_NUM); } }</code><technical_language>if task is created v1 partition v2? for example, <LINK_0> _partitions _partitionsV2 empty</technical_language>

Target:
public DatastreamTaskImpl(DatastreamTaskImpl predecessor, Collection<String> partitionsV2) { if (!predecessor.isLocked() && !predecessor.getPartitionsV2().isEmpty()) { throw new DatastreamTransientException("task " + predecessor.getDatastreamTaskName() + " is not locked, " + "the previous assignment has not been picked up"); } _datastreams = predecessor._datastreams; _taskPrefix = predecessor._taskPrefix; _connectorType = predecessor._connectorType; _id = UUID.randomUUID().toString(); _transportProviderName = predecessor._transportProviderName; _partitions = new ArrayList<>(); _partitionsV2 = new ArrayList<>(partitionsV2); _zkAdapter = predecessor._zkAdapter; _eventProducer = predecessor._eventProducer; _checkpoints = predecessor._checkpoints; _transportProviderName = predecessor._transportProviderName; _destinationSerDes = predecessor._destinationSerDes; _dependencies = new ArrayList<>(); _dependencies.add(predecessor.getDatastreamTaskName()); }
Source:
<code>private static OutputStream buildOutputStream(final File outputFile, final boolean createMd5, final boolean createIndex) throws IOException { OutputStream outputStream = new FileOutputStream(outputFile); if (createMd5) outputStream = new Md5CalculatingOutputStream(outputStream, new File(outputFile.getAbsolutePath() + ".md5")); if (createIndex) <START> outputStream = new StreamInflatingIndexingOutputStream(outputStream, new File(outputFile.getParentFile(), IOUtil.basename(outputFile) + BAMIndex.BAMIndexSuffix)); <END> return outputStream; }</code><technical_language>Move line if enclose in curly braces</technical_language>

Target:
private static OutputStream buildOutputStream(final File outputFile, final boolean createMd5, final boolean createIndex) throws IOException { OutputStream outputStream = new FileOutputStream(outputFile); if (createMd5) { outputStream = new Md5CalculatingOutputStream(outputStream, new File(outputFile.getAbsolutePath() + ".md5")); } if (createIndex) { outputStream = new StreamInflatingIndexingOutputStream(outputStream, new File(outputFile.getParentFile(), IOUtil.basename(outputFile) + BAMIndex.BAMIndexSuffix)); } return outputStream; }
Source:
<code>public BoundListTreeImpl newBounds(TypeTree classType, Optional<List<Tuple<InternalSyntaxToken, Tree>>> rests) { ImmutableList.Builder<Tree> classTypes = ImmutableList.builder(); classTypes.add(classType); if (rests.isPresent()) { for (Tuple<InternalSyntaxToken, Tree> rest : rests.get()) { <START> classTypes.add(rest.second()); <END> } } return new BoundListTreeImpl(classTypes.build(), Lists.<AstNode>newArrayList()); }</code><technical_language>![MAJOR](<LINK_1> this line start column 9. [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
public BoundListTreeImpl newBounds(TypeTree classType, Optional<List<Tuple<InternalSyntaxToken, Tree>>> rests) { ImmutableList.Builder<Tree> classTypes = ImmutableList.builder(); classTypes.add(classType); if (rests.isPresent()) { for (Tuple<InternalSyntaxToken, Tree> rest : rests.get()) { classTypes.add(rest.second()); } } return new BoundListTreeImpl(classTypes.build()); }
Source:
<code>public static void setup() { <START> WaitUtils.waitForJobs(); <END> SWTBotTreeItem tracesFolder = SWTBotUtils.selectTracesFolder(fBot, PROJECT_NAME); tracesFolder.contextMenu().menu("Open As Experiment...", "Generic Experiment").click(); SWTBotUtils.activateEditor(fBot, "Experiment"); SWTBotTreeItem project = SWTBotUtils.selectProject(fBot, PROJECT_NAME); SWTBotTreeItem experimentItem = SWTBotUtils.getTraceProjectItem(fBot, project, "Experiments", "Experiment"); experimentItem.select(); TmfTraceManager traceManager = TmfTraceManager.getInstance(); ITmfTrace trace = traceManager.getActiveTrace(); assertTrue(String.valueOf(trace), trace instanceof TmfExperiment); TmfExperiment experiment = (TmfExperiment) trace; assertNotNull(experiment); ITmfProjectModelElement elem = TmfProjectRegistry.findElement(experiment.getResource(), true); assertTrue(elem instanceof TmfExperimentElement); fOriginalExperiment = experiment; TmfTimeRange traceCutRange = getTraceCutRange(experiment); assertNotNull(traceCutRange); fRequestedTraceCutRange = traceCutRange; ITmfTimestamp requestedTraceCutEnd = traceCutRange.getEndTime(); ITmfTimestamp requestedTraceCutStart = traceCutRange.getStartTime(); assertTrue(experiment.getTimeRange().contains(traceCutRange)); TmfSignalManager.dispatchSignal(new TmfSelectionRangeUpdatedSignal(null, requestedTraceCutStart, requestedTraceCutEnd, experiment)); experimentItem.contextMenu("Export Time Selection as New Trace...").click(); SWTBotShell shell = fBot.shell("Export trace section to...").activate(); SWTBot dialogBot = shell.bot(); assertEquals("Experiment", dialogBot.text().getText()); dialogBot.text().setText("Experiment-trimmed"); dialogBot.button("OK").click(); SWTBotEditor newExperiment = fBot.editorByTitle("Experiment-trimmed"); newExperiment.setFocus(); fNewExperiment = traceManager.getActiveTrace(); assertNotNull("No active trace", fNewExperiment); assertEquals("Incorrect active trace", "Experiment-trimmed", fNewExperiment.getName()); WaitUtils.waitForJobs(); }</code><technical_language>remove this line is called in beforeClass()</technical_language>

Target:
public void setup() { ITmfTimestamp requestedTraceCutEnd = fRequestedTraceCutRange.getEndTime(); ITmfTimestamp requestedTraceCutStart = fRequestedTraceCutRange.getStartTime(); assertTrue(fOriginalExperiment.getTimeRange().contains(fRequestedTraceCutRange)); TmfSignalManager.dispatchSignal(new TmfSelectionRangeUpdatedSignal(this, requestedTraceCutStart, requestedTraceCutEnd, fOriginalExperiment)); fexperimentItem.contextMenu("Export Time Selection as New Trace...").click(); SWTBotShell shell = fBot.shell("Export trace section to...").activate(); SWTBot dialogBot = shell.bot(); assertEquals("Experiment", dialogBot.text().getText()); dialogBot.text().setText("Experiment-trimmed"); dialogBot.button("OK").click(); SWTBotEditor newExperiment = fBot.editorByTitle("Experiment-trimmed"); newExperiment.setFocus(); fNewExperiment = ftraceManager.getActiveTrace(); assertNotNull("No active trace", fNewExperiment); assertEquals("Incorrect active trace", "Experiment-trimmed", fNewExperiment.getName()); WaitUtils.waitForJobs(); }
Source:
<code>public List<Agent> getAllAgents() { return ((List<Agent>) transactionTemplate.execute((TransactionCallback) transactionStatus -> { Query query = sessionFactory.getCurrentSession().createQuery("FROM Agent where deleted = false"); query.setCacheable(true); try { return query.list(); } catch (Exception e) { <START> return emptyList(); <END> } })); }</code><technical_language>silently failing here, log add a server health message</technical_language>

Target:
public List<Agent> getAllAgents() { return ((List<Agent>) transactionTemplate.execute((TransactionCallback) transactionStatus -> { try { Query query = sessionFactory.getCurrentSession().createQuery("FROM Agent where deleted = false"); query.setCacheable(true); return query.list(); } catch (Exception e) { bomb("Error while retrieving list of all agents from DB.", e); } return emptyList(); })); }
Source:
<code><START> public void licenceFile(String textToShow, File licenceFile) throws ScriptFailureException, CancelException { <END> try { final FileInputStream content = new FileInputStream(licenceFile); final StringWriter writer = new StringWriter(); IOUtils.copy(content, writer, "UTF-8"); content.close(); licence(textToShow, writer.toString()); } catch (IOException e) { throw new ScriptFailureException("Cannot acces the licence file", e); } }</code><technical_language>need throw ScriptFailureException</technical_language>

Target:
public void licenceFile(String textToShow, File licenceFile) throws CancelException { try { final FileInputStream content = new FileInputStream(licenceFile); final StringWriter writer = new StringWriter(); IOUtils.copy(content, writer, "UTF-8"); content.close(); licence(textToShow, writer.toString()); } catch (IOException e) { throw new ScriptFailureException("Cannot acces the licence file", e); } }
Source:
<code>private static String getPropertiesUpdateMessage(String msg, String key, String oldValue, String newValue) { StringBuilder buffer = new StringBuilder(); <START> buffer.append(msg); <END> buffer.append(key); buffer.append(" from "); buffer.append(oldValue); buffer.append(" to "); buffer.append(newValue); buffer.append("."); return buffer.toString(); }</code><technical_language>optional: buffer.append(msg).append(key).append("...")</technical_language>

Target:
private static String getPropertiesUpdateMessage(String msg, String key, String oldValue, String newValue) { StringBuilder buffer = new StringBuilder(); buffer.append(msg).append(key).append(" from ").append(oldValue).append(" to ").append(newValue).append("."); return buffer.toString(); }
Source:
<code>private static void fetchDependencies(@NotNull final VirtualFile projectRoot, @NotNull final String mixPath){ final Project project = ProjectImportBuilder.getCurrentProject(); String sdkPath = project != null ? ElixirSdkType.getSdkPath(project) : null; final String elixirPath = sdkPath != null ? JpsElixirSdkType.getScriptInterpreterExecutable(sdkPath).getAbsolutePath() : JpsElixirSdkType.getExecutableFileName(JpsElixirSdkType.SCRIPT_INTERPRETER); ProgressManager.getInstance().run(new Task.Modal(project, "Fetching dependencies", true){ @Override public void run(@NotNull final ProgressIndicator indicator) { indicator.setIndeterminate(true); GeneralCommandLine commandLine = new GeneralCommandLine(); commandLine.withWorkDirectory(projectRoot.getCanonicalPath()); commandLine.setExePath(elixirPath); commandLine.addParameter(mixPath); commandLine.addParameter("deps.get"); try{ OSProcessHandler handler = new OSProcessHandler(commandLine.createProcess(), commandLine.getPreparedCommandLine(Platform.current())); handler.addProcessListener(new ProcessAdapter() { @Override public void onTextAvailable(ProcessEvent event, Key outputType) { String text = event.getText(); indicator.setText2(text); } }); ProcessTerminatedListener.attach(handler); handler.startNotify(); handler.waitFor(); <START> indicator.setText2("Rfreshing"); <END> }catch (ExecutionException e){ LOG.warn(e); } } }); }</code><technical_language>[x] Typo: missing 'e' in "Refreshing". If this is based another plugin, please open issue PR fix typo too</technical_language>

Target:
private static void fetchDependencies(@NotNull final VirtualFile projectRoot, @NotNull final String mixPath){ final Project project = ProjectImportBuilder.getCurrentProject(); String sdkPath = project != null ? ElixirSdkType.getSdkPath(project) : null; final String elixirPath = sdkPath != null ? JpsElixirSdkType.getScriptInterpreterExecutable(sdkPath).getAbsolutePath() : JpsElixirSdkType.getExecutableFileName(JpsElixirSdkType.SCRIPT_INTERPRETER); ProgressManager.getInstance().run(new Task.Modal(project, "Fetching dependencies", true){ @Override public void run(@NotNull final ProgressIndicator indicator) { indicator.setIndeterminate(true); GeneralCommandLine commandLine = new GeneralCommandLine(); commandLine.withWorkDirectory(projectRoot.getCanonicalPath()); commandLine.setExePath(elixirPath); commandLine.addParameter(mixPath); commandLine.addParameter("deps.get"); try{ OSProcessHandler handler = new OSProcessHandler(commandLine.createProcess(), commandLine.getPreparedCommandLine(Platform.current())); handler.addProcessListener(new ProcessAdapter() { @Override public void onTextAvailable(ProcessEvent event, Key outputType) { String text = event.getText(); indicator.setText2(text); } }); ProcessTerminatedListener.attach(handler); handler.startNotify(); handler.waitFor(); indicator.setText2("Refreshing"); }catch (ExecutionException e){ LOG.warn(e); } } }); }
Source:
<code>public CardModel create(PopularSpeciesInfo popularSpeciesInfo) { List<Pair<String, Optional<String>>> content = new ArrayList<>(); content.add(Pair.of(popularSpeciesInfo.totalExperiments() + " experiments", Optional.empty())); if(popularSpeciesInfo.baselineExperiments() > 0){ content.add(Pair.of("Baseline: " + popularSpeciesInfo.baselineExperiments(), Optional.of(urlHelpers.getExperimentsFilteredBySpeciesAndExperimentType(popularSpeciesInfo.species(), "baseline")))); } if(popularSpeciesInfo.differentialExperiments() > 0){ <START> content.add(Pair.of("Differential: " + popularSpeciesInfo.differentialExperiments() + " ", <END> Optional.of(urlHelpers.getExperimentsFilteredBySpeciesAndExperimentType(popularSpeciesInfo.species(), "differential")))); } return createCardModel(popularSpeciesInfo, CardIconType.SPECIES, content); }</code><technical_language>need blank space append end of this string</technical_language>

Target:
public CardModel create(PopularSpeciesInfo popularSpeciesInfo) { List<Pair<String, Optional<String>>> content = new ArrayList<>(); content.add(Pair.of(popularSpeciesInfo.totalExperiments() + " experiments", Optional.empty())); if(popularSpeciesInfo.baselineExperiments() > 0){ content.add(Pair.of("Baseline:" + popularSpeciesInfo.baselineExperiments(), Optional.of(urlHelpers.getExperimentsFilteredBySpeciesAndExperimentType(popularSpeciesInfo.species(), "baseline")))); } if(popularSpeciesInfo.differentialExperiments() > 0){ content.add(Pair.of("Differential:" + popularSpeciesInfo.differentialExperiments() + " ", Optional.of(urlHelpers.getExperimentsFilteredBySpeciesAndExperimentType(popularSpeciesInfo.species(), "differential")))); } return CardModel.create( CardIconType.SPECIES, popularSpeciesInfo.species(), Pair.of(StringUtils.capitalize(popularSpeciesInfo.species()), Optional.of(urlHelpers.getExperimentsFilteredBySpeciesUrl(popularSpeciesInfo.species()))), content); }
Source:
<code>@Override public boolean clean(ByteBuffer buf) { try { Object cleaner = cleanerMtd.invoke(buf); if (cleaner == null) { return false; } VoltUnsafe.invoke(invokeCleanerMtd, buf); return true; } <START> catch (IllegalAccessException | InvocationTargetException e) { <END> throw new RuntimeException("Failed to invoke direct buffer cleaner", e); } }</code><technical_language>catch is put line close } is next line. good consistent formatting easier read</technical_language>

Target:
public boolean clean(ByteBuffer buf) { try { Object cleaner = cleanerMtd.invoke(buf); if (cleaner == null) { return false; } VoltUnsafe.invoke(invokeCleanerMtd, buf); return true; } catch (IllegalAccessException | InvocationTargetException e) { throw new RuntimeException("Failed to invoke direct buffer cleaner", e); } }
Source:
<code>public static final void setPreferenceNodeId (String id) { if (fgPreferenceNodeId == null) { <START> fgPreferenceNodeId = <END> id; } }</code><technical_language>JDT compact assignement, e.g. i= 3;</technical_language>

Target:
public static final boolean setPreferenceNodeId (String id) { if (fgPreferenceNodeId == null || id == null) { fgPreferenceNodeId= id; return true; } return false; }
Source:
<code><START> public String toString() { <END> return label; }</code><technical_language>noticed, @Overrides annotation here</technical_language>

Target:
public String toString() { return !TextUtils.isEmpty(label) ? label : id; }