Wiki Markup |
---|
Never use deprecated fields, methods, or classes in new code. The Java SE 6 documentation provides a complete list of deprecated APIs \[[API 2006|AA. Bibliography#API 06]\]. Java provides a {{@deprecated}} annotation to indicate the deprecation of specific fields, methods, orand classes. For instance, many methods of {{java.util.Date}}, such as {{Date.getYear()}}, have been explicitly deprecated. The guideline [THI05-J. Do not use Thread.stop() to terminate threads|THI05-J. Do not use Thread.stop() to terminate threads] describes issues that can result from using the deprecated {{Thread.stop()}} method. |
Wiki Markup |
---|
Obsolete fields, methods, orand classes should not be used. Java provides no annotation to indicate obsolescence;, howeverbut several objects are documented as obsolete. For instance, the {{java.util.Dictionary}} class is marked as obsolete, and new code should use {{java.util.Map<K,V>}} instead \[[API 2006|AA. Bibliography#API 06]\]. |
Finally, several classes and methods impose particular limitations on their use. For instance, all of the subclasses of the abstract
class java.text.Format
are thread-unsafe. These classes must be avoided in multi-threaded multithreaded code. For more information about thread-safety, see guideline TSM04-J. Document thread-safety and use annotations where applicable.
...