auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public StateItem[] getStateTable() { if (fStateTable == null) { Map<@NonNull String, @NonNull OutputElementStyle> styles = getStyles(); if (styles == null || styles.isEmpty()) { return new StateItem[0]; } List<StateItem> stateItemList = new ArrayList<>(); int tableIndex = 0; for (Entry<@NonNull String, @NonNull OutputElementStyle> styleEntry : fStylesMap.entrySet()) { @NonNull Map<@NonNull String, @NonNull Object> elementStyle = styleEntry.getValue().getStyleValues(); Object color = elementStyle.get(StyleProperties.BACKGROUND_COLOR); RGB rgb = new RGB(0, 0, 0); if (color instanceof String) { RGB rgbColor = ColorUtils.fromHexColor((String) color); <START> rgb = rgbColor != null ? rgbColor : new RGB(0, 0, 0); <END> } fLabelToIndex.put(styleEntry.getKey(), tableIndex); tableIndex++; Map<String, Object> styleMap = new HashMap<>(); styleMap.put(ITimeEventStyleStrings.fillStyle(), ITimeEventStyleStrings.solidColorFillStyle()); styleMap.put(ITimeEventStyleStrings.fillColor(), new RGBAColor(rgb.red, rgb.green, rgb.blue).toInt()); styleMap.put(ITimeEventStyleStrings.label(), styleEntry.getKey()); Object styleGroup = elementStyle.get(StyleProperties.STYLE_GROUP); if (styleGroup != null) { styleMap.put(ITimeEventStyleStrings.group(), styleGroup); } stateItemList.add(new StateItem(styleMap)); } fStateTable = stateItemList.toArray(new StateItem[stateItemList.size()]); return fStateTable; } return fStateTable; }</code><technical_language>rgb is initialized black. Extract constant? do a simple if</technical_language>

Target:
public StateItem[] getStateTable() { @Nullable StateItem[] stateTable = fStateTable; if (stateTable == null) { Map<@NonNull String, @NonNull OutputElementStyle> styles = getStyles(); if (styles.isEmpty()) { return new StateItem[0]; } List<StateItem> stateItemList = new ArrayList<>(); int tableIndex = 0; for (Entry<String, OutputElementStyle> styleEntry : styles.entrySet()) { Map<String, Object> elementStyle = styleEntry.getValue().getStyleValues(); Object color = elementStyle.get(StyleProperties.BACKGROUND_COLOR); RGB rgb = new RGB(0, 0, 0); if (color instanceof String) { RGB rgbColor = ColorUtils.fromHexColor((String) color); rgb = rgbColor != null ? rgbColor : new RGB(0, 0, 0); } fLabelToIndex.put(styleEntry.getKey(), tableIndex); tableIndex++; Map<String, Object> styleMap = new HashMap<>(); styleMap.put(ITimeEventStyleStrings.fillStyle(), ITimeEventStyleStrings.solidColorFillStyle()); styleMap.put(ITimeEventStyleStrings.fillColor(), new RGBAColor(rgb.red, rgb.green, rgb.blue).toInt()); styleMap.put(ITimeEventStyleStrings.label(), styleEntry.getKey()); Object styleGroup = elementStyle.get(StyleProperties.STYLE_GROUP); if (styleGroup != null) { styleMap.put(ITimeEventStyleStrings.group(), styleGroup); } stateItemList.add(new StateItem(styleMap)); } stateTable = stateItemList.toArray(new StateItem[stateItemList.size()]); fStateTable = stateTable; } return stateTable; }
Source:
<code>protected AbstractVoltDBPTableScan(RelOptCluster cluster, RelTraitSet traitSet, RelOptTable table, VoltTable voltDBTable, RexProgram program, RexNode offset, RexNode limit, RelNode aggregate, RelDataType preAggregateRowType, RexProgram preAggregateProgram, int splitCount) { super(cluster, traitSet.plus(VoltDBPRel.VOLTDB_PHYSICAL), table, voltDBTable); <START> assert (program != null); <END> assert (aggregate == null || aggregate instanceof AbstractVoltDBPAggregate); m_program = program; m_offset = offset; m_limit = limit; m_aggregate = aggregate; m_preAggregateRowType = preAggregateRowType; m_preAggregateProgram = preAggregateProgram; m_splitCount = splitCount; }</code><technical_language>Preconditions.checkArgument is good-old asserts, introduced JAR dependency. (or other checks) replace assertions</technical_language>

Target:
protected AbstractVoltDBPTableScan(RelOptCluster cluster, RelTraitSet traitSet, RelOptTable table, VoltTable voltDBTable, RexProgram program, RexNode offset, RexNode limit, RelNode aggregate, RelDataType preAggregateRowType, RexProgram preAggregateProgram, int splitCount) { super(cluster, traitSet.plus(VoltDBPRel.VOLTDB_PHYSICAL), table, voltDBTable); Preconditions.checkNotNull(program); Preconditions.checkArgument(aggregate == null || aggregate instanceof AbstractVoltDBPAggregate); Preconditions.checkArgument(program.getOutputRowType().getFieldCount() > 0); m_program = program; m_offset = offset; m_limit = limit; m_aggregate = aggregate; m_preAggregateRowType = preAggregateRowType; m_preAggregateProgram = preAggregateProgram; m_splitCount = splitCount; }
Source:
<code>boolean passesQualityCheck(final byte[] bases, final byte[] quals, final int seedLength, final int minQuality) { if (bases.length < seedLength) return false; for (int i = 0; i < seedLength; ++i) { if (SequenceUtil.isNoCall(bases[i])) return false; } final int maxReadLength = (MAX_READ_LENGTH <= 0) ? Integer.MAX_VALUE : MAX_READ_LENGTH; final int readLength = Math.min(bases.length, maxReadLength); int total = 0; <START> for (int i = 0; i < readLength; i++) total += bases[i]; <END> return total / readLength >= minQuality; }</code><technical_language>this summing quals, bases</technical_language>

