Gets and splits property values separated by a comma.
@param holder a property holder (not null)
@return a non-null list of non-null values
197786
public static List<String> getPropertyValues( AbstractBlockHolder holder, String propertyName ) {

		List<String> result = new ArrayList<> ();
		for( BlockProperty p : holder.findPropertiesBlockByName( propertyName )) {
			result.addAll( Utils.splitNicely( p.getValue(), ParsingConstants.PROPERTY_SEPARATOR ));
		}

		return result;
	}
80688
public Multimap<String, String> getValuesByLanguage(String property) {
        Multimap<String, String> result = HashMultimap.create();
        if (properties.containsKey(property)) {
            Multimap<Optional<String>, String> values = properties.get(property);
            for (Entry<Optional<String>, String> entry : values.entries())
                if (entry.getKey().isPresent())
                    result.put(entry.getKey().get(), entry.getValue());
        }
        return result;
    }
912814
public static String[] split(String s, String separator) {

        HsqlArrayList list      = new HsqlArrayList();
        int           currindex = 0;

        for (boolean more = true; more; ) {
            int nextindex = s.indexOf(separator, currindex);

            if (nextindex == -1) {
                nextindex = s.length();
                more      = false;
            }

            list.add(s.substring(currindex, nextindex));

            currindex = nextindex + separator.length();
        }

        return (String[]) list.toArray(new String[list.size()]);
    }
799197
public static Object getPropertyValue( final Object root, final String... properties ) {



        Object object = root;



        for ( String property : properties ) {

            if (object == null) {
                return null;
            }

            if (property.equals("this")) {
                if (!(object instanceof Map)) {
                    continue;
                } else {
                    Object aThis = ((Map) object).get("this");
                    if (aThis!=null) {
                        object = aThis;
                        continue;
                    } else {
                        continue;
                    }
                }
            }

            if (object instanceof Map) {
                object = ((Map) object).get(property);
                continue;
            }


            char c = property.charAt(0);
            if ( CharScanner.isDigit(c) ) {
                /* We can index numbers and names. */
                object = idx ( object, StringScanner.parseInt ( property ) );

            } else {


                if (object instanceof Collection) {

                    object = _getFieldValuesFromCollectionOrArray( object, property);
                    continue;
                } else if (isArray(object)) {


                    Iterator iter = Conversions.iterator(object);
                    List list = Lists.list(iter);
                    object = _getFieldValuesFromCollectionOrArray(list, property);

                    continue;
                }


                Map<String, FieldAccess> fields =
                         getPropertyFieldAccessMap( object.getClass() );

                FieldAccess field = fields.get( property );

                if ( field == null ) {
                    return null;
                }

                object = field.getValue( object );
            }
        }
        return object;
    }
1328330
public static List<String> split(String s, String separator) {
        if (s == null) return null;
        List<String> rslt = null;
        if (s.isEmpty() || isEmpty(separator)) {
            rslt = new ArrayList<>(1);
            rslt.add(s);
            return rslt;
        }

        //return s.split(COMMA_SPLIT); - NOT WORKING when compiled to JS

        int start = 0;
        int p = start;
        do {
            int j = s.indexOf(separator, p);
            if (j == -1) {
                if (rslt == null) {
                    rslt = new ArrayList<>(1);
                    rslt.add(s);
                    return rslt;
                }
                rslt.add(s.substring(start));
                break;
            }
            if (j > 0 && s.charAt(j - 1) == '\\') {
                p = j + 1;
                continue;
            } else {
                if (rslt == null) rslt = new ArrayList<String>();
                rslt.add(s.substring(start, j));
                start = j + 1;
                p = start;
            }

        } while (true);

        return rslt;
    }
953973
public function group($property, $separator = null)
    {
        $list = [];

        /** @var NestedObjectInterface $element */
        foreach ($this->getIterator() as $element) {
            $list[(string) $element->getNestedProperty($property, null, $separator)][] = $element;
        }

        return $list;
    }
856437
protected List<String> split(final String string){
        if (null!=prefix){
            //remove prefix before split
            return Arrays.asList(string.substring(prefix.length()).split(delimiter));
        }else{
            return Arrays.asList(string.split(delimiter));
        }

    }
