PORT.ENV
Do not use "System.getenv()"
Description
This rule flags any occurrence of `System.getenv()'.
`System.getenv()' has been deprecated because it is not portable.
Example
package PORT;
public class ENV {
void method (String name) {
System.getenv(name);
java.lang.System.getenv(name);
}
}
Repair
Use `System.getProperty()' and the corresponding `getTypeName()' methods of the "boolean", "integer", and "long" primitive types.
Reference
Flanagan, David. Java in a Nutshell. O'Reilly, 1999, pp.190-192.
|