Target:
boolean passesQualityCheck(final byte[] bases, final byte[] quals, final int seedLength, final int minQuality) { if (bases.length < seedLength) return false; for (int i = 0; i < seedLength; ++i) { if (SequenceUtil.isNoCall(bases[i])) return false; } final int maxReadLength = (MAX_READ_LENGTH <= 0) ? Integer.MAX_VALUE : MAX_READ_LENGTH; final int readLength = Math.min(bases.length, maxReadLength); int total = 0; for (int i = 0; i < readLength; i++) total += quals[i]; return total / readLength >= minQuality; }
Source:
<code>public String getBaseComponentKey() { return getComponent(); <START> } <END></code><technical_language>![INFO](<LINK_0> 'Severity: INFO') Do forget remove this deprecated code someday. [![rule](<LINK_1>](<LINK_2></technical_language>

Target:
public String getBaseComponentKey() { return baseComponentKey; }
Source:
<code>public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) { if (source == null) { return null; } if (source instanceof List) { List<?> sourceList = (List<?>) source; if (!sourceList.isEmpty() && sourceList.get(0) instanceof String) { return source; } } if (source instanceof Collection) { <START> final Collection<String> results = new ArrayList<>(); <END> for (Object object : ((Collection<?>) source)) { if (object != null) { results.add(object.toString()); } } return results; } return Collections.singletonList(source.toString()); }</code><technical_language>For consistency project, please remove final keyword this local variable</technical_language>

Target:
public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) { if (source == null) { return null; } if (source instanceof List) { List<?> sourceList = (List<?>) source; if (!sourceList.isEmpty() && sourceList.get(0) instanceof String) { return source; } } if (source instanceof Collection) { Collection<String> results = new ArrayList<>(); for (Object object : ((Collection<?>) source)) { if (object != null) { results.add(object.toString()); } } return results; } return Collections.singletonList(source.toString()); }
Source:
<code>void put( long idx, V e, V[] evictions ) { if ( idx < 0 ) { <START> throw new IllegalArgumentException( "Index must be >= 0" ); <END> } if ( e == null ) { throw new IllegalArgumentException( "Null entries are not accepted" ); } if ( idx == endIndex + 1 ) { evictions[0] = circle.append( e ); endIndex = endIndex + 1; } else { circle.clear( evictions ); circle.append( e ); endIndex = idx; } }</code><technical_language>For debugging purposes, is useful provide actual passed. for line 74 below</technical_language>

Target:
void put( long idx, V e, V[] evictions ) { if ( idx < 0 ) { throw new IllegalArgumentException( format( "Index must be >= 0 (was %d)", idx ) ); } if ( e == null ) { throw new IllegalArgumentException( "Null entries are not accepted" ); } if ( idx == endIndex + 1 ) { evictions[0] = circle.append( e ); endIndex = endIndex + 1; } else { circle.clear( evictions ); circle.append( e ); endIndex = idx; } }
Source:
<code>public CreateBranchWizard(Repository repository, String base) { try (RevWalk rw = new RevWalk(repository)) { if (base == null) { myPage = new CreateBranchPage(repository, (Ref) null); } else if (ObjectId.isId(base)) { RevCommit commit = rw.parseCommit(ObjectId .fromString(base)); myPage = new CreateBranchPage(repository, commit); } else { if (base.startsWith(Constants.R_HEADS) || base.startsWith(Constants.R_REMOTES) || base.startsWith(Constants.R_TAGS)) { Ref currentBranch = <START> repository.findRef(base); <END> myPage = new CreateBranchPage(repository, currentBranch); } else { RevCommit commit = rw.parseCommit( repository.resolve(base + "^{commit}")); myPage = new CreateBranchPage(repository, commit); } } } catch (IOException e) { myPage = new CreateBranchPage(repository, (Ref) null); } setWindowTitle(UIText.CreateBranchWizard_NewBranchTitle); }</code><technical_language>exactRef</technical_language>

Target:
public CreateBranchWizard(Repository repository, String base) { try (RevWalk rw = new RevWalk(repository)) { if (base == null) { myPage = new CreateBranchPage(repository, (Ref) null); } else if (ObjectId.isId(base)) { RevCommit commit = rw.parseCommit(ObjectId .fromString(base)); myPage = new CreateBranchPage(repository, commit); } else { if (base.startsWith(Constants.R_HEADS) || base.startsWith(Constants.R_REMOTES) || base.startsWith(Constants.R_TAGS)) { Ref currentBranch = repository.exactRef(base); myPage = new CreateBranchPage(repository, currentBranch); } else { RevCommit commit = rw.parseCommit( repository.resolve(base + "^{commit}")); myPage = new CreateBranchPage(repository, commit); } } } catch (IOException e) { myPage = new CreateBranchPage(repository, (Ref) null); } setWindowTitle(UIText.CreateBranchWizard_NewBranchTitle); }
Source:
<code>public JobDetail refreshPools( @PathParam("owner_key") String ownerKey, @QueryParam("auto_create_owner") @DefaultValue("false") Boolean autoCreateOwner, @QueryParam("lazy_regen") @DefaultValue("true") Boolean lazyRegen) { Owner owner = ownerCurator.lookupByKey(ownerKey); if (owner == null) { if (autoCreateOwner) { if (ownerService.isOwnerKeyValidForCreation(ownerKey)) { owner = this.createOwner(new Owner(ownerKey, ownerKey)); <START> } <END> } else { throw new NotFoundException(i18n.tr( "owner with key: {0} was not found.", ownerKey)); } } return RefreshPoolsJob.forOwner(owner, lazyRegen); }</code><technical_language>if valid? exception occur owner null. if combine if statements: if (autoCreateOwner && ownerService.isOwnerKeyValidForCreation(ownerKey)) { owner = this.createOwner(...); } else { throw new NotFoundException(...); }</technical_language>

Target:
public JobDetail refreshPools( @PathParam("owner_key") String ownerKey, @QueryParam("auto_create_owner") @DefaultValue("false") Boolean autoCreateOwner, @QueryParam("lazy_regen") @DefaultValue("true") Boolean lazyRegen) { Owner owner = ownerCurator.lookupByKey(ownerKey); if (owner == null) { if (autoCreateOwner && ownerService.isOwnerKeyValidForCreation(ownerKey)) { owner = this.createOwner(new Owner(ownerKey, ownerKey)); } else { throw new NotFoundException(i18n.tr( "owner with key: {0} was not found.", ownerKey)); } } return RefreshPoolsJob.forOwner(owner, lazyRegen); }
Source:
<code>private void initDescription() { final VerticalPanel vp = new VerticalPanel(); vp.add(new SmallHeading(Util.C.headingDescription())); descTxt = new NpTextArea(); descTxt.setVisibleLines(6); descTxt.setCharacterWidth(60); vp.add(descTxt); add(vp); <START> saveEnabler = new OnEditEnabler(saveProject, descTxt); <END> }</code><technical_language>this OnEditEnabler for widgets, I prefer listenTo approach: saveEnabler = new OnEditEnabler(saveProject); saveEnabler.listenTo(destTxt);</technical_language>

