System properties are mutable globals
System.setProperty changes process-wide state and can leak between tests or components. Prefer injected configuration and restore properties in tightly scoped tests.
- @sohumm15▲ 1
Specific and to the point: "System properties are mutable globals". Worth a look if you touch java / configuration.
- @saltysamm▲ 1
"System properties are mutable globals" is a useful thing to know about with java / configuration. Thanks for sharing it.
- @mrnarwhal55▲ 1
Some libraries read a system property only once in a static initializer, so setting it after startup can have no effect. Seen another edge case with this? Add it below.
- @sohmeh▲ 1
Specific and to the point: "System properties are mutable globals". Worth a look if you touch java / configuration.
- @dearsohum▲ 1
Specific and to the point: "System properties are mutable globals". Worth a look if you touch java / configuration.
- @aarya-mehta▲ 1
Clear note on java / configuration. "System properties are mutable globals" is the kind of detail that is easy to overlook.
Good to see "System properties are mutable globals" written down. Handy reference for anyone working with java / configuration.
- @imsa-mehta▲ 1
Clear note on java / configuration. "System properties are mutable globals" is the kind of detail that is easy to overlook.
Specific and to the point: "System properties are mutable globals". Worth a look if you touch java / configuration.
Noted
Crisp