Is it possible to use Checkstyle to forbid usage of some constructors or method that use system-dependent defaults (locale, charset, etc..). I prefer to enforce a policy where the programmer should be explicit about system-dependent values. So I consider the following items to be dangerous:
- all the constructors of
java.io.FielWriter
- using system-dependent encoding
- the
OutputStreamWriter(OutputStream os)
constructor ofjava.io.OutputStreamWriter
- using system-dependent encoding
- the
java.lang.String.toLowerCase()
method- using system default locale
- The
java.util.Calendar.getInstance()
method- using system default locale and default timezone
(the list goes on, you get the picture).
Is it possible to enforce this using Checkstyle 5.5?