Target:
private void initDescription() { final VerticalPanel vp = new VerticalPanel(); vp.add(new SmallHeading(Util.C.headingDescription())); descTxt = new NpTextArea(); descTxt.setVisibleLines(6); descTxt.setCharacterWidth(60); vp.add(descTxt); add(vp); saveEnabler = new OnEditEnabler(saveProject); saveEnabler.listenTo(descTxt); }
Source:
<code>public void visitMethodInvocation(MethodInvocationTree tree) { if (OPTIONAL_IS_PRESENT.matches(tree)) { constraintManager.setValueFactory(id -> new OptionalSymbolicValue(id, programState.peekValue())); } else if (OPTIONAL_GET.matches(tree) && presenceHasNotBeenChecked(programState.peekValue())) { String identifier = getIdentifierPart(tree.methodSelect()); <START> context.reportIssue(tree, check, String.format("Call \"%sisPresent()\" before accessing the value.", StringUtils.isEmpty(identifier) ? "Optional#" : (identifier + ".")), <END> Flows.singleton(String.format("Optional %sis accessed", StringUtils.isEmpty(identifier) ? "" : (identifier + " ")), tree.methodSelect())); programState = null; } }</code><technical_language>I avoid conditional operators testing : a small if filling properly some named variable do. I tend String format this case is a bit of overkill, concatenation do trick nicely</technical_language>

Target:
public void visitMethodInvocation(MethodInvocationTree tree) { if (OPTIONAL_IS_PRESENT.matches(tree)) { constraintManager.setValueFactory(id -> new OptionalSymbolicValue(id, programState.peekValue())); } else if (OPTIONAL_GET.matches(tree) && presenceHasNotBeenChecked(programState.peekValue())) { String identifier = getIdentifierPart(tree.methodSelect()); String issueMsg; String flowMsg; if (identifier.isEmpty()) { issueMsg = "Optional#"; flowMsg = ""; } else { issueMsg = identifier + "."; flowMsg = identifier + " "; } Set<List<JavaFileScannerContext.Location>> flow = FlowComputation.singleton("Optional " + flowMsg + "is accessed", tree.methodSelect()); context.reportIssue(tree, check, "Call \""+ issueMsg + "isPresent()\" before accessing the value.", flow); programState = null; } }
Source:
<code>public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) { ErlangFunction function = PsiTreeUtil.getParentOfType(descriptor.getPsiElement(), ErlangFunction.class, false); if (function == null) return; PsiFile file = function.getContainingFile(); if (!(file instanceof ErlangFile)) return; List<ErlangAttribute> attributes = ((ErlangFile) file).getAttributes(); for (ErlangAttribute attribute : attributes) { ErlangImportDirective importDirective = attribute.getImportDirective(); if (importDirective == null || importDirective.getModuleRef() == null) continue; ErlangImportFunctions importFunctions = importDirective.getImportFunctions(); if (importFunctions == null) continue; if (importFunctions.getImportFunctionList().size() == 0) continue; if (importFunctions.getImportFunctionList().size() == 1) { attribute.delete(); continue; } <START> StringBuilder newImport = new StringBuilder(); <END> for (ErlangImportFunction ef : importFunctions.getImportFunctionList()) { if (!ef.getText().equals(function.getName() + "/" + function.getArity())) { if (newImport.length() > 0) newImport.append(", "); newImport.append(ef.getText()); } } String moduleName = importDirective.getModuleRef().getText(); attribute.replace(ErlangElementFactory.createImportFromText(project, moduleName, newImport.toString())); } }</code><technical_language>StringUtil.join</technical_language>

Target:
public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) { PsiElement function = PsiTreeUtil.getParentOfType(descriptor.getPsiElement(), ErlangFunction.class); if (function == null) { function = PsiTreeUtil.getParentOfType(descriptor.getPsiElement(), ErlangImportFunction.class, false); } if (function == null) return; PsiFile file = function.getContainingFile(); if (!(file instanceof ErlangFile)) return; List<ErlangAttribute> attributes = ((ErlangFile) file).getAttributes(); for (ErlangAttribute attribute : attributes) { ErlangImportDirective importDirective = attribute.getImportDirective(); if (importDirective == null || importDirective.getModuleRef() == null) continue; ErlangImportFunctions fns = importDirective.getImportFunctions(); List<ErlangImportFunction> functoins = fns == null ? ContainerUtil.<ErlangImportFunction>emptyList() : fns.getImportFunctionList(); if (functoins.isEmpty()) continue; if (functoins.size() == 1) { attribute.delete(); continue; } List<String> newImports = ContainerUtil.newArrayList(); String fullName; if (function instanceof ErlangFunction) { fullName = ErlangPsiImplUtil.createFunctionPresentation((ErlangFunction) function); } else { fullName = ErlangPsiImplUtil.createFunctionPresentation((ErlangImportFunction) function); } for (ErlangImportFunction f : functoins) { String presentation = ErlangPsiImplUtil.createFunctionPresentation(f); if (presentation == null || !presentation.equals(fullName)) { newImports.add(f.getText()); } } String moduleName = importDirective.getModuleRef().getText(); attribute.replace(ErlangElementFactory.createImportFromText(project, moduleName, StringUtil.join(newImports, ", "))); } }
Source:
<code>private List<MavenProject> trimSelectedProjects( List<MavenProject> projects, ProjectDependencyGraph graph, MavenExecutionRequest request ) throws MavenExecutionException { List<MavenProject> result = projects; if ( !request.getSelectedProjects().isEmpty() ) { File reactorDirectory = getReactorDirectory( request ); <START> Collection<MavenProject> selectedProjects = new LinkedHashSet<>( request.getSelectedProjects().size() ); <END> for ( String selector : request.getSelectedProjects() ) { MavenProject selectedProject = projects.stream() .filter( project -> isMatchingProject( project, selector, reactorDirectory ) ) .findFirst() .orElseThrow( () -> new MavenExecutionException( "Could not find the selected project in the reactor: " + selector, request.getPom() ) ); selectedProjects.add( selectedProject ); } result = new ArrayList<>( selectedProjects ); result = includeAlsoMakeTransitively( result, request, graph ); List<MavenProject> sortedProjects = graph.getSortedProjects(); result.sort( comparing( sortedProjects::indexOf ) ); } return result; }</code><technical_language>change initial size of selectedProjects? projects.size(), request.getSelectedProjects().size()</technical_language>

