auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> public PlanNodeStatsEstimate calculateStats(PlanNode node, StatsProvider sourceStats, Lookup lookup, Session session, TypeProvider types) <END> { if (node instanceof RemoteSourceNode) { return calculateRemoteSourceStats((RemoteSourceNode) node, sourceStats, lookup, session, types); } return delegate.calculateStats(node, sourceStats, lookup, session, types); }</code><technical_language>move top, constructor</technical_language>

Target:
public PlanNodeStatsEstimate calculateStats(PlanNode node, StatsProvider sourceStats, Lookup lookup, Session session, TypeProvider types) { if (node instanceof RemoteSourceNode) { return calculateRemoteSourceStats((RemoteSourceNode) node, sourceStats); } return delegate.calculateStats(node, sourceStats, lookup, session, types); }
Source:
<code>public int getCategory() { <START> return 0; <END> }</code><technical_language>suggestion return Category.INFO_GATHER; Is this 'Information Gathering' is 'Injection'</technical_language>

Target:
public int getCategory() { return Category.MISC; }
Source:
<code>private boolean deleteRowIfExpired(List<Cell> cellList) throws IOException { long cellListSize = cellList.size(); if (cellListSize == 0) { return true; } Iterator<Cell> cellIterator = cellList.iterator(); Cell firstCell = cellIterator.next(); byte[] rowKey = new byte[firstCell.getRowLength()]; System.arraycopy(firstCell.getRowArray(), firstCell.getRowOffset(), rowKey, 0, firstCell.getRowLength()); boolean isRowExpired = !checkRowNotExpired(cellList); if (isRowExpired) { long ttl = ScanUtil.getPhoenixTTL(this.scan); long ts = getMaxTimestamp(cellList); <START> LOG.debug(String.format( <END> "** PHOENIX-TTL: Deleting region = %s, row = %s, delete-ts = %d, max-ts = %d ** ", region.getRegionInfo().getTable().getNameAsString(), Bytes.toString(rowKey), now - ttl, ts)); Delete del = new Delete(rowKey, now - ttl); Mutation[] mutations = new Mutation[] { del }; region.batchMutate(mutations, HConstants.NO_NONCE, HConstants.NO_NONCE); return true; } return false; }</code><technical_language>this TRACE logging instead</technical_language>

Target:
private boolean deleteRowIfExpired(List<Cell> cellList) throws IOException { long cellListSize = cellList.size(); if (cellListSize == 0) { return true; } Iterator<Cell> cellIterator = cellList.iterator(); Cell firstCell = cellIterator.next(); byte[] rowKey = new byte[firstCell.getRowLength()]; System.arraycopy(firstCell.getRowArray(), firstCell.getRowOffset(), rowKey, 0, firstCell.getRowLength()); boolean isRowExpired = !checkRowNotExpired(cellList); if (isRowExpired) { long ttl = ScanUtil.getPhoenixTTL(this.scan); long ts = ScanUtil.getMaxTimestamp(cellList); LOG.trace(String.format( "PHOENIX-TTL: Deleting row = [%s] belonging to table = %s, " + "scn = %s, now = %d, delete-ts = %d, max-ts = %d", Bytes.toString(rowKey), Bytes.toString(scanTableName), maxTimestamp != HConstants.LATEST_TIMESTAMP, now, now - ttl, ts)); Delete del = new Delete(rowKey, now - ttl); Mutation[] mutations = new Mutation[] { del }; region.batchMutate(mutations, HConstants.NO_NONCE, HConstants.NO_NONCE); return true; } return false; }
Source:
<code>public static void beforeClass() throws Exception { helperJSONTreeMap = new TreeMap<String, Object>(); helperJSONTreeMap.put("Sunrise",true); helperJSONTreeMap.put("Sunset", false); helperJSONTreeMap.put("Data", "A run to the head of the blood"); TreeMap<String,Object> organizer = new TreeMap<String, Object>(); organizer.put("Name", "Tom"); <START> organizer.put( "Sex", "Male" ); <END> helperJSONTreeMap.put( "Organizer",organizer); ArrayList<Number> fullhours = new ArrayList<Number>(); fullhours.add(1); fullhours.add(2); fullhours.add(3); fullhours.add(4); fullhours.add(5); fullhours.add(6); fullhours.add(7); fullhours.add(8); fullhours.add(9); fullhours.add(10); helperJSONTreeMap.put("FullHours", fullhours); TreeMap<String,Object> football = new TreeMap<String, Object>(); football.put("Name", "Football"); football.put("Duration", 2); football.put("DurationUnit","Hours"); TreeMap<String,Object> breakfast = new TreeMap<String, Object>(); breakfast.put("Name","Breakfast"); breakfast.put( "Duration",40); breakfast.put( "DurationUnit","Minutes"); ArrayList<String> attendees = new ArrayList<String>(); attendees.add("Jan"); attendees.add("Damien"); attendees.add("Laura"); attendees.add("Gwendolyn"); attendees.add("Roseanna"); breakfast.put( "Attendees",attendees); ArrayList<TreeMap> activities = new ArrayList<TreeMap>(); activities.add(football); activities.add(breakfast); helperJSONTreeMap.put("Activities", activities); expectedJson = FileUtils.readFileToString( TestUtils.loadFixture("fixture/json_helper_compacted.json") ); }</code><technical_language>Spacing bracket</technical_language>

