<p>Evaluate string set properties
from string with comma delimeter
and removed new lines and trailing spaces.</p>
@param pSource string
@return LinkedHashSet<String> properties set
13677
public final LinkedHashSet<String> evalPropsStringsSet(final String pSource) {
    String sourceCorr = pSource.replace("\n", "");
    LinkedHashSet<String> resultSet = new LinkedHashSet<String>();
    for (String str : sourceCorr.split(",")) {
      resultSet.add(str.trim());
    }
    return resultSet;
  }
216975
public final String[] evalPropsStringsArray(final String pSource) {
    List<String> resultList = evalPropsStringsList(pSource);
    return resultList.toArray(new String[resultList.size()]);
  }
219432
public static Map<String, ?> propsToStringKeyMap(Properties properties) {
    ImmutableMap.Builder<String, Object> mapBuilder = ImmutableMap.builder();
    for (Map.Entry<Object, Object> entry : properties.entrySet()) {
      mapBuilder.put(entry.getKey().toString(), entry.getValue());
    }
    return mapBuilder.build();
  }
246977
public static Set<String> getNamespaces(InputSource source) throws ParserConfigurationException, SAXException, IOException {
        XmlNamespaceFinder finder = createNamespaceFinder();
        Set<String> answer = finder.parseContents(source);
        if (factory == null) {
            factory = finder.getFactory();
        }
        return answer;
    }
967352
public final WritableRaster filter(final Raster pSource, WritableRaster pDest) {
        return filter(pSource, pDest, getICM(pSource));
    }
1182494
public static ImmutableSet<String> lowercaseWordSet(final Class<?> origin, final String resource,
                                                        final boolean eliminatePrepAndConj) throws IOException {
        return ImmutableSet.copyOf(new HashSet<String>() {{
            readResource(origin, resource, new NullReturnLineProcessor() {
                @Override
                public boolean processLine(@Nonnull final String line) {
                    final String l = simplify(line);
                    if (!l.isEmpty() && !l.startsWith("#")) {
                        for (final String part : SPACES.split(l)) {
                            if (eliminatePrepAndConj) {
                                final String wordType = Dictionary.checkup(part);
                                if (wordType != null && (wordType.startsWith("IN") || wordType.startsWith("CC"))) {
                                    continue;
                                }
                            }
                            // add to the containing HashSet we are currently in the init block of
                            add(toEngLowerCase(clean(part)));
                        }
                    }
                    return true;
                }
            });
        }});
    }
1250440
public final String escapeHtml(final String pSource) {
    StringBuffer sb = new StringBuffer();
    for (int i = 0; i < pSource.length(); i++) {
      char ch = pSource.charAt(i);
      sb.append(htmlEscape(ch));
    }
    return sb.toString();
  }
570882
public ResourceSnippet getSnippet(PageSource ps, int startPos, int endPos, String charset) {
	String keySnp = calcKey(ps, startPos, endPos);
	synchronized (sync) {
	    ResourceSnippet snippet = snippets.get(keySnp);
	    if (snippet == null) {
		Resource res = ps.getResource();
		String keyRes = calcKey(res);
		String src = sources.get(keyRes);
		if (src == null) {
		    src = ResourceSnippet.getContents(res, charset);
		    sources.put(keyRes, src);
		}
		snippet = ResourceSnippet.createResourceSnippet(src, startPos, endPos);
		snippets.put(keySnp, snippet);
	    }
	    return snippet;
	}
    }
1220547
public Set<String> getSourceNames() {
        return Sets.newHashSet(Iterables.transform(getDatasources().values(), new Function<Datasource, String>() {

            @Override
            public String apply(Datasource input) {
                return input.getSource();
            }
        }));
    }
744413
public Resources interpret(final Set<ClassResult> classResults) {
        resources = new Resources();
        resources.setBasePath(PathNormalizer.getApplicationPath(classResults));

        javaTypeAnalyzer = new JavaTypeAnalyzer(resources.getTypeRepresentations());
        dynamicTypeAnalyzer = new DynamicTypeAnalyzer(resources.getTypeRepresentations());
        stringParameterResolver = new StringParameterResolver(resources.getTypeRepresentations(), javaTypeAnalyzer);

        classResults.stream().filter(c -> c.getResourcePath() != null).forEach(this::interpretClassResult);
        resources.consolidateMultiplePaths();

        return resources;
    }
1240636
@SuppressWarnings("unchecked")
  protected Set<String> getKeys(String prefix)
  {

    Set<String> result = new HashSet<String>();

    @SuppressWarnings("rawtypes")
    final Set keys = new HashSet();
    keys.addAll(session.getUserProperties().keySet());
    keys.addAll(project.getProperties().keySet());

    if (prefix == null) return keys;

    for (Object key : keys) {
      if (((String) key).startsWith(prefix))
        result.add((String) key);
    }

    return result;
  }