Target:
private List<MavenProject> trimSelectedProjects( List<MavenProject> projects, ProjectDependencyGraph graph, MavenExecutionRequest request ) throws MavenExecutionException { List<MavenProject> result = projects; if ( !request.getSelectedProjects().isEmpty() ) { File reactorDirectory = getReactorDirectory( request ); Collection<MavenProject> selectedProjects = new LinkedHashSet<>( request.getSelectedProjects().size(), 1 ); for ( String selector : request.getSelectedProjects() ) { MavenProject selectedProject = projects.stream() .filter( project -> isMatchingProject( project, selector, reactorDirectory ) ) .findFirst() .orElseThrow( () -> new MavenExecutionException( "Could not find the selected project in the reactor: " + selector, request.getPom() ) ); selectedProjects.add( selectedProject ); } result = new ArrayList<>( selectedProjects ); result = includeAlsoMakeTransitively( result, request, graph ); List<MavenProject> sortedProjects = graph.getSortedProjects(); result.sort( comparing( sortedProjects::indexOf ) ); } return result; }
Source:
<code>protected void checkConfig() { String msg = null; if (localConfig == null && remoteConfig == null) { msg = "No local or remote configuration provided, aborting"; } if (clientConfig == null) { msg = "No client configuration provided, aborting"; } if (msg != null) { log.error(msg); <START> throw new IllegalStateException(msg); <END> } }</code><technical_language>Avoid logging error if a throw</technical_language>

Target:
protected void checkConfig() { if (clientConfig == null) { throw new IllegalStateException("No Elasticsearch Client configuration provided, aborting"); } }
Source:
<code>public List<OutputPin> deriveResults(CallBehaviorAction node) { List<OutputPin> derivedOutputPins = new ArrayList<OutputPin>(); if (node.getBehavior() != null) { for (Parameter parameter : node.getBehavior().getOwnedParameters()) { if (parameter.getDirection() == ParameterDirectionKind.INOUT_LITERAL <START> | parameter.getDirection() == ParameterDirectionKind.RETURN_LITERAL <END> | parameter.getDirection() == ParameterDirectionKind.OUT_LITERAL) { OutputPin derivedPin = UMLFactory.eINSTANCE.createOutputPin(); derivedPin.setType(parameter.getType()); derivedPin.setLower(parameter.getLower()); derivedPin.setUpper(parameter.getUpper()); if (parameter.getDirection() == ParameterDirectionKind.INOUT_LITERAL) { derivedPin.setName("[out] " + parameter.getName()); } else { derivedPin.setName(parameter.getName()); } derivedOutputPins.add(derivedPin); } } } return derivedOutputPins; }</code><technical_language>|| (boolean OR) instead of | (bit OR)</technical_language>

Target:
public List<OutputPin> deriveResults(CallBehaviorAction node) { List<OutputPin> derivedOutputPins = new ArrayList<OutputPin>(); if (node.getBehavior() != null) { for (Parameter parameter : node.getBehavior().getOwnedParameters()) { if (parameter.getDirection() == ParameterDirectionKind.INOUT_LITERAL || parameter.getDirection() == ParameterDirectionKind.RETURN_LITERAL || parameter.getDirection() == ParameterDirectionKind.OUT_LITERAL) { OutputPin derivedPin = UMLFactory.eINSTANCE.createOutputPin(); derivedPin.setType(parameter.getType()); derivedPin.setLower(parameter.getLower()); derivedPin.setUpper(parameter.getUpper()); if (parameter.getDirection() == ParameterDirectionKind.INOUT_LITERAL) { derivedPin.setName("[out] " + parameter.getName()); } else { derivedPin.setName(parameter.getName()); } derivedOutputPins.add(derivedPin); } } } return derivedOutputPins; }
Source:
<code>public void multiService() { <START> assert_().about(javaSources()) <END> .that(Arrays.asList( JavaFileObjects.forResource("test/SomeService.java"), JavaFileObjects.forResource("test/MultiServiceProvider.java"), JavaFileObjects.forResource("test/AnotherService.java"))) .processedWith(new AutoServiceProcessor()) .compilesWithoutError() .and().generatesFiles( JavaFileObjects.forResource("META-INF/services/test.SomeService"), JavaFileObjects.forResource("META-INF/services/test.AnotherService")); }</code><technical_language>JavaSourcesSubjectFactory a static assertThat method accepts a varargs</technical_language>

Target:
public void multiService() { assertThat( JavaFileObjects.forResource("test/SomeService.java"), JavaFileObjects.forResource("test/AnotherService.java"), JavaFileObjects.forResource("test/MultiServiceProvider.java")) .processedWith(new AutoServiceProcessor()) .compilesWithoutError() .and().generatesFiles( JavaFileObjects.forResource("META-INF/services/test.SomeServiceMulti"), JavaFileObjects.forResource("META-INF/services/test.AnotherServiceMulti")); }
Source:
<code>@Test public void testPullUpPredicatesFromMinus() { final RelMetadataQuery mq = RelMetadataQuery.instance(); RelNode rel = convertSql("" + "select empno, deptno, comm from emp where empno=1 and deptno=2\n" + "except all\n" + "select empno, deptno, comm from emp where comm=3"); assertThat(mq.getPulledUpPredicates(rel).pulledUpPredicates, <START> sortsAs("[=($0, 1), =($1, 2)]")); <END> }</code><technical_language>If is except, NOT(comm=3). add this case</technical_language>

Target:
@Test public void testPullUpPredicatesFromMinus() { final RelMetadataQuery mq = RelMetadataQuery.instance(); final RelNode rel = convertSql("" + "select empno, deptno, comm from emp where empno=1 and deptno=2\n" + "except all\n" + "select empno, deptno, comm from emp where comm=3"); assertThat(mq.getPulledUpPredicates(rel).pulledUpPredicates, sortsAs("[=($0, 1), =($1, 2)]")); }
Source:
<code>protected void includeProperties(Set<Property> allProperties) { super.includeProperties(allProperties); <START> for (Node n : nodes) { <END> n.includeProperties(allProperties); } }</code><technical_language>If Java 8 is allowed: nodes.forEach(n -> n.includeProperties(allProperties));</technical_language>