Target:
public static void beforeClass() throws Exception { expectedJSONMap = new TreeMap<String, Object>(); expectedJSONMap.put("Sunrise", true); expectedJSONMap.put("Sunset", false); expectedJSONMap.put("Data", "A run to the head of the blood"); TreeMap<String,Object> organizer = new TreeMap<String, Object>(); organizer.put("Name", "Tom"); organizer.put( "Sex", "Male"); expectedJSONMap.put("Organizer", organizer); ArrayList<Number> fullhours = new ArrayList<Number>(); fullhours.add(1); fullhours.add(2); fullhours.add(3); fullhours.add(4); fullhours.add(5); fullhours.add(6); fullhours.add(7); fullhours.add(8); fullhours.add(9); fullhours.add(10); expectedJSONMap.put("FullHours", fullhours); TreeMap<String,Object> football = new TreeMap<String, Object>(); football.put("Name", "Football"); football.put("Duration", 2); football.put("DurationUnit", "Hours"); TreeMap<String,Object> breakfast = new TreeMap<String, Object>(); breakfast.put("Name","Breakfast"); breakfast.put("Duration", 40); breakfast.put("DurationUnit", "Minutes"); ArrayList<String> attendees = new ArrayList<String>(); attendees.add("Jan"); attendees.add("Damien"); attendees.add("Laura"); attendees.add("Gwendolyn"); attendees.add("Roseanna"); breakfast.put("Attendees",attendees); ArrayList<TreeMap> activities = new ArrayList<TreeMap>(); activities.add(football); activities.add(breakfast); expectedJSONMap.put("Activities", activities); expectedJson = FileUtils.readFileToString( TestUtils.loadFixture("fixture/json_helper_compacted.json") ); }
Source:
<code>private Collection generateRefactoringActions(final ISelection selection, final IEditorPart editor) { Set<AbstractEObjectRefactoringAction> allActions = Sets.newLinkedHashSet(); allActions.add(new BorderRefactoringAction(editor, selection)); allActions.add(new EdgeMappingRefactoringAction(editor, selection)); allActions.add(new GroupOnToolSectionAction(editor, selection)); allActions.add(new GroupOnToolGroupAction(editor, selection)); <START> allActions.add(new GroupOnToolGroupExtensionAction(editor, selection)); <END> return Sets.filter(allActions, new Predicate<AbstractEObjectRefactoringAction>() { public boolean apply(AbstractEObjectRefactoringAction candidateAction) { return candidateAction.isSelectionValid(); } }); }</code><technical_language>GroupIntoToolSectionAction, GroupIntoToolGroupAction, GroupIntoToolGroupExtensionAction names</technical_language>

Target:
private Collection generateRefactoringActions(final ISelection selection, final IEditorPart editor) { Set<AbstractEObjectRefactoringAction> allActions = Sets.newLinkedHashSet(); allActions.add(new BorderRefactoringAction(editor, selection)); allActions.add(new EdgeMappingRefactoringAction(editor, selection)); allActions.add(new GroupIntoToolSectionAction(editor, selection)); allActions.add(new GroupIntoToolGroupAction(editor, selection)); allActions.add(new GroupIntoToolGroupExtensionAction(editor, selection)); return Sets.filter(allActions, new Predicate<AbstractEObjectRefactoringAction>() { public boolean apply(AbstractEObjectRefactoringAction candidateAction) { return candidateAction.isSelectionValid(); } }); }
Source:
<code>public void should_cleanup_on_lbp_init_failure() throws Exception { try { DriverConfigLoader loader = SessionUtils.configLoaderBuilder() .without(DefaultDriverOption.LOAD_BALANCING_LOCAL_DATACENTER) .build(); CqlSession.builder() .addContactPoints(simulacronRule.getContactPoints()) .withConfigLoader(loader) .build(); fail("Should have thrown a DriverException for no DC with explicit contact point"); } catch (DriverException e) { } int size = 1; long maxTime = System.currentTimeMillis() + 1000; <START> while (size > 0 && System.currentTimeMillis() < maxTime) { <END> ClusterConnectionReport report = simulacronRule.cluster().getConnections(); size = report.getConnections().size(); } assertThat(size).isEqualTo(0); }</code><technical_language>This is a tight loop, sleep a bit iteration. yet, replace with: checkThat(() -> simulacronRule.cluster().getConnections().getConnections().isEmpty()) .before(1, SECONDS) .becomesTrue();</technical_language>

Target:
public void should_cleanup_on_lbp_init_failure() { try { DriverConfigLoader loader = SessionUtils.configLoaderBuilder() .without(DefaultDriverOption.LOAD_BALANCING_LOCAL_DATACENTER) .build(); CqlSession.builder() .addContactPoints(simulacronRule.getContactPoints()) .withConfigLoader(loader) .build(); fail("Should have thrown a DriverException for no DC with explicit contact point"); } catch (DriverException ignored) { } checkThat(() -> simulacronRule.cluster().getConnections().getConnections().isEmpty()) .before(1, SECONDS) .becomesTrue(); }
Source:
<code>public DiskImage(Boolean active, Date creation_date, Date last_modified_date, long actual_size, String description, Guid image_guid, String internal_drive_mapping, Guid it_guid, long size, Guid parentId, ImageStatus imageStatus, Date lastModified, String appList, VmEntityType vmEntityType, int numberOfVms, Guid quotaId, String quotaName, QuotaEnforcementTypeEnum quotaEnforcementType, boolean isQuotaDefault) { setActive(active); setCreationDate(creation_date); setLastModifiedDate(last_modified_date); actualSizeFromDiskImageDynamic = actual_size; <START> this.description = description; <END> setImageId(image_guid); setImageTemplateGuid(it_guid); setSize(size); setParentId(parentId); setImageStatus(imageStatus); setLastModified(lastModified); setAppList(appList); setVmEntityType(vmEntityType); setNumberOfVms(numberOfVms); setQuotaId(quotaId); setQuotaName(quotaName); setQuotaEnforcementType(quotaEnforcementType); setIsQuotaDefault(isQuotaDefault); }</code><technical_language>setDescription fit more, others</technical_language>

Target:
public DiskImage(Boolean active, Date creation_date, Date last_modified_date, long actual_size, String description, Guid image_guid, String internal_drive_mapping, Guid it_guid, long size, Guid parentId, ImageStatus imageStatus, Date lastModified, String appList, VmEntityType vmEntityType, int numberOfVms, Guid quotaId, String quotaName, QuotaEnforcementTypeEnum quotaEnforcementType, boolean isQuotaDefault) { setActive(active); setCreationDate(creation_date); setLastModifiedDate(last_modified_date); actualSizeFromDiskImageDynamic = actual_size; setDescription(description); setImageId(image_guid); setImageTemplateId(it_guid); setSize(size); setParentId(parentId); setImageStatus(imageStatus); setLastModified(lastModified); setAppList(appList); setVmEntityType(vmEntityType); setNumberOfVms(numberOfVms); setQuotaId(quotaId); setQuotaName(quotaName); setQuotaEnforcementType(quotaEnforcementType); setIsQuotaDefault(isQuotaDefault); }
Source:
<code>private void templateBasedExport() throws Exception { AtomicBoolean seenTemplateRow = new AtomicBoolean(false); LineBasedProcessor.create(templateFile.name(), templateFile.createInputStream()).run((rowNumber, row) -> { if (row.length() == 0) { return; } if (!dictionary.hasMappings()) { determineMappingsFromRow(rowNumber, row); } else { <START> if (!seenTemplateRow.get()) { <END> process.log(ProcessLog.info().withNLSKey("EntityExportJob.startingTemplateBasedExport")); seenTemplateRow.set(true); } handleTemplateRow(rowNumber, row); } }, error -> { process.handle(error); return true; }); if (!seenTemplateRow.get()) { fullExportWithGivenMapping(); } }</code><technical_language>Monoflop</technical_language>