773253
public static String descriptorMethodSource(Class cls) {
        String descriptorClsName = ClassHelper.getInternalName(Descriptor.class.getCanonicalName());
        
        String code = "if (this.descriptor != null) {" + ClassCode.LINE_BREAK  +
                            "return this.descriptor;" + ClassCode.LINE_BREAK  +
                       "}" + ClassCode.LINE_BREAK +
                       "%s descriptor = CodedConstant.getDescriptor(%s);" + ClassCode.LINE_BREAK  +
                       "return (this.descriptor = descriptor);"; 
        
        return String.format(code, descriptorClsName, 
                ClassHelper.getInternalName(cls.getCanonicalName()) + CodeGenerator.JAVA_CLASS_FILE_SUFFIX);
        
    }
1207270
public static Set<Formatter> getFormatters(String s) {

        HashSet<Formatter> formatters = new HashSet<Formatter>();

        String[] names = s.trim().split("\\s*,\\s*");
        for (String fname : names) {
            if ("text".equals(fname)) {
                formatters.add(TxtFormatter.getInstance());
            } else if ("json".equals(fname)) {
                formatters.add(JsonFormatter.getInstance());
            } else if ("json.gz".equals(fname)) {
                formatters.add(JsonGzipFormatter.getInstance());
            } else if ("dot".equals(fname)) {
                formatters.add(DotFormatter.getInstance());
            } else if ("pan".equals(fname)) {
                formatters.add(PanFormatter.getInstance());
            } else if ("pan.gz".equals(fname)) {
                formatters.add(PanGzipFormatter.getInstance());
            } else if ("xml".equals(fname)) {
                formatters.add(XmlFormatter.getInstance());
            } else if ("xml.gz".equals(fname)) {
                formatters.add(XmlGzipFormatter.getInstance());
            } else if ("dep".equals(fname)) {
                formatters.add(DepFormatter.getInstance());
            } else if ("dep.gz".equals(fname)) {
                formatters.add(DepGzipFormatter.getInstance());
            } else if ("null".equals(fname)) {
                formatters.add(NullFormatter.getInstance());
            } else if ("none".equals(fname)) {
                // No-op
            }
        }

        return formatters;
    }
394236
public static Set<Integer> parseRange(String range) {
        if (range == null) {
            return Collections.emptySet();
        }
        Set<Integer> ret = new LinkedHashSet<>();
        StringTokenizer stringTokenizer = new StringTokenizer(range, String.format("%s%s", COMMA, DASH), true);
        Integer from = null;
        Integer to = null;
        boolean rangeStarted = false;
        while (stringTokenizer.hasMoreTokens()) {
            String token = stringTokenizer.nextToken();
            if (isValueDelimiter(token)) {
                ret.addAll(fromToAsSet(from, to));
                from = null;
                to = null;
                rangeStarted = false;
            } else if (isRangeDelimiter(token)) {
                rangeStarted = true;
            } else {
                String trimmedValue = token.trim();
                if (!isPositiveInt(trimmedValue)) {
                    throw new IllegalArgumentException("Range values should be positive numbers.");
                }
                Integer parsedInteger = Integer.parseUnsignedInt(trimmedValue);
                if (rangeStarted) {
                    to = parsedInteger;
                } else {
                    from = parsedInteger;
                }
            }
            if (from != null) {
                ret.addAll(fromToAsSet(from, to));
            }
        }

        return ret;
    }
487809
public static GwtProperties load(String source) {
    String[] lines = source.split("\r?\n");
    ImmutableMap.Builder<String, String> builder = ImmutableMap.builder();

    for (int i = 0; i < lines.length; ++i) {
      String line = lines[i];
      if (line.isEmpty() || line.startsWith("#") || line.startsWith("!")) {
        continue; // skip if empty or starts with # or !
      }

      String data = "";

      int delimeterIndex = findDelimiter(line);
      if (delimeterIndex == -1) {
        continue;
      }
      // Remove whitespace on both sides of key.
      String key = line.substring(0, delimeterIndex).trim();
      // Remove whitespace only on left side of data value. Trailing white space is data.
      line = trimLeft(line.substring(delimeterIndex + 1));
      while (true) {
        if (line.endsWith("\\")) {
          data += line.substring(0, line.length() - 1);
          if (i + 1 == lines.length) {
            break;
          }
          line = trimLeft(lines[++i]);
        } else {
          data += line;
          break;
        }
        }
      builder.put(key, data);
      }

    return new GwtProperties(builder.build());
    }
532410
public static Collection listPropertiesWithPrefix(Properties props, String prefix) {
        final HashSet set = new HashSet();
        for (Iterator i = props.keySet().iterator(); i.hasNext();) {
            String key = (String) i.next();
            if (key.startsWith(prefix)) {
                set.add(props.getProperty(key));
            }
        }
        return set;
    }
931825
private static Properties parseHeaderFields(String[] pHeaders) {
        Properties headers = new Properties();

        // Get header information
        int split;
        String field;
        String value;

        for (String header : pHeaders) {
            //System.err.println(pHeaders[i]);
            if ((split = header.indexOf(":")) > 0) {

                // Read & parse..?
                field = header.substring(0, split);
                value = header.substring(split + 1);

                //System.err.println(field + ": " + value.trim());
                headers.setProperty(StringUtil.toLowerCase(field), value.trim());
            }
        }
        return headers;
    }