532000
private static List<String> splitExpression(String expression) {
        List<String> tokens = new ArrayList<String>();
        int lastStart = -1;
        boolean isQuoted = false;
        for (int i = 0; i < expression.length(); i++) {
            if ( lastStart == -1 ) {
                if ( !isQuoted && Character.isJavaIdentifierStart( expression.charAt(i) ) ) {
                    lastStart = i;
                }
            } else if ( !Character.isJavaIdentifierPart( expression.charAt(i) ) ) {
                tokens.add(expression.subSequence(lastStart, i).toString());
                lastStart = -1;
            }
            if (expression.charAt(i) == '"' || expression.charAt(i) == '\'') {
                if (i == 0 || expression.charAt(i-1) != '\\') {
                    isQuoted = !isQuoted;
                }
                if (isQuoted) {
                    lastStart = -1;
                }
            }
        }
        if (lastStart != -1) {
            tokens.add( expression.subSequence( lastStart, expression.length() ).toString() );
        }
        return tokens;
    }
487682
public static final Set<String> fromCommaSeparatedValues(String csv) {
        if (csv == null || csv.isEmpty()) {
            return Collections.EMPTY_SET;
        }
        String[] tokens = csv.split(",");
        return new HashSet<String>(Arrays.asList(tokens));
    }
1193767
public static String[] splitPreserveAllTokens(String value, char separatorChar) {
    if (value == null) {
      return ArrayUtils.EMPTY_STRING_ARRAY;
    }
    int len = value.length();
    if (len == 0) {
      return ArrayUtils.EMPTY_STRING_ARRAY;
    }
    List<String> list = new ArrayList<>();
    int i = 0;
    int start = 0;
    boolean match = false;
    boolean lastMatch = false;
    int escapeStart = -2;
    while (i < len) {
      char c = value.charAt(i);
      if (c == ESCAPE_CHAR) {
        escapeStart = i;
      }
      if (c == separatorChar && escapeStart != i - 1) {
        lastMatch = true;
        list.add(value.substring(start, i));
        match = false;
        start = ++i;
        continue;
      }
      match = true;
      i++;
    }
    if (match || lastMatch) {
      list.add(value.substring(start, i));
    }
    return list.toArray(new String[list.size()]);
  }
227360
public List<TokenStore> split(final Token.Symbol symbol) {
        
        ArgUtils.notNull(symbol, "symbol");
        
        final List<TokenStore> list = new ArrayList<>();
        
        TokenStore store = new TokenStore();
        list.add(store);
        
        for(Token token : tokens) {
            
            if(token.equals(symbol)) {
                store = new TokenStore();
                list.add(store);
                
            } else {
                store.add(token);
            }
            
        }
        
        return list;
    }
443408
List<String> split(String value) {
        if (value == null) {
            return Collections.emptyList();
        }
        String[] parts = value.split(",", -1);
        return Arrays.asList(parts);
    }
890405
public static String getPropertyValue( AbstractBlockHolder holder, String propertyName ) {
		BlockProperty p = holder.findPropertyBlockByName( propertyName );
		return p == null ? null : p.getValue();
	}
95313
private List<String> splitRRULEValues(String value) {
		List<String> values = new ArrayList<String>();
		Pattern p = Pattern.compile("#\\d+|\\d{8}T\\d{6}Z?");
		Matcher m = p.matcher(value);

		int prevIndex = 0;
		while (m.find()) {
			int end = m.end();
			String subValue = value.substring(prevIndex, end).trim();
			values.add(subValue);
			prevIndex = end;
		}
		String subValue = value.substring(prevIndex).trim();
		if (subValue.length() > 0) {
			values.add(subValue);
		}

		return values;
	}
711595
private int recognizePropertiesHolder( String line, BufferedReader br, AbstractBlockHolder holderInstance )
	throws IOException {

		int result = P_CODE_NO;
		String[] parts = splitFromInlineComment( line );
		String realLine = parts[ 0 ].trim();

		// Recognize the declaration
		AbstractBlockHolder holder = null;
		StringBuilder sb = new StringBuilder();
		boolean endInstructionReached = false, foundExtraChars = false;
		for( char c : realLine.toCharArray()) {
			if( c == O_CURLY_BRACKET )
				endInstructionReached = true;
			else if( ! endInstructionReached )
				sb.append( c );
			else {
				foundExtraChars = true;
				break;
			}
		}

		if( foundExtraChars ) {
			addModelError( ErrorCode.P_O_C_BRACKET_EXTRA_CHARACTERS );
			result = P_CODE_CANCEL;

		} else if( ! endInstructionReached ) {
			if( Utils.isEmptyOrWhitespaces( sb.toString())
					|| sb.toString().matches( ParsingConstants.PATTERN_ID )) {

				addModelError( ErrorCode.P_O_C_BRACKET_MISSING );
				result = P_CODE_CANCEL;

			} else {
				result = P_CODE_NO;
			}

		} else {
			result = P_CODE_YES;
			holder = holderInstance;
			holder.setName( sb.toString().trim());
			holder.setLine( this.currentLineNumber );
			holder.setInlineComment( parts[ 1 ]);
			this.definitionFile.getBlocks().add( holder );
		}

		// Recognize the properties
		boolean errorInSubProperties = false;
		if( holder != null ) {
			while(( line = nextLine( br )) != null
						&& ! line.trim().startsWith( String.valueOf( C_CURLY_BRACKET ))) {

				int code = recognizeBlankLine( line, holder.getInnerBlocks());
				if( code == P_CODE_YES )
					continue;

				code = recognizeComment( line, holder.getInnerBlocks());
				if( code == P_CODE_YES )
					continue;

				code = recognizeInstanceOf( line, br, holderInstance );
				if( code == P_CODE_NO )
					code = recognizeProperty( line, holder );

				if( code == P_CODE_CANCEL )
					result = P_CODE_CANCEL;

				if( code != P_CODE_YES ) {
					errorInSubProperties = true;
					break;
				}
			}
		}

		// Why did we exit the loop?
		// 1. We found an invalid content for the holder.
		// 2. We reached EOF or we found a closing curly bracket.
		// 3. We never entered the loop!

		// Inner errors prevail
		if( errorInSubProperties ) {
			if( result == P_CODE_YES ) {
				if( holderInstance.getInstructionType() == AbstractBlock.INSTANCEOF )
					addModelError( ErrorCode.P_INVALID_PROPERTY_OR_INSTANCE );
				else
					addModelError( ErrorCode.P_INVALID_PROPERTY );
			}

			result = P_CODE_CANCEL;
		}

		// Inner blocks are valid, we found a curly bracket, check the end
		else if( result == P_CODE_YES
				&& line != null
				&& line.trim().startsWith( String.valueOf( C_CURLY_BRACKET ))) {

			line = line.replaceFirst( "\\s*\\}", "" );
			parts = splitFromInlineComment( line );
			if( ! Utils.isEmptyOrWhitespaces( parts[ 0 ])) {
				addModelError( ErrorCode.P_C_C_BRACKET_EXTRA_CHARACTERS );
				result = P_CODE_CANCEL;
			}

			holder.setClosingInlineComment( parts[ 1 ]);
		}

		// The closing bracket is missing
		else if( result == P_CODE_YES ) {
			addModelError( ErrorCode.P_C_C_BRACKET_MISSING );
		}

		return result;
	}
107117
public Collection<String> split(String value) {
    String[] parts = splitter.split(value);
    Collection<String> values = new ArrayList(parts.length);
    for (int ix = 0; ix < parts.length; ix++)
      values.add(parts[ix]);
    return values;
  }

  public String getSplitOn() {
	return splitter.toString();
  }
}
808138
private static String[] splitMultipartHeaderValues(String svalue) {
        List<String> values = InternalThreadLocalMap.get().arrayList(1);
        boolean inQuote = false;
        boolean escapeNext = false;
        int start = 0;
        for (int i = 0; i < svalue.length(); i++) {
            char c = svalue.charAt(i);
            if (inQuote) {
                if (escapeNext) {
                    escapeNext = false;
                } else {
                    if (c == '\\') {
                        escapeNext = true;
                    } else if (c == '"') {
                        inQuote = false;
                    }
                }
            } else {
                if (c == '"') {
                    inQuote = true;
                } else if (c == ';') {
                    values.add(svalue.substring(start, i));
                    start = i + 1;
                }
            }
        }
        values.add(svalue.substring(start));
        return values.toArray(new String[0]);
    }