Files
openide/java/java-impl/resources/inspectionDescriptions/CopyConstructorMissesField.html
2025-02-05 04:43:28 +00:00

27 lines
531 B
HTML

<html>
<body>
Reports copy constructors that don't copy all the fields of the class.
<p>
<code>final</code> fields with initializers and <code>transient</code> fields are considered unnecessary to copy.
</p>
<p><b>Example:</b></p>
<pre><code>
class Point {
private int x;
private int y;
Point(int x, int y) {
this.x = x;
this.y = y;
}
Point(Point other) {
// fields x and y are not initialized
}
}
</code></pre>
<!-- tooltip end -->
<p><small>New in 2018.1</small>
</body>
</html>