Target:
private void templateBasedExport() throws Exception { Monoflop seenTemplateRow = Monoflop.create(); LineBasedProcessor.create(templateFile.name(), templateFile.createInputStream()).run((rowNumber, row) -> { if (row.length() == 0) { return; } if (!dictionary.hasMappings()) { determineMappingsFromRow(rowNumber, row); } else { if (seenTemplateRow.firstCall()) { process.log(ProcessLog.info().withNLSKey("EntityExportJob.startingTemplateBasedExport")); } handleTemplateRow(rowNumber, row); } }, error -> { process.handle(error); return true; }); if (!seenTemplateRow.isToggled()) { fullExportWithGivenMapping(); } }
Source:
<code>public SslHandler build(ByteBufAllocator bufferAllocator) throws IOException, NoSuchAlgorithmException, CertificateException { SslContextBuilder builder = SslContextBuilder.forServer(sslCertificateFile, sslKeyFile, passPhrase); <START> logger.debug("Ciphers: " + String.join(",", ciphers)); <END> builder.ciphers(Arrays.asList(ciphers)); if(requireClientAuth()) { logger.debug("Certificate Authorities: " + String.join(", ", certificateAuthorities)); builder.trustManager(loadCertificateCollection(certificateAuthorities)); } SslContext context = builder.build(); SslHandler sslHandler = context.newHandler(bufferAllocator); logger.debug("TLS: " + String.join(",", protocols)); SSLEngine engine = sslHandler.engine(); engine.setEnabledProtocols(protocols); if(requireClientAuth()) { engine.setUseClientMode(false); if(verifyMode == SslClientVerifyMode.FORCE_PEER) { engine.setNeedClientAuth(true); } else if(verifyMode == SslClientVerifyMode.VERIFY_PEER) { engine.setWantClientAuth(true); } } return sslHandler; }</code><technical_language>other logger syntax prevent happening string concatenation, also, need wrap if (logger.isDebugEnabled()) due String.join</technical_language>

Target:
public SslHandler build(ByteBufAllocator bufferAllocator) throws IOException, NoSuchAlgorithmException, CertificateException { SslContextBuilder builder = SslContextBuilder.forServer(sslCertificateFile, sslKeyFile, passPhrase); if(logger.isDebugEnabled()) logger.debug("Ciphers: ", String.join(",", ciphers)); builder.ciphers(Arrays.asList(ciphers)); if(requireClientAuth()) { if (logger.isDebugEnabled()) logger.debug("Certificate Authorities: " + String.join(", ", certificateAuthorities)); builder.trustManager(loadCertificateCollection(certificateAuthorities)); } SslContext context = builder.build(); SslHandler sslHandler = context.newHandler(bufferAllocator); if(logger.isDebugEnabled()) logger.debug("TLS: " + String.join(",", protocols)); SSLEngine engine = sslHandler.engine(); engine.setEnabledProtocols(protocols); if(requireClientAuth()) { engine.setUseClientMode(false); if(verifyMode == SslClientVerifyMode.FORCE_PEER) { engine.setNeedClientAuth(true); } else if(verifyMode == SslClientVerifyMode.VERIFY_PEER) { engine.setWantClientAuth(true); } } return sslHandler; }
Source:
<code><START> public OSImageToImage(JustProvider provider) { <END> this.provider = provider; }</code><technical_language>need this parameter here, real locations, address later</technical_language>

Target:
OSImageToImage(JustProvider provider) { this.provider = provider; }
Source:
<code>@Test public void postWithFieldParamList() throws Exception { <START> List<Object> values = new ArrayList<Object>(Arrays.asList(1, 2, "three")); <END> Request request = new Helper() .setMethod("POST") .setUrl("<LINK_1>") .setPath("/foo/bar/") .addField("key", values) .setFormEncoded() .build(); assertThat(request.getMethod()).isEqualTo("POST"); assertThat(request.getHeaders()).isEmpty(); assertThat(request.getUrl()).isEqualTo("<LINK_0>"); assertTypedBytes(request.getBody(), "key=1&key=2&key=three"); }</code><technical_language>need wrap new ArrayList</technical_language>

Target:
@Test public void postWithFieldParamList() throws Exception { List<String> values = Arrays.asList("one", "two",null, "three"); Request request = new Helper() .setMethod("POST") .setUrl("<LINK_1>") .setPath("/foo/bar/") .addField("key", values) .setFormEncoded() .build(); assertThat(request.getMethod()).isEqualTo("POST"); assertThat(request.getHeaders()).isEmpty(); assertThat(request.getUrl()).isEqualTo("<LINK_0>"); assertTypedBytes(request.getBody(), "key=one&key=two&key=three"); }
Source:
<code>private static boolean referenceByMapping( RexNode joinCondition, List<RexNode>... projectsOfInputs) { List<RexNode> projects = new ArrayList<>(); for (List<RexNode> projectsOfInput: projectsOfInputs) { projects.addAll(projectsOfInput); } try { RexVisitor rexVisitor = new RexVisitorImpl<Void>(true) { @Override public Void visitInputRef(RexInputRef inputRef) { if (!(projects.get(inputRef.getIndex()) instanceof RexInputRef)) { <START> throw new Util.FoundOne(inputRef); <END> } return super.visitInputRef(inputRef); } }; joinCondition.accept(rexVisitor); } catch (Util.FoundOne e) { return false; } return true; }</code><technical_language>I is a good candidate Util.FoundOne.NULL. do think, @julianhyde</technical_language>

