## Uses of Class
java.lang.Deprecated

- Packages that use Deprecated
  Package | Description
  --- | ---
  java.io |
  java.lang |
  java.net |
  java.util |
  java.util.logging |
  org.openide.util | Client API part of the Lookup interfaces.
  org.openide.util.lookup.implspi | Interfaces intended to be used within the NetBeans Platform.

- - ### Uses of Deprecated in java.io

    Classes in java.io with annotations of type Deprecated
    Modifier and Type | Class and Description
    --- | ---
    `class` | `LineNumberInputStream` Deprecated. This class incorrectly assumes that bytes adequately represent characters. As of JDK 1.1, the preferred way to operate on character streams is via the new character-stream classes, which include a class for counting line numbers.

    Methods in java.io with annotations of type Deprecated
    Modifier and Type | Method and Description
    --- | ---
    `String` | ObjectInputStream.`readLine()` Deprecated. This method does not properly convert bytes to characters. see DataInputStream for the details and alternatives.
    > `String` | DataInputStream.`readLine()` Deprecated. This method does not properly convert bytes to characters. As of JDK 1.1, the preferred way to read lines of text is via the `BufferedReader.readLine()` method. Programs that use the `DataInputStream` class to read lines can be converted to use the `BufferedReader` class by replacing code of the form:
    >          DataInputStream d = new DataInputStream(in);
    > with:
    >          BufferedReader d
    >               = new BufferedReader(new InputStreamReader(in));
    `String` | ByteArrayOutputStream.`toString(int hibyte)` Deprecated. This method does not properly convert bytes into characters. As of JDK 1.1, the preferred way to do this is via the `toString(String enc)` method, which takes an encoding-name argument, or the `toString()` method, which uses the platform's default character encoding.
    `URL` | File.`toURL()` Deprecated. This method does not automatically escape characters that are illegal in URLs. It is recommended that new code convert an abstract pathname into a URL by first converting it into a URI, via the `toURI` method, and then converting the URI into a URL via the `URI.toURL` method.
    `abstract void` | ObjectOutputStream.PutField.`write(ObjectOutput out)` Deprecated. This method does not write the values contained by this `PutField` object in a proper format, and may result in corruption of the serialization stream. The correct way to write `PutField` data is by calling the `ObjectOutputStream.writeFields()` method.

  - ### Uses of Deprecated in java.lang

    Methods in java.lang with annotations of type Deprecated
    Modifier and Type | Method and Description
    --- | ---
    `int` | Thread.`countStackFrames()` Deprecated. The definition of this call depends on `Thread.suspend()`, which is deprecated. Further, the results of this call were never well-defined.
    `protected Class<?>` | ClassLoader.`defineClass(byte[] b, int off, int len)` Deprecated. Replaced by `defineClass(String, byte[], int, int)`
    `void` | Thread.`destroy()` Deprecated. This method was originally designed to destroy this thread without any cleanup. Any monitors it held would have remained locked. However, the method was never implemented. If if were to be implemented, it would be deadlock-prone in much the manner of `Thread.suspend()`. If the target thread held a lock protecting a critical system resource when it was destroyed, no thread could ever access this resource again. If another thread ever attempted to lock this resource, deadlock would result. Such deadlocks typically manifest themselves as "frozen" processes. For more information, see Why are Thread.stop, Thread.suspend and Thread.resume Deprecated?.
    `void` | String.`getBytes(int srcBegin, int srcEnd, byte[] dst, int dstBegin)` Deprecated. This method does not properly convert characters into bytes. As of JDK 1.1, the preferred way to do this is via the `String.getBytes()` method, which uses the platform's default charset.
    `static boolean` | Character.`isSpace(char ch)` Deprecated. Replaced by isWhitespace(char).
    `void` | Thread.`resume()` Deprecated. This method exists solely for use with `Thread.suspend()`, which has been deprecated because it is deadlock-prone. For more information, see Why are Thread.stop, Thread.suspend and Thread.resume Deprecated?.
    `void` | Thread.`stop()` Deprecated. This method is inherently unsafe. Stopping a thread with Thread.stop causes it to unlock all of the monitors that it has locked (as a natural consequence of the unchecked `ThreadDeath` exception propagating up the stack). If any of the objects previously protected by these monitors were in an inconsistent state, the damaged objects become visible to other threads, potentially resulting in arbitrary behavior. Many uses of `stop` should be replaced by code that simply modifies some variable to indicate that the target thread should stop running. The target thread should check this variable regularly, and return from its run method in an orderly fashion if the variable indicates that it is to stop running. If the target thread waits for long periods (on a condition variable, for example), the `interrupt` method should be used to interrupt the wait. For more information, see Why are Thread.stop, Thread.suspend and Thread.resume Deprecated?.
    `void` | Thread.`stop(Throwable obj)` Deprecated. This method is inherently unsafe. See `Thread.stop()` for details. An additional danger of this method is that it may be used to generate exceptions that the target thread is unprepared to handle (including checked exceptions that the thread could not possibly throw, were it not for this method). For more information, see Why are Thread.stop, Thread.suspend and Thread.resume Deprecated?.
    `void` | Thread.`suspend()` Deprecated. This method has been deprecated, as it is inherently deadlock-prone. If the target thread holds a lock on the monitor protecting a critical system resource when it is suspended, no thread can access this resource until the target thread is resumed. If the thread that would resume the target thread attempts to lock this monitor prior to calling `resume`, deadlock results. Such deadlocks typically manifest themselves as "frozen" processes. For more information, see Why are Thread.stop, Thread.suspend and Thread.resume Deprecated?.

    Constructors in java.lang with annotations of type Deprecated
    Constructor and Description
    `String(byte[] ascii, int hibyte)` Deprecated. This method does not properly convert bytes into characters. As of JDK 1.1, the preferred way to do this is via the `String` constructors that take a `Charset`, charset name, or that use the platform's default charset.
    `String(byte[] ascii, int hibyte, int offset, int count)` Deprecated. This method does not properly convert bytes into characters. As of JDK 1.1, the preferred way to do this is via the `String` constructors that take a `Charset`, charset name, or that use the platform's default charset.

  - ### Uses of Deprecated in java.net

    Methods in java.net with annotations of type Deprecated
    Modifier and Type | Method and Description
    --- | ---
    `static String` | URLConnection.`getDefaultRequestProperty(String key)` Deprecated. The instance specific getRequestProperty method should be used after an appropriate instance of URLConnection is obtained.
    `static void` | URLConnection.`setDefaultRequestProperty(String key, String value)` Deprecated. The instance specific setRequestProperty method should be used after an appropriate instance of URLConnection is obtained. Invoking this method will have no effect.
    `protected void` | URLStreamHandler.`setURL(URL u, String protocol, String host, int port, String file, String ref)` Deprecated. Use setURL(URL, String, String, int, String, String, String, String);

  - ### Uses of Deprecated in java.util

    Methods in java.util with annotations of type Deprecated
    Modifier and Type | Method and Description
    --- | ---
    `int` | Date.`getDate()` Deprecated. As of JDK version 1.1, replaced by `Calendar.get(Calendar.DAY_OF_MONTH)`.
    `int` | Date.`getDay()` Deprecated. As of JDK version 1.1, replaced by `Calendar.get(Calendar.DAY_OF_WEEK)`.
    `int` | Date.`getHours()` Deprecated. As of JDK version 1.1, replaced by `Calendar.get(Calendar.HOUR_OF_DAY)`.
    `int` | Date.`getMinutes()` Deprecated. As of JDK version 1.1, replaced by `Calendar.get(Calendar.MINUTE)`.
    `int` | Date.`getMonth()` Deprecated. As of JDK version 1.1, replaced by `Calendar.get(Calendar.MONTH)`.
    `int` | Date.`getSeconds()` Deprecated. As of JDK version 1.1, replaced by `Calendar.get(Calendar.SECOND)`.
    `int` | Date.`getTimezoneOffset()` Deprecated. As of JDK version 1.1, replaced by `-(Calendar.get(Calendar.ZONE_OFFSET) + Calendar.get(Calendar.DST_OFFSET)) / (60 * 1000)`.
    `int` | Date.`getYear()` Deprecated. As of JDK version 1.1, replaced by `Calendar.get(Calendar.YEAR) - 1900`.
    `static long` | Date.`parse(String s)` Deprecated. As of JDK version 1.1, replaced by `DateFormat.parse(String s)`.
    `void` | Properties.`save(OutputStream out, String comments)` Deprecated. This method does not throw an IOException if an I/O error occurs while saving the property list. The preferred way to save a properties list is via the `store(OutputStream out, String comments)` method or the `storeToXML(OutputStream os, String comment)` method.
    `void` | Date.`setDate(int date)` Deprecated. As of JDK version 1.1, replaced by `Calendar.set(Calendar.DAY_OF_MONTH, int date)`.
    `void` | Date.`setHours(int hours)` Deprecated. As of JDK version 1.1, replaced by `Calendar.set(Calendar.HOUR_OF_DAY, int hours)`.
    `void` | Date.`setMinutes(int minutes)` Deprecated. As of JDK version 1.1, replaced by `Calendar.set(Calendar.MINUTE, int minutes)`.
    `void` | Date.`setMonth(int month)` Deprecated. As of JDK version 1.1, replaced by `Calendar.set(Calendar.MONTH, int month)`.
    `void` | Date.`setSeconds(int seconds)` Deprecated. As of JDK version 1.1, replaced by `Calendar.set(Calendar.SECOND, int seconds)`.
    `void` | Date.`setYear(int year)` Deprecated. As of JDK version 1.1, replaced by `Calendar.set(Calendar.YEAR, year + 1900)`.
    `String` | Date.`toGMTString()` Deprecated. As of JDK version 1.1, replaced by `DateFormat.format(Date date)`, using a GMT `TimeZone`.
    `String` | Date.`toLocaleString()` Deprecated. As of JDK version 1.1, replaced by `DateFormat.format(Date date)`.
    `static long` | Date.`UTC(int year, int month, int date, int hrs, int min, int sec)` Deprecated. As of JDK version 1.1, replaced by `Calendar.set(year + 1900, month, date, hrs, min, sec)` or `GregorianCalendar(year + 1900, month, date, hrs, min, sec)`, using a UTC `TimeZone`, followed by `Calendar.getTime().getTime()`.

    Constructors in java.util with annotations of type Deprecated
    Constructor and Description
    `Date(int year, int month, int date)` Deprecated. As of JDK version 1.1, replaced by `Calendar.set(year + 1900, month, date)` or `GregorianCalendar(year + 1900, month, date)`.
    `Date(int year, int month, int date, int hrs, int min)` Deprecated. As of JDK version 1.1, replaced by `Calendar.set(year + 1900, month, date, hrs, min)` or `GregorianCalendar(year + 1900, month, date, hrs, min)`.
    `Date(int year, int month, int date, int hrs, int min, int sec)` Deprecated. As of JDK version 1.1, replaced by `Calendar.set(year + 1900, month, date, hrs, min, sec)` or `GregorianCalendar(year + 1900, month, date, hrs, min, sec)`.
    `Date(String s)` Deprecated. As of JDK version 1.1, replaced by `DateFormat.parse(String s)`.

  - ### Uses of Deprecated in java.util.logging

    Fields in java.util.logging with annotations of type Deprecated
    Modifier and Type | Field and Description
    --- | ---
    `static Logger` | Logger.`global` Deprecated. Initialization of this field is prone to deadlocks. The field must be initialized by the Logger class initialization which may cause deadlocks with the LogManager class initialization. In such cases two class initialization wait for each other to complete. The preferred way to get the global logger object is via the call `Logger.getGlobal()`. For compatibility with old JDK versions where the `Logger.getGlobal()` is not available use the call `Logger.getLogger(Logger.GLOBAL_LOGGER_NAME)` or `Logger.getLogger("global")`.

  - ### Uses of Deprecated in org.openide.util

    Constructors in org.openide.util with annotations of type Deprecated
    Constructor and Description
    `Template()` Deprecated. Use `new Template (Object.class)` which is going to be better typed with JDK1.5 templates and should produce the same result.

  - ### Uses of Deprecated in org.openide.util.lookup.implspi

    Methods in org.openide.util.lookup.implspi with annotations of type Deprecated
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | AbstractServiceProviderProcessor.`register(TypeElement el, Class<? extends Annotation> annotation, TypeMirror type, String path, int position, String[] supersedes)` Deprecated.

Copyright © 2025 API Design. All Rights Reserved.