Skip to content

Commit

Permalink
Modify msg of ENV_USE_PROPERTY_INSTEAD_OF_ENV
Browse files Browse the repository at this point in the history
  • Loading branch information
JuditKnoll committed Nov 14, 2023
1 parent 83bc8ae commit 47bf07b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions spotbugs/etc/messages.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9146,8 +9146,9 @@ Using floating-point variables should not be used as loop counters, as they are
Environment variables are not portable, the variable name itself (not only the value) may be different depending on the running OS.
Not only the names of the specific environment variables can differ (e.g. `USERNAME` in Windows and `USER` in Unix systems),
but even the semantics differ, e.g. the case sensitivity (Windows being case-insensitive and Unix case-sensitive).
Thus, the environment variables may not obey the general contract of the <code>Object.equals(java.lang.Object)</code> and <code>Object.hashCode()</code> methods.
Consequently, environment variables may have unintended side effects.
Moreover, the Map of the environment variables returned by <code>java.lang.System.getenv()</code> and its collection views may not obey
the general contract of the <code>Object.equals(java.lang.Object)</code> and <code>Object.hashCode()</code> methods.
Consequently, using environment variables may have unintended side effects.
Also, The visibility of environment variables are also less restricted compared to Java Properties: they are visible to all descendants
of the defining process, not just the immediate Java subprocess.
For these reasons, even the Java API of <code>java.lang.System</code> advises to use Java properties (<code>java.lang.System.getProperty(java.lang.String)</code>)
Expand Down

0 comments on commit 47bf07b

Please sign in to comment.