Target:
private static boolean referenceByMapping( RexNode joinCondition, List<RexNode>... projectsOfInputs) { List<RexNode> projects = new ArrayList<>(); for (List<RexNode> projectsOfInput: projectsOfInputs) { projects.addAll(projectsOfInput); } try { RexVisitor rexVisitor = new RexVisitorImpl<Void>(true) { @Override public Void visitInputRef(RexInputRef inputRef) { if (!(projects.get(inputRef.getIndex()) instanceof RexInputRef)) { throw Util.FoundOne.NULL; } return super.visitInputRef(inputRef); } }; joinCondition.accept(rexVisitor); } catch (Util.FoundOne e) { return false; } return true; }
Source:
<code>public Map<String, Map<Integer, VariableType>> getStandardVariableIdsWithTypeByPropertyNames(final List<String> propertyNames) <START> throws MiddlewareQueryException { <END> final List<String> propertyNamesInUpperCase = Lists.transform(propertyNames, new Function<String, String>() { public String apply(String s) { return s.toUpperCase(); } }); try { if (!propertyNamesInUpperCase.isEmpty()) { Criteria criteria = this.getSession().createCriteria(this.getPersistentClass(), "property") .setProjection(Projections.distinct(Projections.projectionList() .add(Projections.property("alias")) .add(Projections.property("variableId")) .add(Projections.property("typeId")))); criteria.add(Restrictions.in("typeId", VariableType.ids())); criteria.add(Restrictions.in("alias", propertyNames)); criteria.createAlias("property.variable", "variable").add(Restrictions.eq("variable.isObsolete", 0)); List<Object[]> results = criteria.list(); return convertToVariablestandardVariableIdsWithTypeMap(results); } } catch (HibernateException e) { this.logAndThrowException( "Error in getStandardVariableIdsWithTypeByPropertyNames=" + propertyNames + " in ProjectPropertyDao: " + e.getMessage(), e); } return new HashMap<String, Map<Integer, VariableType>>(); }</code><technical_language>Cleanup: Remove **throws MiddlewareQueryException** clauses</technical_language>

Target:
public Map<String, Map<Integer, VariableType>> getStandardVariableIdsWithTypeByPropertyNames(final List<String> propertyNames) { final List<String> propertyNamesInUpperCase = Lists.transform(propertyNames, new Function<String, String>() { public String apply(String s) { return s.toUpperCase(); } }); try { if (!propertyNamesInUpperCase.isEmpty()) { Criteria criteria = this.getSession().createCriteria(this.getPersistentClass(), "property") .setProjection(Projections.distinct(Projections.projectionList() .add(Projections.property("alias")) .add(Projections.property("variableId")) .add(Projections.property("typeId")))); criteria.add(Restrictions.in("typeId", VariableType.ids())); criteria.add(Restrictions.in("alias", propertyNames)); criteria.createAlias("property.variable", "variable").add(Restrictions.eq("variable.isObsolete", 0)); List<Object[]> results = criteria.list(); return convertToVariablestandardVariableIdsWithTypeMap(results); } } catch (HibernateException e) { this.logAndThrowException( "Error in getStandardVariableIdsWithTypeByPropertyNames=" + propertyNames + " in ProjectPropertyDao: " + e.getMessage(), e); } return new HashMap<String, Map<Integer, VariableType>>(); }
Source:
<code>public PlayerBackpack(@Nonnull PlayerProfile profile, int id) { <START> this(profile, id, profile.getConfig().getInt(PlayerBackpack.backpacks + id + ".size")); <END> for (int i = 0; i < size; i++) { inventory.setItem(i, cfg.getItem(PlayerBackpack.backpacks + id + ".contents." + i)); } }</code><technical_language>PlayerBackpack is redundant here, need class in</technical_language>

Target:
public PlayerBackpack(@Nonnull PlayerProfile profile, int id) { this(profile, id, profile.getConfig().getInt(CONFIG_PREFIX + id + ".size")); for (int i = 0; i < size; i++) { inventory.setItem(i, cfg.getItem(CONFIG_PREFIX + id + ".contents." + i)); } }
Source:
<code>public void testPutRemovePut() { Map<byte[], byte[]> map = cache(0); byte[] key = randomBytes(KEY_SIZE); byte[] value = randomBytes(VALUE_SIZE); byte[] value2 = randomBytes(VALUE_SIZE); assertNull(map.put(key, value)); <START> for (int i = 0; i < 0; ++i) { <END> map.put(randomBytes(KEY_SIZE), value); } assertEquals(value, map.remove(key)); assertNull(map.put(key, value)); assertEquals(value, map.remove(key)); assertNull(map.put(key, value2)); }</code><technical_language>Interesting loop :)</technical_language>

Target:
public void testPutRemovePut() { Map<byte[], byte[]> map = cache(0); byte[] key = randomBytes(KEY_SIZE); byte[] value = randomBytes(VALUE_SIZE); byte[] value2 = randomBytes(VALUE_SIZE); assertNull(map.put(key, value)); for (int i = 0; i < 50; ++i) { map.put(randomBytes(KEY_SIZE), value); } assertEquals(value, map.remove(key)); assertNull(map.put(key, value)); assertEquals(value, map.remove(key)); assertNull(map.put(key, value2)); }
Source:
<code><START> public IdentificationNumber(final String last8Digits) { <END> validateLast8Digits(last8Digits); if (StringUtils.isBlank(last8Digits)) { this.last8Digits = null; } else { this.last8Digits = String.format("%08d", Integer.valueOf(last8Digits)); } }</code><technical_language>this changed public? do test? I do code it</technical_language>

Target:
private IdentificationNumber(final String last8Digits) { validateLast8Digits(last8Digits); if (StringUtils.isBlank(last8Digits)) { this.last8Digits = null; } else { this.last8Digits = String.format("%08d", Integer.valueOf(last8Digits)); } }
Source:
<code>void removeNestedCopyfiles() { for (RepoProject proj : filteredProjects) { List<CopyFile> copyfiles = <START> new ArrayList<CopyFile>(); <END> copyfiles.addAll(proj.getCopyFiles()); proj.clearCopyFiles(); Iterator<CopyFile> iter = copyfiles.iterator(); while (iter.hasNext()) { if (isNestedCopyfile(iter.next())) iter.remove(); } proj.addCopyFiles(copyfiles); } }</code><technical_language>optional: new ArrayList<>()</technical_language>

Target:
void removeNestedCopyfiles() { for (RepoProject proj : filteredProjects) { List<CopyFile> copyfiles = new ArrayList<>(); copyfiles.addAll(proj.getCopyFiles()); proj.clearCopyFiles(); Iterator<CopyFile> iter = copyfiles.iterator(); while (iter.hasNext()) { if (isNestedCopyfile(iter.next())) { iter.remove(); } } proj.addCopyFiles(copyfiles); } }
Source:
<code>public String toString() { StringBuilder sb = new StringBuilder(); sb.append(partitionId); sb.append(" ServerErrorCode=").append(errorCode); if (errorCode == ServerErrorCode.No_Error) { <START> int size = messageInfoAndMetadataListSerde.getMessageInfoList().size(); <END> sb.append(" Token=").append(token); sb.append(" MessageInfoListSize=").append(size); sb.append(" MessagesTotalSize=").append(totalSizeOfAllMessages); sb.append(" MessageInfoListFirstId=") .append(messageInfoAndMetadataListSerde.getMessageInfoList().get(0).getStoreKey()); sb.append(" MessageInfoListLastId=") .append(messageInfoAndMetadataListSerde.getMessageInfoList().get(size - 1).getStoreKey()); sb.append(" RemoteReplicaLagInBytes=").append(remoteReplicaLagInBytes); } return sb.toString(); }</code><technical_language>I extract messageInfoAndMetadataListSerde.getMessageInfoList() a local variable is referenced a times</technical_language>