Target:
protected void includeProperties(Set<Property> allProperties) { super.includeProperties(allProperties); nodes.forEach(n -> n.includeProperties(allProperties)); }
Source:
<code>public void storeNewPassword(GluuCustomPerson person, boolean validateOldPassword) { if (validateOldPassword) { boolean resultValidateOldPassword = false; try { if ((person != null) && StringHelper.isNotEmpty(person.getUid())) { resultValidateOldPassword = personService.authenticate(person.getUid(), oldPassword); } } catch (AuthenticationException ex) { log.debug("Failed to verify old person password", ex); } if (!resultValidateOldPassword) { if (graphValidator == null) { <START> FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, <END> "Old password isn't valid!", "Old password isn't valid!")); } else { FacesContext.getCurrentInstance().addMessage(graphValidator.getClientId(), new FacesMessage( FacesMessage.SEVERITY_ERROR, "Old password isn't valid!", "Old password isn't valid!")); } } } else { if (isSame()) { person.setUserPassword(this.password); personService.updatePerson(person); FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Successfully changed!", "Successfully changed!")); } else { FacesContext.getCurrentInstance().addMessage(graphValidator.getClientId(), new FacesMessage(FacesMessage.SEVERITY_ERROR, "Password and confirm password value don't match", "Password and confirm password value don't match")); } } }</code><technical_language>changed lines reformat... need replace: FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR.... with: @Inject private FacesMessages facesMessages; ... facesMessages.add(FacesMessage.SEVERITY_ERROR, "....."); This code simplier</technical_language>

Target:
public void storeNewPassword(GluuCustomPerson person, boolean validateOldPassword) { if (validateOldPassword) { boolean resultValidateOldPassword = false; try { if ((person != null) && StringHelper.isNotEmpty(person.getUid())) { resultValidateOldPassword = personService.authenticate(person.getUid(), oldPassword); } } catch (AuthenticationException ex) { log.debug("Failed to verify old person password", ex); } if (!resultValidateOldPassword) { if (graphValidator == null) { facesMessages.add(FacesMessage.SEVERITY_ERROR, "Old password isn't valid!", "Old password isn't valid!"); } else { facesMessages.add(FacesMessage.SEVERITY_ERROR, "Old password isn't valid!", "Old password isn't valid!"); } } } else { if (this.password.equals(this.confirm)) { person.setUserPassword(this.password); personService.updatePerson(person); oxTrustAuditService.audit("USER " + person.getInum() + " PASSWORD UPDATED", identity.getUser(), (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest()); facesMessages.add(FacesMessage.SEVERITY_INFO, "Successfully changed!", "Successfully changed!"); } else { facesMessages.add(FacesMessage.SEVERITY_ERROR, "Password and confirm password value don't match", "Password and confirm password value don't match"); } } }
Source:
<code>public long getLanguageId() { <START> try { <END> return (Long) map.get(LANGUAGEID_KEY); } catch (ClassCastException e) { long languageId = Long.parseLong((String) map.get(LANGUAGEID_KEY)); map.put(LANGUAGEID_KEY, languageId); return languageId; } }</code><technical_language>do ConversionUtils.toLong (map.get(LANGUAGEID_KEY), 0);</technical_language>

Target:
public long getLanguageId() { return ConversionUtils.toLong(map.get(LANGUAGEID_KEY), 0l); }
Source:
<code>public List<String> createAndSaveOutputDataStagingTasks(ProcessModel processModel, String gatewayId) throws RegistryException { List<String> dataStagingTaskIds = new ArrayList<>(); List<OutputDataObjectType> processOutputs = processModel.getProcessOutputs(); String appName = OrchestratorUtils.getApplicationInterfaceName(orchestratorContext, processModel); if (processOutputs != null) { for (OutputDataObjectType processOutput : processOutputs) { DataType type = processOutput.getType(); switch (type) { case STDOUT : if(null == processOutput.getValue() || (null != processOutput.getValue() && processOutput.getValue().trim().isEmpty())){ processOutput.setValue(appName + ".stdout"); } createOutputDataSatagingTasks(processModel, gatewayId, dataStagingTaskIds, processOutput); break; case STDERR: <START> if(null == processOutput.getValue() || <END> (null != processOutput.getValue() && processOutput.getValue().trim().isEmpty())){ processOutput.setValue(appName + ".stderr"); } createOutputDataSatagingTasks(processModel, gatewayId, dataStagingTaskIds, processOutput); break; case URI: createOutputDataSatagingTasks(processModel, gatewayId, dataStagingTaskIds, processOutput); break; default: break; } } } try { if (isArchive(processModel, gatewayId)) { createArchiveDataStatgingTask(processModel, gatewayId, dataStagingTaskIds); } } catch (AppCatalogException e) { throw new RegistryException("Error! Application interface retrieval failed"); } return dataStagingTaskIds; }</code><technical_language>Simplify logic</technical_language>

Target:
public List<String> createAndSaveOutputDataStagingTasks(ProcessModel processModel, String gatewayId) throws RegistryException { List<String> dataStagingTaskIds = new ArrayList<>(); List<OutputDataObjectType> processOutputs = processModel.getProcessOutputs(); String appName = OrchestratorUtils.getApplicationInterfaceName(orchestratorContext, processModel); if (processOutputs != null) { for (OutputDataObjectType processOutput : processOutputs) { DataType type = processOutput.getType(); switch (type) { case STDOUT : if(null == processOutput.getValue() || processOutput.getValue().trim().isEmpty()){ processOutput.setValue(appName + ".stdout"); } createOutputDataSatagingTasks(processModel, gatewayId, dataStagingTaskIds, processOutput); break; case STDERR: if(null == processOutput.getValue() || processOutput.getValue().trim().isEmpty()){ processOutput.setValue(appName + ".stderr"); } createOutputDataSatagingTasks(processModel, gatewayId, dataStagingTaskIds, processOutput); break; case URI: createOutputDataSatagingTasks(processModel, gatewayId, dataStagingTaskIds, processOutput); break; default: break; } } } try { if (isArchive(processModel, gatewayId)) { createArchiveDataStatgingTask(processModel, gatewayId, dataStagingTaskIds); } } catch (AppCatalogException e) { throw new RegistryException("Error! Application interface retrieval failed"); } return dataStagingTaskIds; }
Source:
<code>public Result execute(String cookieSentByRPC, Action<?> action) throws ActionException, ServiceException { if (action.isSecured() && !cookieMatch(cookieSentByRPC)) { String message = xsrfAttackMessage + " While executing action: " + action.getClass().getName(); logger.severe(message); throw new ServiceException(message); } try { return dispatch.execute(action); } catch (ActionException e) { if (logger.isLoggable(Level.WARNING)) { String newMessage = "Action exception while executing " + action.getClass().getName() + ": " + e.getMessage(); logger.log(Level.WARNING, newMessage, e); } e.setStackTrace(new StackTraceElement[]{}); <START> throw e; <END> } catch (ServiceException e) { if (logger.isLoggable(Level.WARNING)) { logger.log(Level.WARNING, "Service exception while executing " + action.getClass().getName() + ": " + e.getMessage(), e); } throw new ServiceException(e.getMessage()); } catch (RuntimeException e) { if (logger.isLoggable(Level.WARNING)) { logger.log(Level.WARNING, "Unexpected exception while executing " + action.getClass().getName() + ": " + "" + e.getMessage(), e); } throw new ServiceException(e.getMessage()); } }</code><technical_language>e is logged throwing client</technical_language>

Target:
public Result execute(String cookieSentByRPC, Action<?> action) throws ActionException, ServiceException { if (action.isSecured() && !cookieMatch(cookieSentByRPC)) { String message = xsrfAttackMessage + " While executing action: " + action.getClass().getName(); logger.severe(message); throw new ServiceException(message); } try { return dispatch.execute(action); } catch (ActionException e) { if (logger.isLoggable(Level.WARNING)) { String newMessage = "Action exception while executing " + action.getClass().getName() + ": " + e.getMessage(); logger.log(Level.WARNING, newMessage, e); } removeStacktraces(e); throw e; } catch (ServiceException e) { if (logger.isLoggable(Level.WARNING)) { logger.log(Level.WARNING, "Service exception while executing " + action.getClass().getName() + ": " + e.getMessage(), e); } throw new ServiceException(e.getMessage()); } catch (RuntimeException e) { if (logger.isLoggable(Level.WARNING)) { logger.log(Level.WARNING, "Unexpected exception while executing " + action.getClass().getName() + ": " + "" + e.getMessage(), e); } throw new ServiceException(e.getMessage()); } }
Source:
<code>public void testInvalidParameterKey() { try { String key = "version=1;uuid=12345610-0000-0000-0000-000000000001"; DataMapKey deserializedParam = DataMapKey.deserialize(key); fail("InvalidParameterKeyException should have been raised"); <START> } catch (InvalidPersistentMapKeyException e) { <END> assertNotNull(e); } }</code><technical_language>please @Test(expected=InvalidPersistentMapKeyException.class) instead of try{} catch {}</technical_language>

Target:
public void testInvalidParameterKey() { String key = "version=1;uuid=12345610-0000-0000-0000-000000000001"; DataMapKey deserializedParam = DataMapKey.deserialize(key); fail("InvalidParameterKeyException should have been raised"); }
Source:
<code>public boolean equals(Object object) { boolean result; if (this == object) { result = true; } else { if ((object == null) || (object.getClass() != this.getClass())) { result = false; } else { SyntaxType syntaxType = (SyntaxType) object; <START> result = (getId() == syntaxType.getId() || getId() != null && getId().equals(syntaxType.getId())); <END> } } return result; }</code><technical_language>I removing wrong parenthesis ;)</technical_language>

Target:
public boolean equals(Object object) { boolean result; if (this == object) { result = true; } else { if ((object == null) || (object.getClass() != this.getClass())) { result = false; } else { SyntaxType syntaxType = (SyntaxType) object; result = getId() == syntaxType.getId() || (getId() != null && getId().equals(syntaxType.getId())); } } return result; }
Source:
<code>public static List<Setting<?>> optionalSettings() { <START> return List.of(Repository.ACCOUNT_SETTING, <END> Repository.KEY_SETTING, Repository.CONTAINER_SETTING, Repository.BASE_PATH_SETTING, Repository.CHUNK_SIZE_SETTING, COMPRESS_SETTING, Repository.READONLY_SETTING, Repository.LOCATION_MODE_SETTING); }</code><technical_language>drop support of setting in crate.yml ? a user perspective is confusing some settings work some not</technical_language>

Target:
public static List<Setting<?>> optionalSettings() { return List.of(Repository.CONTAINER_SETTING, Repository.BASE_PATH_SETTING, Repository.CHUNK_SIZE_SETTING, Repository.READONLY_SETTING, Repository.LOCATION_MODE_SETTING, COMPRESS_SETTING, Repository.MAX_RETRIES_SETTING, Repository.ENDPOINT_SUFFIX_SETTING, Repository.TIMEOUT_SETTING, Repository.PROXY_TYPE_SETTING, Repository.PROXY_HOST_SETTING, Repository.PROXY_PORT_SETTING); }
Source:
<code>public VanillaFoodPantryAddon() { super("vanillafoodpantry"); addNonFoodRecipe(ADDITIONAL_RECIPES); addTool(TOOLS); <START> <END> CookingForBlockheadsAPI.addWaterItem(getModItemStack(FRESH_WATER_ITEM)); CookingForBlockheadsAPI.addMilkItem(getModItemStack(FRESH_MILK_ITEM)); }</code><technical_language>addWildcardNonFoodRecipe right now</technical_language>

Target:
public VanillaFoodPantryAddon() { super("vanillafoodpantry"); addNonFoodRecipe(ADDITIONAL_RECIPES); addWildcardNonFoodRecipe(WILDCARD_RECIPES); addTool(TOOLS); CookingForBlockheadsAPI.addWaterItem(getModItemStack(FRESH_WATER_ITEM)); CookingForBlockheadsAPI.addMilkItem(getModItemStack(FRESH_MILK_ITEM)); }
Source:
<code>public void testLatitude() { try { String latStr; Double lat; for (int i = 0; i < 100; i++) { latStr = faker.address().latitude(); assertNotNull(latStr); lat = new Double(latStr); <START> assertTrue(lat >= -90 && lat <= 90); <END> } } catch (NumberFormatException e) { fail("Invalid Latitude"); } }</code><technical_language>mind Hamcrest matcher separate assert statements 2 lines</technical_language>

Target:
public void testLatitude() { String latStr; Double lat; for (int i = 0; i < 100; i++) { latStr = faker.address().latitude(); assertThat(latStr, isANumber()); lat = new Double(latStr); assertThat("Latitude is less then -90", lat >= -90); assertThat("Latitude is greater than 90", lat <= 90); } }
Source:
<code>public void updateViewerInput() { if (session != null && treeViewer != null && treeViewer.getTree() != null && !treeViewer.getTree().isDisposed()) { Object[] children = siriusCommonContentModelProvider.getChildren(session); List<Object> childrenList = new ArrayList<>(); Resource sessionResource = session.getSessionResource(); IFile file = WorkspaceSynchronizer.getFile(sessionResource); ProjectDependenciesItem projectDependenciesItem = new NoDynamicProjectDependencies(file.getProject(), session); childrenList.add(projectDependenciesItem); childrenList.addAll(Arrays.asList(children).stream().map(obj -> { Object result = null; if (obj instanceof Resource) { Resource resource = (Resource) obj; URI uri = resource.getURI(); if (uri.toPlatformString(true) != null) { <START> String platformString = uri.toPlatformString(true); <END> IFile iFile = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(platformString)); if (file.getProject().equals(iFile.getProject())) { result = iFile; } } } return result; }).filter(obj -> obj != null).collect(Collectors.toList())); List<Object> directChildOfProjectDependency = Arrays.asList(siriusCommonContentModelProvider.getChildren(projectDependenciesItem)); treeViewer.setInput(childrenList.stream().filter(input -> !(input instanceof ViewpointsFolderItemImpl) && !directChildOfProjectDependency.contains(input)).collect(Collectors.toList())); treeViewer.expandToLevel(2); treeViewer.expandToLevel(projectDependenciesItem, 2); } }</code><technical_language>line avoir call toPlatformString</technical_language>

Target:
public void updateViewerInput() { if (session != null && treeViewer != null && treeViewer.getTree() != null && !treeViewer.getTree().isDisposed()) { Object[] children = siriusCommonContentModelProvider.getChildren(session); List<Object> childrenList = new ArrayList<>(); Resource sessionResource = session.getSessionResource(); IFile file = WorkspaceSynchronizer.getFile(sessionResource); ProjectDependenciesItem projectDependenciesItem = new NoDynamicProjectDependencies(file.getProject(), session); childrenList.add(projectDependenciesItem); childrenList.addAll(Arrays.asList(children).stream().map(obj -> { Object result = null; if (obj instanceof Resource) { Resource resource = (Resource) obj; URI uri = resource.getURI(); String platformString = uri.toPlatformString(true); if (platformString != null) { IFile iFile = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(platformString)); if (file.getProject().equals(iFile.getProject())) { result = iFile; } } } return result; }).filter(obj -> obj != null).collect(Collectors.toList())); List<Object> directChildOfProjectDependency = Arrays.asList(siriusCommonContentModelProvider.getChildren(projectDependenciesItem)); treeViewer.setInput(childrenList.stream().filter(input -> !(input instanceof ViewpointsFolderItemImpl) && !directChildOfProjectDependency.contains(input)).collect(Collectors.toList())); treeViewer.expandToLevel(2); treeViewer.expandToLevel(projectDependenciesItem, 2); } }
Source:
<code><START> public void testCreatePatientPostActionParameter() throws InterruptedException { <END> TaskTriggerInformation triggerInformation = new TaskTriggerInformation("CREATE SettingsRecord", "data-services", MDS_CHANNEL_NAME, VERSION, TRIGGER_SUBJECT, TRIGGER_SUBJECT); SortedSet<TaskConfigStep> taskConfigStepSortedSet = new TreeSet<>(); taskConfigStepSortedSet.add(createPatientDataSource()); TaskConfig taskConfig = new TaskConfig(); taskConfig.addAll(taskConfigStepSortedSet); ArrayList<TaskActionInformation> taskActions = new ArrayList(); taskActions.add(prepareCreatePatientActionInformation("Slowackiego 15/2", "Jan Nowak")); taskActions.add(prepareCreatePatientActionInformation("{{pa.0.uuid}}", "Robert Kowalski")); Task task = new Task("OpenMRSPatientPostActionParameterTestTask", triggerInformation, taskActions, taskConfig, true, true); getTaskService().save(task); getTriggerHandler().registerHandlerFor(task.getTrigger().getEffectiveListenerSubject()); activateTrigger(); assertTrue(waitForTaskExecution(task.getId())); Patient patient = patientService.getPatientByMotechId(DEFAULT_CONFIG_NAME, "Jan Nowak"); String firstPatientUuid = patient.getUuid(); patient = patientService.getPatientByMotechId(DEFAULT_CONFIG_NAME, "Robert Kowalski"); Person.Address address = patient.getPerson().getPreferredAddress(); assertEquals(firstPatientUuid, address.getAddress1()); }</code><technical_language>1. this task logic in separate method 2. please english example names : John Smith</technical_language>

