| Package | Description |
|---|---|
| java.io | |
| java.lang | |
| java.net |
| Modifier and Type | Method and Description |
|---|---|
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:
with:
|
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. |
| 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?. |
| 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. |
| Modifier and Type | Method and Description |
|---|---|
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);
|
Copyright © 2025 API Design. All Rights Reserved.