Target:
public String toString() { StringBuilder sb = new StringBuilder(); sb.append(partitionId); sb.append(" ServerErrorCode=").append(errorCode); if (errorCode == ServerErrorCode.No_Error) { List<MessageInfo> messageInfos = messageInfoAndMetadataListSerde.getMessageInfoList(); int size = messageInfos.size(); sb.append(" Token=").append(token); sb.append(" MessageInfoListSize=").append(size); sb.append(" MessagesTotalSize=").append(totalSizeOfAllMessages); sb.append(" MessageInfoListFirstId=").append(messageInfos.get(0).getStoreKey()); sb.append(" MessageInfoListLastId=").append(messageInfos.get(size - 1).getStoreKey()); sb.append(" RemoteReplicaLagInBytes=").append(remoteReplicaLagInBytes); } return sb.toString(); }
Source:
<code>public void handleAction(Map<String, Object> parameters) throws IOException, ClassNotFoundException, ParserConfigurationException, SAXException { String templateName = (String) parameters.get(Constants.TEMPLATE_NAME_PARAM); String recipientName = (String) parameters.get(Constants.RECIPIENT_NAME_PARAM); CdaTemplate cdaTemplate = iheTemplateDataService.findByName(templateName); if (cdaTemplate == null) { LOGGER.error("Cannot find template", templateName); throw new TemplateNotFoundException(templateName); } HL7Recipient hl7Recipient = hl7RecipientsService.getRecipientbyName(recipientName); if (hl7Recipient == null) { LOGGER.error("Cannot find recipient", recipientName); throw new RecipientNotFoundException(templateName); } Byte[] templateData = (Byte[]) iheTemplateDataService.getDetachedField(cdaTemplate, TEMPLATE_DATA_FIELD_NAME); <START> StreamingTemplateEngine streamingTemplateEngine = new StreamingTemplateEngine(); <END> Template template = streamingTemplateEngine.createTemplate(new String(ArrayUtils.toPrimitive(templateData))); Writable writable = template.make(parameters); LOGGER.info("Template with name {}:\n{}", cdaTemplate.getTemplateName(), writable.toString()); }</code><technical_language>is a possibility test this</technical_language>

Target:
public void handleAction(Map<String, Object> parameters) throws IOException, ClassNotFoundException, ParserConfigurationException, SAXException { String templateName = (String) parameters.get(Constants.TEMPLATE_NAME_PARAM); String recipientName = (String) parameters.get(Constants.RECIPIENT_NAME_PARAM); CdaTemplate cdaTemplate = iheTemplateDataService.findByName(templateName); if (cdaTemplate == null) { LOGGER.error("Cannot find template", templateName); throw new TemplateNotFoundException(templateName); } HL7Recipient hl7Recipient = hl7RecipientsService.getRecipientbyName(recipientName); if (hl7Recipient == null) { LOGGER.error("Cannot find recipient", recipientName); throw new RecipientNotFoundException(templateName); } Byte[] templateData = (Byte[]) iheTemplateDataService.getDetachedField(cdaTemplate, TEMPLATE_DATA_FIELD_NAME); StreamingTemplateEngine streamingTemplateEngine = new StreamingTemplateEngine(); Template template = streamingTemplateEngine.createTemplate(new String(ArrayUtils.toPrimitive(templateData))); Writable writable = template.make(parameters); LOGGER.info("Template with name {}:\n{}", cdaTemplate.getTemplateName(), writable.toString()); iheTemplateService.sendTemplateToRecipientUrl(hl7Recipient.getRecipientUrl(), writable.toString()); }
Source:
<code>public void validate(FailureCollector collector) { if (Strings.isNullOrEmpty(schema)) { collector.addFailure("Schema must be specified.", null).withConfigProperty(Cassandra.SCHEMA); } if (port != null && (port < 1 || port > 65535)) { collector.addFailure("Invalid port.", "Port number must be an integer from 1 to 65535.") .withConfigProperty(BatchCassandraSink.Cassandra.PORT); } <START> if ((!containsMacro(Cassandra.USERNAME) && !containsMacro(Cassandra.PASSWORD)) && <END> Strings.isNullOrEmpty(username) ^ Strings.isNullOrEmpty(password)) { collector.addFailure("Invalid username and password combination.", "You must either set both username and password or neither username nor password.") .withConfigProperty(Cassandra.USERNAME).withConfigProperty(Cassandra.PASSWORD); } }</code><technical_language>more clear put in this way: !containsMacro(Cassandra.USERNAME) && !containsMacro(Cassandra.PASSWORD) && (Strings.isNullOrEmpty(username) ^ Strings.isNullOrEmpty(password))</technical_language>

Target:
public void validate(FailureCollector collector) { if (Strings.isNullOrEmpty(schema)) { collector.addFailure("Schema must be specified.", null).withConfigProperty(Cassandra.SCHEMA); } if (port != null && (port < 1 || port > 65535)) { collector.addFailure("Invalid port number.", "Port number must be an integer from 1 to 65535.") .withConfigProperty(BatchCassandraSink.Cassandra.PORT); } if (!containsMacro(Cassandra.USERNAME) && !containsMacro(Cassandra.PASSWORD) && Strings.isNullOrEmpty(username) ^ Strings.isNullOrEmpty(password)) { collector.addFailure("Invalid username and password combination.", "You must either set both username and password or neither username nor password.") .withConfigProperty(Cassandra.USERNAME).withConfigProperty(Cassandra.PASSWORD); } }
Source:
<code>protected void searchContacts(String query, ArrayList<SearchResult> resultList) { MainApplication.Contacts contacts = MainApplication.contacts; for (String id : MainApplication.dashboard.getUserIdsICanSee()) { String email = MainApplication.dashboard.getEmailByUserId(id); Contact contact = (contacts != null)? contacts.getContactByEmail(email) : null; String name = ""; if (contact != null) { name = contact.getName(); } <START> if (email.toLowerCase().contains(query) || name.toLowerCase().contains(query)) { <END> if(!name.isEmpty()) resultList.add(new SearchResult(ResultType.CONTACT, name, email)); else resultList.add(new SearchResult(ResultType.CONTACT, email, email)); } } }</code><technical_language>toLowerCase query</technical_language>

