Files
openide/java/java-impl/resources/inspectionDescriptions/SerialAnnotationUsedOnWrongMember.html
Leonid Shalupov 40795fe787 IJI-2422: community/java: move resources under resources root
GitOrigin-RevId: 8b2b63fc6db476ca0c2cfe5cadd84db6c4236d0f
2025-02-05 04:43:28 +00:00

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>