Target:
public void testCreatePatientPostActionParameter() throws InterruptedException { Task task = prepareCreatePatientPostActionParameterTask(); getTriggerHandler().registerHandlerFor(task.getTrigger().getEffectiveListenerSubject()); activateTrigger(); assertTrue(waitForTaskExecution(task.getId())); Patient patient = patientService.getPatientByMotechId(DEFAULT_CONFIG_NAME, "John Smith"); String firstPatientUuid = patient.getUuid(); patient = patientService.getPatientByMotechId(DEFAULT_CONFIG_NAME, "Jacob Lee"); Person.Address address = patient.getPerson().getPreferredAddress(); assertEquals(firstPatientUuid, address.getAddress1()); }
Source:
<code>public String toString() { StringBuilder builder = new StringBuilder("{"); for (Map.Entry<String, Object> entry : this.entrySet()) { if (builder.length() > 2) { builder.append(","); } String key = entry.getKey(); Object value = entry.getValue(); <START> builder.append(" \"" + key + "\""); <END> builder.append(" : "); if (value.getClass().equals(String.class)) { builder.append("\"" + (String) value + "\" "); } else if (value.getClass().equals(Long.class)) { builder.append((Long) value + " "); } else { builder.append(value.toString() + " "); } } builder.append("}"); return builder.toString(); }</code><technical_language>builder.append().append().append instead of +</technical_language>