Target:
protected void searchContacts(String query, ArrayList<SearchResult> resultList) { MainApplication.Contacts contacts = MainApplication.contacts; for (String id : MainApplication.dashboard.getUserIdsICanSee()) { String email = MainApplication.dashboard.getEmailByUserId(id); Contact contact = (contacts != null)? contacts.getContactByEmail(email) : null; String name = ""; if (contact != null) { name = contact.getName(); } if (email.toLowerCase().contains(query.toLowerCase()) || name.toLowerCase().contains(query.toLowerCase())) { if (!name.isEmpty()) { resultList.add(new SearchResult(ResultType.CONTACT, name, email)); } else { resultList.add(new SearchResult(ResultType.CONTACT, email, email)); } } } }
Source:
<code>public int hashCode() { int pcHashCode = 0; Collection<ProductContentDTO> productContent = this.getProductContent(); if (productContent != null) { for (ProductContentDTO dto : productContent) { pcHashCode = 31 * pcHashCode + (dto != null ? dto.hashCode() : 0); } } <START> int ppHashCode = 0; Collection<ProductDTO> providedProducts = this.getProvidedProducts(); if (providedProducts != null) { for (ProductDTO dto : providedProducts) { ppHashCode = 31 * ppHashCode + (dto != null ? dto.hashCode() : 0); } } <END> HashCodeBuilder builder = new HashCodeBuilder(37, 7) .append(super.hashCode()) .append(this.getUuid()) .append(this.getId()) .append(this.getName()) .append(this.getMultiplier()) .append(this.getHref()) .append(this.getAttributes()) .append(this.getDependentProductIds()) .append(this.isLocked()) .append(this.getBranding()) .append(pcHashCode) .append(ppHashCode); return builder.toHashCode(); }</code><technical_language>Similarly equals method, need check equality in a custom way, need calculate hashcode in a custom way. add this.getProvidedProducts() in HashCodeBuilder below</technical_language>

Target:
public int hashCode() { int pcHashCode = 0; Collection<ProductContentDTO> productContent = this.getProductContent(); if (productContent != null) { for (ProductContentDTO dto : productContent) { pcHashCode = 31 * pcHashCode + (dto != null ? dto.hashCode() : 0); } } HashCodeBuilder builder = new HashCodeBuilder(37, 7) .append(super.hashCode()) .append(this.getUuid()) .append(this.getId()) .append(this.getName()) .append(this.getMultiplier()) .append(this.getHref()) .append(this.getAttributes()) .append(this.getDependentProductIds()) .append(this.isLocked()) .append(this.getBranding()) .append(this.getProvidedProducts()) .append(pcHashCode); return builder.toHashCode(); }
Source:
<code>private Block sessionPropertiesToBlock(Map<String, String> properties) { <START> BlockBuilder mapArrayBuilder = sessionPropertiesType.createBlockBuilder(null, properties.size()); <END> BlockBuilder singleMapWriter = mapArrayBuilder.beginBlockEntry(); Type keyType = sessionPropertiesType.getTypeParameters().get(0); Type valueType = sessionPropertiesType.getTypeParameters().get(1); for (Map.Entry<String, String> entry : properties.entrySet()) { appendToBlockBuilder(keyType, entry.getKey(), singleMapWriter); appendToBlockBuilder(valueType, entry.getValue(), singleMapWriter); } mapArrayBuilder.closeEntry(); return sessionPropertiesType.getObject(mapArrayBuilder, 0); }</code><technical_language>variable names pretty confusing me. @haozhun a quick suggestion</technical_language>

Target:
private Block sessionPropertiesToBlock(Map<String, String> properties) { requireNonNull(properties, "properties is null"); BlockBuilder blockBuilder = sessionPropertiesType.createBlockBuilder(null, properties.size()); BlockBuilder entryBuilder = blockBuilder.beginBlockEntry(); Type keyType = sessionPropertiesType.getTypeParameters().get(0); Type valueType = sessionPropertiesType.getTypeParameters().get(1); for (Map.Entry<String, String> entry : properties.entrySet()) { appendToBlockBuilder(keyType, entry.getKey(), entryBuilder); appendToBlockBuilder(valueType, entry.getValue(), entryBuilder); } blockBuilder.closeEntry(); return sessionPropertiesType.getObject(blockBuilder, 0); }
Source:
<code>public static long calculateChecksum(CallMessage msg, long digestSeed) { switch (msg.getChecksumType()) { case Adler32: <START> Adler32 adler32 = new Adler32(); <END> adler32.update((int) digestSeed); adler32.update(msg.getPayload().nioBuffer()); return adler32.getValue(); case FarmhashFingerPrint32: case NoChecksum: case CRC32C: CRC32 crc32 = new CRC32(); crc32.update((int) digestSeed); crc32.update(msg.getPayload().nioBuffer()); return crc32.getValue(); default: return 0; } }</code><technical_language>Do need new adler32 object time</technical_language>

Target:
public static long calculateChecksum(CallMessage msg, long digestSeed) { switch (msg.getChecksumType()) { case Adler32: Adler32 adler32 = new Adler32(); adler32.update((int) digestSeed); adler32.update(msg.getPayload().nioBuffer()); return adler32.getValue(); case CRC32C: CRC32 crc32 = new CRC32(); crc32.update((int) digestSeed); crc32.update(msg.getPayload().nioBuffer()); return crc32.getValue(); case FarmhashFingerPrint32: case NoChecksum: default: return 0; } }
Source:
<code>public Service resolveServiceFrom(final Service service) { final Optional<String> result = getEntityIdAsParameter(service); if (result.isPresent()) { final String entityId = result.get(); LOGGER.debug("Located entity id from service authentication request at [{}]", entityId, service.getId()); <START> final RegisteredService registeredService = servicesManager.findServiceBy(entityId); <END> if (registeredService != null && registeredService.getAccessStrategy() != null && registeredService.getAccessStrategy().isServiceAccessAllowed()) { return this.webApplicationServiceFactory.createService(entityId); } LOGGER.debug("Entity id not registered as individual service", entityId); } LOGGER.debug("Could not located entity id from service authentication request at [{}]", service.getId()); return service; }</code><technical_language>Remove these. AuditableExecution registeredServiceAccessStrategyEnforcer; instead</technical_language>

