From 130544f98a32e9743b8eac4bdd75369ff86d4326 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Mon, 28 Nov 2011 12:52:13 -0500 Subject: [PATCH] fix simple-lib to call checkValid() specifying a path. --- .../simple-lib/src/main/scala/simplelib/SimpleLib.scala | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/simple-lib/src/main/scala/simplelib/SimpleLib.scala b/examples/simple-lib/src/main/scala/simplelib/SimpleLib.scala index 4161f579..24a1bcf8 100644 --- a/examples/simple-lib/src/main/scala/simplelib/SimpleLib.scala +++ b/examples/simple-lib/src/main/scala/simplelib/SimpleLib.scala @@ -6,8 +6,11 @@ import com.typesafe.config._ class SimpleLibContext(config: Config) { // This verifies that the Config is sane and has our - // reference config. - config.checkValid(ConfigFactory.defaultReference()) + // reference config. Importantly, we specify the "simple-lib" + // path so we only validate settings that belong to our this + // library. Otherwise, we might throw mistaken errors about + // settings we know nothing about. + config.checkValid(ConfigFactory.defaultReference(), "simple-lib") // This uses the standard default Config, if none is provided, // which simplifies apps willing to use the defaults