Target:
public String toString() { StringBuilder builder = new StringBuilder("{"); for (Map.Entry<String, Object> entry : this.entrySet()) { appendEntry(entry, builder); } builder.append("}"); return builder.toString(); }
Source:
<code>public void testTouchCorrectionWithTooBigDelayBeforeUP() { <START> long invalidTimestamp = 220; <END> triggerTouchDownEvent(initalPositionX, initalPositionY); triggerMovementEvent(firstMovementTimestamp, firstMovementPositionX, firstMovementPositionY); triggerMovementEvent(secondMovementTimestamp, secondMovementPositionX, firstMovementPositionY); triggerTouchUpEvent(invalidTimestamp); verify(imageView, times(2)).setX(anyFloat()); }</code><technical_language>suggestion long muchLaterTimestamp = 220;</technical_language>

Target:
public void testTouchCorrectionWithTooBigDelayBeforeUP() { long muchLaterTimestamp = 220; triggerTouchDownEvent(initalPositionX, initalPositionY); triggerMovementEvent(firstMovementTimestamp, firstMovementPositionX, firstMovementPositionY); verify(imageView, times(1)).setX(firstMovementPositionX); triggerMovementEvent(secondMovementTimestamp, secondMovementPositionX, secondMovementPositionY); verify(imageView, times(1)).setX(secondMovementPositionX); triggerTouchUpEvent(muchLaterTimestamp); verify(imageView, times(1)).setX(actionUpMovementPositionX); verify(imageView, times(3)).setX(anyFloat()); }
Source:
<code>public HandlerRegistration addValueChangeHandler(final ValueChangeHandler<T> handler) { return asSuggestBox().addValueChangeHandler(new ValueChangeHandler<String>() { @Override public void onValueChange(ValueChangeEvent<String> event) { <START> T value = wrap(event.getValue()); <END> if (value != null) { handler.onValueChange(new ValueChangeEvent<T>(wrap(event.getValue())) { }); } } }); }</code><technical_language>what, mind, is a matter of personal taste, I mind</technical_language>

