dnrajugade / guava-libraries

Automatically exported from code.google.com/p/guava-libraries
Apache License 2.0
0 stars 0 forks source link

Expose standard system properties in a better way #1222

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Java has a standard set of system properties that are always available:

http://docs.oracle.com/javase/7/docs/api/java/lang/System.html#getProperties()

This is problematic for a number of reasons:

1) Using strings everywhere rather than constants
2) Accessing them generically via a map rather than specific getters for each 
property
3) Using the static global System object doesn't allow changing the values in 
tests

It would be nice to have a set of constants for all the properties and an API 
with getters like getUserHome, getTemporaryDirectory, etc.

Original issue reported on code.google.com by electrum on 3 Dec 2012 at 8:16

GoogleCodeExporter commented 9 years ago
Tentative +1. I'll bring it up in our next API meeting.

Original comment by kak@google.com on 3 Dec 2012 at 8:53

GoogleCodeExporter commented 9 years ago
We're going to go ahead w/ a class called StandardSystemProperties that 
contains these string constants.

Original comment by kak@google.com on 20 Dec 2012 at 11:11

GoogleCodeExporter commented 9 years ago
This will go out in 15.0

Original comment by kak@google.com on 22 Aug 2013 at 11:45

GoogleCodeExporter commented 9 years ago
This issue has been migrated to GitHub.

It can be found at https://github.com/google/guava/issues/<id>

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:13

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 3 Nov 2014 at 9:08