Skip to content

Instantly share code, notes, and snippets.

@dchenbecker
Created March 6, 2013 03:50
Show Gist options
  • Select an option

  • Save dchenbecker/5096560 to your computer and use it in GitHub Desktop.

Select an option

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

tixxit commented Mar 6, 2013

Copy link
Copy Markdown

wat?

@dcsobral

dcsobral commented Mar 6, 2013

Copy link
Copy Markdown

what tixxit said.

@gclaramunt

Copy link
Copy Markdown

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