From c7abaef3a861011240c871109f19ef1c1e54999f Mon Sep 17 00:00:00 2001
From: Peter van 't Hof <p.j.van_t_hof@lumc.nl>
Date: Mon, 23 Jun 2014 12:46:39 +0200
Subject: [PATCH] Full funcional object now, root need to be in the constructor
 of class

---
 .../nl/lumc/sasc/biopet/core/config/Configurable.scala   | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/config/Configurable.scala b/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/config/Configurable.scala
index d1c1d5640..ecb93d81e 100644
--- a/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/config/Configurable.scala
+++ b/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/config/Configurable.scala
@@ -4,10 +4,11 @@ import java.io.File
 import org.broadinstitute.sting.queue.util.Logging
 
 trait Configurable extends Logging {
-  val globalConfig: Config
-  val configPath: List[String]
-  protected var configName = getClass.getSimpleName.toLowerCase
-  protected var configFullPath = configName :: configPath
+  val root: Configurable
+  val globalConfig: Config = if (root != null) root.globalConfig else new Config()
+  val configPath: List[String] = if (root != null) root.configFullPath else List()
+  protected val configName = getClass.getSimpleName.toLowerCase
+  protected val configFullPath = configName :: configPath
   
   def config(key:String) = globalConfig(configName, configPath, key)
   def config(key:String, default:Any) = globalConfig(configName, configPath, key, default)
-- 
GitLab