Skip to content

Instantly share code, notes, and snippets.

@dchenbecker
Created March 6, 2013 03:50
Show Gist options
  • Save dchenbecker/5096560 to your computer and use it in GitHub Desktop.
Save dchenbecker/5096560 to your computer and use it in GitHub Desktop.
Sometimes I just need to remind myself how crappy some Java APIs are...
scala> import java.util.Properties
import java.util.Properties
scala> val defaults = new Properties
defaults: java.util.Properties = {}
scala> defaults.setProperty("test", "foo")
res8: java.lang.Object = null
scala> defaults.containsKey("test")
res9: Boolean = true
scala> val test = new Properties(defaults)
test: java.util.Properties = {}
scala> test.containsKey("test")
res10: Boolean = false
scala> test.getProperty("test")
res11: java.lang.String = foo
@tixxit
Copy link

tixxit commented Mar 6, 2013

wat?

@dcsobral
Copy link

dcsobral commented Mar 6, 2013

what tixxit said.

@gclaramunt
Copy link

Use java.util.Properties! You'll have hours and hours of fun chasing bugs!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment