@Test public void testMatchPropertyTokensNotClosed() { String example = "<cacheManagerPeerProviderFactory class=\"net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory\"" + "properties=\"peerDiscovery=automatic, " + "multicastGroupAddress=${multicastAddress\n, " + "multicastGroupPort=4446, timeToLive=${multicastAddress\"/>"; Set propertyTokens = ConfigurationFactory.extractPropertyTokens(example); assertEquals(0, propertyTokens.size()); }
static Set extractPropertyTokens(String sourceDocument) { Set propertyTokens = new HashSet(); Pattern pattern = Pattern.compile("\\$\\{.+?\\}"); Matcher matcher = pattern.matcher(sourceDocument); while (matcher.find()) { String token = matcher.group(); propertyTokens.add(token); } return propertyTokens; }
ConfigurationFactory { static Set extractPropertyTokens(String sourceDocument) { Set propertyTokens = new HashSet(); Pattern pattern = Pattern.compile("\\$\\{.+?\\}"); Matcher matcher = pattern.matcher(sourceDocument); while (matcher.find()) { String token = matcher.group(); propertyTokens.add(token); } return propertyTokens; } }
ConfigurationFactory { static Set extractPropertyTokens(String sourceDocument) { Set propertyTokens = new HashSet(); Pattern pattern = Pattern.compile("\\$\\{.+?\\}"); Matcher matcher = pattern.matcher(sourceDocument); while (matcher.find()) { String token = matcher.group(); propertyTokens.add(token); } return propertyTokens; } private  ConfigurationFactory(); }
ConfigurationFactory { static Set extractPropertyTokens(String sourceDocument) { Set propertyTokens = new HashSet(); Pattern pattern = Pattern.compile("\\$\\{.+?\\}"); Matcher matcher = pattern.matcher(sourceDocument); while (matcher.find()) { String token = matcher.group(); propertyTokens.add(token); } return propertyTokens; } private  ConfigurationFactory(); static Configuration parseConfiguration(final File file); static Configuration parseConfiguration(final URL url); static Configuration parseConfiguration(); static Configuration parseConfiguration(final InputStream inputStream); }
ConfigurationFactory { static Set extractPropertyTokens(String sourceDocument) { Set propertyTokens = new HashSet(); Pattern pattern = Pattern.compile("\\$\\{.+?\\}"); Matcher matcher = pattern.matcher(sourceDocument); while (matcher.find()) { String token = matcher.group(); propertyTokens.add(token); } return propertyTokens; } private  ConfigurationFactory(); static Configuration parseConfiguration(final File file); static Configuration parseConfiguration(final URL url); static Configuration parseConfiguration(); static Configuration parseConfiguration(final InputStream inputStream);  }