mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-04 17:20:55 +07:00
27 lines
1.0 KiB
HTML
27 lines
1.0 KiB
HTML
<html>
|
|
<body>
|
|
Reports methods and fields in the <code>Serializable</code> and <code>Externalizable</code>
|
|
classes that are not suitable to be annotated with the <code>java.io.Serial</code> annotation.
|
|
<p><b>Examples:</b></p>
|
|
<pre><code>
|
|
class Test implements Serializable {
|
|
@Serial // The annotated field is not a part of serialization mechanism because it's not final
|
|
private static long serialVersionUID = 7874493593505141603L;
|
|
|
|
@Serial // The annotated method is not a part of the serialization mechanism because it's not private
|
|
void writeObject(ObjectOutputStream out) throws IOException {
|
|
}
|
|
}
|
|
</code></pre>
|
|
<pre><code>
|
|
class Test implements Externalizable {
|
|
@Serial // The annotated method is not a part of the serialization mechanism as it's inside Externalizable class
|
|
private void writeObject(ObjectOutputStream out) throws IOException {
|
|
}
|
|
}
|
|
</code></pre>
|
|
<p>For information about all valid cases, refer to the Javadoc of the <code>java.io.Serial</code> class.</p>
|
|
<!-- tooltip end -->
|
|
<p><small>New in 2020.3</small></p>
|
|
</body>
|
|
</html> |