Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-132903

Add macro to add an item to the end of the list

    Details

      Description

      Issue:
      According to the current StringUtil.add

      		if (s == null) {
      			s = StringPool.BLANK;
      		}
      
      		if (allowDuplicates || !contains(s, add, delimiter)) {
      			StringBuilder sb = new StringBuilder(4);
      
      			sb.append(s);
      
      			if (Validator.isNull(s) || s.endsWith(delimiter)) {
      				sb.append(add);
      				sb.append(delimiter);
      			}
      			else {
      				sb.append(delimiter);
      				sb.append(add);
      				sb.append(delimiter);
      			}
      
      			s = sb.toString();
      		}
      

      There is one limitation:
      There is always a comma appended to List when use comma as delimiter.

        Attachments

          Activity

            People

            Assignee:
            yang.cao Yang Cao
            Reporter:
            yang.cao Yang Cao
            Recent user:
            Sophia Zhang
            Participants of an Issue:
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Packages

                Version Package
                7.4.1 CE GA2 DXP 7,4
                7.4.13 DXP GA1
                Master