Target:
public Service resolveServiceFrom(final Service service) { final Optional<String> result = getEntityIdAsParameter(service); if (result.isPresent()) { final String entityId = result.get(); LOGGER.debug("Located entity id from service authentication request at [{}]", entityId, service.getId()); if (isEntityIdServiceRegistered(entityId)) { return this.webApplicationServiceFactory.createService(entityId); } LOGGER.debug("Entity id not registered as individual service", entityId); } LOGGER.debug("Could not located entity id from service authentication request at [{}]", service.getId()); return service; }
Source:
<code>protected void onInit() { super.onInit(); <START> if (this.evaluationContext == null && getBeanFactory() != null) { <END> this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory()); } ReactiveRedisTemplate template = new ReactiveRedisTemplate<>(this.connectionFactory, this.serializationContext); this.reactiveStreamOperations = this.hashMapper == null ? template.opsForStream() : template.opsForStream(this.hashMapper); }</code><technical_language>reason check for nulls - createStandardEvaluationContext() deal BeanFactory null</technical_language>

Target:
protected void onInit() { super.onInit(); this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory()); ReactiveRedisTemplate template = new ReactiveRedisTemplate<>(this.connectionFactory, this.serializationContext); this.reactiveStreamOperations = this.hashMapper == null ? template.opsForStream() : template.opsForStream(this.hashMapper); }
Source:
<code>public List<String> upscaleCluster(HostGroup hostGroup, Collection<InstanceMetaData> instanceMetaDatas) throws CloudbreakException { <START> LOGGER.debug("Invoking CM requests for upscale"); <END> int hostCount = -1; Instant start = Instant.now(); ClustersResourceApi clustersResourceApi = clouderaManagerApiFactory.getClustersResourceApi(apiClient); try { String clusterName = stack.getName(); List<String> upscaleHostNames = getUpscaleHosts(clustersResourceApi, clusterName, instanceMetaDatas); if (!upscaleHostNames.isEmpty()) { List<ApiHost> hosts = clouderaManagerApiFactory.getHostsResourceApi(apiClient).readHosts(null, null, SUMMARY).getItems(); ApiHostRefList body = createUpscaledHostRefList(upscaleHostNames, hosts); hostCount = body.getItems().size(); clustersResourceApi.addHosts(clusterName, body); activateParcel(clustersResourceApi); applyHostGroupRolesOnUpscaledHosts(body, hostGroup.getName()); } else { redistributeParcelsForRecovery(); activateParcel(clustersResourceApi); clouderaManagerRoleRefreshService.refreshClusterRoles(apiClient, stack); } return instanceMetaDatas.stream().map(InstanceMetaData::getDiscoveryFQDN).collect(Collectors.toList()); } catch (ApiException e) { LOGGER.warn("Failed to upscale: {}", e.getResponseBody(), e); throw new CloudbreakException("Failed to upscale", e); } finally { LOGGER.debug("CM upscale request finished for hosts in ms", hostCount == -1 ? "NA" : hostCount, Duration.between(start, Instant.now()).toMillis()); } }</code><technical_language>if add logging here, print parameters</technical_language>

Target:
public List<String> upscaleCluster(HostGroup hostGroup, Collection<InstanceMetaData> instanceMetaDatas) throws CloudbreakException { LOGGER.debug("Invoking CM requests for upscale for hostGroup={}, insteanceCount={}", hostGroup.getName(), instanceMetaDatas == null ? 0 : instanceMetaDatas.size()); int hostCount = -1; Instant start = Instant.now(); ClustersResourceApi clustersResourceApi = clouderaManagerApiFactory.getClustersResourceApi(apiClient); try { String clusterName = stack.getName(); List<String> upscaleHostNames = getUpscaleHosts(clustersResourceApi, clusterName, instanceMetaDatas); if (!upscaleHostNames.isEmpty()) { List<ApiHost> hosts = clouderaManagerApiFactory.getHostsResourceApi(apiClient).readHosts(null, null, SUMMARY).getItems(); ApiHostRefList body = createUpscaledHostRefList(upscaleHostNames, hosts); hostCount = body.getItems().size(); clustersResourceApi.addHosts(clusterName, body); activateParcel(clustersResourceApi); applyHostGroupRolesOnUpscaledHosts(body, hostGroup.getName()); } else { redistributeParcelsForRecovery(); activateParcel(clustersResourceApi); clouderaManagerRoleRefreshService.refreshClusterRoles(apiClient, stack); } return instanceMetaDatas.stream().map(InstanceMetaData::getDiscoveryFQDN).collect(Collectors.toList()); } catch (ApiException e) { LOGGER.warn("Failed to upscale: {}", e.getResponseBody(), e); throw new CloudbreakException("Failed to upscale", e); } finally { LOGGER.debug("CM upscale request finished for hosts in ms", hostCount == -1 ? "NA" : hostCount, Duration.between(start, Instant.now()).toMillis()); } }
Source:
<code>public String getDisplayName() { <START> return "Use of auto refresh feature"; <END> }</code><technical_language>localizable</technical_language>

Target:
public String getDisplayName() { return Messages.AutoRefresh_DisplayName(); }
Source:
<code>private void populateRuleStore() { this.ruleStore = new HashMap<>(); definition.getItems().stream().filter((item) -> item instanceof Module).forEach((item) -> { ((Module) item).getItems().stream().forEach((moduleItem) -> { Source src = moduleItem.getSource(); Location location = moduleItem.getLocation(); if (src != null && location != null) { <START> ruleStore.put(new MutablePair<>(src, location), moduleItem); <END> } }); }); }</code><technical_language>I said, I Pair.of</technical_language>

