diff --git a/src/main/java/com/typesafe/config/ConfigFactory.java b/src/main/java/com/typesafe/config/ConfigFactory.java index 08e8f4b5..3eaca956 100644 --- a/src/main/java/com/typesafe/config/ConfigFactory.java +++ b/src/main/java/com/typesafe/config/ConfigFactory.java @@ -147,6 +147,10 @@ public final class ConfigFactory { .toConfig(); } + public static Config parseString(String s, ConfigParseOptions options) { + return Parseable.newString(s, options).parse().toConfig(); + } + /** * Parses classpath resources corresponding to this path expression. * Essentially if the path is "foo.bar" then the resources are diff --git a/src/test/scala/com/typesafe/config/impl/TestUtils.scala b/src/test/scala/com/typesafe/config/impl/TestUtils.scala index 281596e0..8bdc138f 100644 --- a/src/test/scala/com/typesafe/config/impl/TestUtils.scala +++ b/src/test/scala/com/typesafe/config/impl/TestUtils.scala @@ -340,7 +340,7 @@ abstract trait TestUtils { val options = ConfigParseOptions.defaults(). setOriginDescription("test string"). setSyntax(ConfigSyntax.CONF); - ConfigFactory.parseReader(new StringReader(s), options).asInstanceOf[SimpleConfig] + ConfigFactory.parseString(s, options).asInstanceOf[SimpleConfig] } protected def subst(ref: String) = {