Target:
public HandlerRegistration addValueChangeHandler(final ValueChangeHandler<T> handler) { return asSuggestBox().addValueChangeHandler(new ValueChangeHandler<String>() { @Override public void onValueChange(ValueChangeEvent<String> event) { T value = asEntity(event.getValue()); if (value != null) { handler.onValueChange(new ValueChangeEvent<T>(value) { }); } } }); }
Source:
<code>public boolean associate(HttpServletRequest request) { BoundBeanStore beanStore = getBeanStore(); if (beanStore != null) { ContextLogger.LOG.beanStoreLeakDuringAssociation(this.getClass().getName(), request); <START> ContextLogger.LOG.beanStoreLeakAffectedBeanIdentifiers(this.getClass().getName(), Iterables.toMultiRowString(beanStore)); <END> } beanStore = new RequestBeanStore(request, namingScheme); setBeanStore(beanStore); beanStore.attach(); return true; }</code><technical_language>building multi-row string if leak debug logging is enabled</technical_language>

Target:
public boolean associate(HttpServletRequest request) { BoundBeanStore beanStore = getBeanStore(); if (beanStore != null) { ContextLogger.LOG.beanStoreLeakDuringAssociation(this.getClass().getName(), request); if (ContextLogger.LOG.isDebugEnabled()) { ContextLogger.LOG.beanStoreLeakAffectedBeanIdentifiers(this.getClass().getName(), Iterables.toMultiRowString(beanStore)); } } beanStore = new RequestBeanStore(request, namingScheme); setBeanStore(beanStore); beanStore.attach(); return true; }
Source:
<code>public void addChangeListener_null() { try { <START> collection.addChangeListener((RealmChangeListener)null); <END> fail(); } catch (IllegalArgumentException ignored) { } }</code><technical_language>a space null</technical_language>

Target:
public void addChangeListener_null() { try { collection.addChangeListener((RealmChangeListener<RealmResults<AllTypes>>) null); fail(); } catch (IllegalArgumentException ignored) { } }
Source:
<code>private void populateDatastreamDestinationFromExistingDatastream(Datastream datastream, Datastream existingStream) { DatastreamDestination destination = existingStream.getDestination(); <START> LOG.info(String.format("Datastream %s has same source as existing datastream, Setting the destination %s", <END> datastream.getName(), destination)); datastream.setDestination(destination); if (existingStream.getMetadata().containsKey(DatastreamMetadataConstants.DESTINATION_CREATION_MS)) { datastream.getMetadata() .put(DatastreamMetadataConstants.DESTINATION_CREATION_MS, existingStream.getMetadata().get(DatastreamMetadataConstants.DESTINATION_CREATION_MS)); } if (existingStream.getMetadata().containsKey(DatastreamMetadataConstants.DESTINATION_RETENION_MS)) { datastream.getMetadata() .put(DatastreamMetadataConstants.DESTINATION_RETENION_MS, existingStream.getMetadata().get(DatastreamMetadataConstants.DESTINATION_RETENION_MS)); } }</code><technical_language>this log statement this method logged invoker instead</technical_language>

Target:
private void populateDatastreamDestinationFromExistingDatastream(Datastream datastream, Datastream existingStream) { DatastreamDestination destination = existingStream.getDestination(); datastream.setDestination(destination); if (existingStream.getMetadata().containsKey(DatastreamMetadataConstants.DESTINATION_CREATION_MS)) { datastream.getMetadata() .put(DatastreamMetadataConstants.DESTINATION_CREATION_MS, existingStream.getMetadata().get(DatastreamMetadataConstants.DESTINATION_CREATION_MS)); } if (existingStream.getMetadata().containsKey(DatastreamMetadataConstants.DESTINATION_RETENION_MS)) { datastream.getMetadata() .put(DatastreamMetadataConstants.DESTINATION_RETENION_MS, existingStream.getMetadata().get(DatastreamMetadataConstants.DESTINATION_RETENION_MS)); } }