Target:
private void populateRuleStore() { this.ruleStore = new HashMap<>(); definition.getItems().stream().filter((item) -> item instanceof Module).forEach((item) -> { ((Module) item).getItems().stream().forEach((moduleItem) -> { Source src = moduleItem.getSource(); Location location = moduleItem.getLocation(); if (src != null && location != null) { ruleStore.put(Pair.of(src, location), moduleItem); } }); }); }
Source:
<code>private boolean validate(Patient patient) { boolean ferr=false, lerr=false, doberr=false, gerr=false, adderr=false; mRegisterPatientView.setErrorsVisibility(ferr, lerr, doberr, gerr, adderr); if(StringUtils.isBlank(patient.getPerson().getName().getGivenName())) { ferr=true; } if(StringUtils.isBlank(patient.getPerson().getName().getFamilyName())) { lerr=true; } if(!StringUtils.isBlank(patient.getPerson().getBirthdate())) { Calendar birthDateCalendar = Calendar.getInstance(); Long ageInMillis = DateUtils.convertTime(patient.getPerson().getBirthdate()); birthDateCalendar.setTimeInMillis(ageInMillis); int currentYear = Calendar.getInstance().get(Calendar.YEAR); int patientAge = currentYear - birthDateCalendar.get(Calendar.YEAR); if (patientAge > ApplicationConstants.RegisterPatientRequirements.MAX_PATIENT_AGE) { ToastUtil.error("Patient's age must be between 0 and " + ApplicationConstants.RegisterPatientRequirements.MAX_PATIENT_AGE); doberr = true; } <START> } <END> else { doberr = true; } if(StringUtils.isBlank(patient.getPerson().getAddress().getAddress1()) && StringUtils.isBlank(patient.getPerson().getAddress().getAddress2()) && StringUtils.isBlank(patient.getPerson().getAddress().getCityVillage()) && StringUtils.isBlank(patient.getPerson().getAddress().getStateProvince()) && StringUtils.isBlank(patient.getPerson().getAddress().getCountry()) && StringUtils.isBlank(patient.getPerson().getAddress().getPostalCode())) { adderr=true; } if (StringUtils.isBlank(patient.getPerson().getGender())) { gerr=true; } boolean result = !ferr && !lerr && !doberr && !adderr && !gerr; if (result) { mPatient = patient; return true; } else { mRegisterPatientView.setErrorsVisibility(ferr, lerr, doberr, adderr, gerr); return false; } }</code><technical_language>Put validation logic in class, extract RegisterPatientFragment</technical_language>

Target:
private boolean validate(Patient patient) { boolean ferr=false, lerr=false, doberr=false, gerr=false, adderr=false; mRegisterPatientView.setErrorsVisibility(ferr, lerr, doberr, gerr, adderr); if(StringUtils.isBlank(patient.getPerson().getName().getGivenName())) { ferr=true; } if(StringUtils.isBlank(patient.getPerson().getName().getFamilyName())) { lerr=true; } if(StringUtils.isBlank(patient.getPerson().getBirthdate())) { doberr = true; } if(StringUtils.isBlank(patient.getPerson().getAddress().getAddress1()) && StringUtils.isBlank(patient.getPerson().getAddress().getAddress2()) && StringUtils.isBlank(patient.getPerson().getAddress().getCityVillage()) && StringUtils.isBlank(patient.getPerson().getAddress().getStateProvince()) && StringUtils.isBlank(patient.getPerson().getAddress().getCountry()) && StringUtils.isBlank(patient.getPerson().getAddress().getPostalCode())) { adderr=true; } if (StringUtils.isBlank(patient.getPerson().getGender())) { gerr=true; } boolean result = !ferr && !lerr && !doberr && !adderr && !gerr; if (result) { mPatient = patient; return true; } else { mRegisterPatientView.setErrorsVisibility(ferr, lerr, doberr, adderr, gerr); return false; } }
Source:
<code>public void onFinish(List<Section> result) { if (!isAdded()) { Log.d("PageViewFragment", "Detached from activity, so stopping update."); return; } page = new Page(title, (ArrayList<Section>) result, pageProperties); editHandler.setPage(page); displayLeadSection(); setState(STATE_INITIAL_FETCH); new RestSectionsFetchTask().execute(); curEntry = new HistoryEntry(title, curEntry.getTimestamp(), curEntry.getSource()); new HistorySaveTask(curEntry).execute(); if (title.getThumbUrl() != null) { PageImage pi = new PageImage(title, title.getThumbUrl()); <START> app.getPersister(PageImage.class).upsert(pi); <END> } }</code><technical_language>Is blocking, a AsyncTask</technical_language>

Target:
public void onFinish(List<Section> result) { if (!isAdded()) { Log.d("PageViewFragment", "Detached from activity, so stopping update."); return; } page = new Page(title, (ArrayList<Section>) result, pageProperties); editHandler.setPage(page); displayLeadSection(); setState(STATE_INITIAL_FETCH); new RestSectionsFetchTask().execute(); curEntry = new HistoryEntry(title, curEntry.getTimestamp(), curEntry.getSource()); new PersistPageItemsTask(curEntry, title).execute(); }
Source:
<code>public CohortDefinition getPatientsWithState() { PatientStateCohortDefinition cd = new PatientStateCohortDefinition(); cd.addParameter(new Parameter("states", "reporting.parameter.states", ProgramWorkflowState.class, List.class, null)); cd.addParameter(new Parameter("startedOnOrAfter", "reporting.parameter.startDate", Date.class)); cd.addParameter(new Parameter("startedOnOrBefore", "reporting.parameter.endDate", Date.class)); cd.addParameter(new Parameter("endedOnOrAfter", "reporting.parameter.startDate", Date.class)); cd.addParameter(new Parameter("endedOnOrBefore", "reporting.parameter.endDate", Date.class)); <START> return new MappedParametersCohortDefinition(cd, <END> "states", "states", "startedOnOrAfter", "enrolledOnOrAfter", "startedOnOrBefore", "enrolledOnOrBefore", "endedOnOrAfter", "completedOnOrAfter", "endedOnOrBefore", "completedOnOrBefore" ); }</code><technical_language>labels for date parameters wrong. reflect parameter names (eg. reporting.parameter.startedOnOrAfter"</technical_language>

Target:
public CohortDefinition getPatientsWithState() { PatientStateCohortDefinition cd = new PatientStateCohortDefinition(); cd.addParameter(new Parameter("states", "reporting.parameter.states", ProgramWorkflowState.class, List.class, null)); cd.addParameter(new Parameter("startedOnOrAfter", "reporting.parameter.startedOnOrAfter", Date.class)); cd.addParameter(new Parameter("startedOnOrBefore", "reporting.parameter.startedOnOrBefore", Date.class)); cd.addParameter(new Parameter("endedOnOrAfter", "reporting.parameter.endedOnOrAfter", Date.class)); cd.addParameter(new Parameter("endedOnOrBefore", "reporting.parameter.endedOnOrBefore", Date.class)); return cd; }
Source:
<code>private void send(String message){ ReactorClient client = JsonRpcServer.getReactorClient(); try { client.sendMessage(message.getBytes()); log.error("sending events message {}", message); }catch (ClientConnectionException e) { <START> log.error("Failure in sending response", e); <END> }finally { log.debug("send events"); } }</code><technical_language>ClientConnectionException issues network connection. Please consider reconnect logic here</technical_language>

Target:
private void send(String message){ ReactorClient client = JsonRpcServer.getReactorClient(); try { client.sendMessage(message.getBytes()); log.debug("sending events message {}", message); }catch (ClientConnectionException e) { log.error("Failure in sending response", e); } }