title: Scala Java Error: value filter is not a member of java.util.Map. Works outside of class
body: <p>I'm trying to refactor some Scala code in Eclipse and run into this compilation error: </p>
  
  <p><strong>value filter is not a member of java.util.Map</strong></p>
  
  <pre><code>import java.io.File
  import com.typesafe.config._
  
  class ConfigLoader  {
  
      def parseFile( confFile : File) {
          val conf = ConfigFactory.parseFile(confFile).root().unwrapped();        
          for((k,v) &lt;- conf; (dk, dv) = (k, v.toString())) config.param += (dk -&gt; dv);        
      }
  </code></pre>
  
  <p>(config is an object with "param" being a Map of String:String)</p>
  
  <p>This code was pull exactly from Main() where it worked fine like so: </p>
  
  <pre><code>object Main extends Logging {        
  
      def main(args: Array[String]) {
          //code cropped for readability. 
          //config.param["properties"] is absolute path to a passed-in properties file. 
  
          val conf = ConfigFactory.parseFile(new java.io.File(config.param("properties"))).root().unwrapped();
  
          for((k,v) &lt;- conf; (dk, dv) = (k, v.toString())) config.param+=(dk -&gt; dv);
  </code></pre>
  
  <p>as you can see the code is exactly the same. I've imported the same libraries. All i'm doing different in main now is instantiating <code>ConfigLoader</code> and calling it like so: </p>
  
  <p><code>cfgLoader.parseFile(config.param("properties"))</code></p>
  
  <p><strong>Any ideas what's causing the error just by moving it to a class?</strong> </p>
  
  <p>I've googled the error and it seems to be pretty generic. </p>