mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
RecordCanBeClass description updated according to review
GitOrigin-RevId: 9496ae38a791b5e835decb3881eb0efd9cb7bd87
This commit is contained in:
committed by
intellij-monorepo-bot
parent
e40de37ce9
commit
bd24e716a3
@@ -1,19 +1,18 @@
|
||||
<html>
|
||||
<body>
|
||||
Reports all Java records suggesting to desugar them to the ordinary classes.
|
||||
This inspection could be useful if you need to move Java record to the code base
|
||||
that uses older Java version where records are not supported.
|
||||
Suggests to replace records with ordinary classes.
|
||||
The inspection could be useful if you need to move Java record
|
||||
to codebases that use earlier Java versions.
|
||||
<p>
|
||||
Note that the resulting class is not completely equivalent to the original record.
|
||||
In particular:
|
||||
Note that the resulting class is not completely equivalent to the original record:
|
||||
</p>
|
||||
<ul>
|
||||
<li>It doesn't extend <code>java.lang.Record</code> anymore, so <code>instanceof Record</code>
|
||||
checks will now return false.</li>
|
||||
<li>Reflection methods like <code>Class.isRecord()</code> or
|
||||
<code>Class.getRecordComponents()</code> will produce different result.</li>
|
||||
<li>The precise algorithm for default hashCode() implementation is not specified.
|
||||
The generated replacement will likely have different hashCode() result.</li>
|
||||
<li>the resulting class no longer extends <code>java.lang.Record</code>,
|
||||
so <code>instanceof Record</code> returns false.</li>
|
||||
<li>reflection methods like <code>Class.isRecord()</code> and
|
||||
<code>Class.getRecordComponents()</code> produce different results.</li>
|
||||
<li>the generated <code>hashCode()</code> implementation may produce different result,
|
||||
as exact formula used to calculate record hashCode is deliberately not specified.</li>
|
||||
</ul>
|
||||
<!-- tooltip end -->
|
||||
<p>Example:</p>
|
||||
@@ -61,7 +60,7 @@ This record will be converted to
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
<p>This inspection only reports if the configured language level is 14 Preview or 15 Preview.</p>
|
||||
<p>This inspection only applies to language level 14 preview and 15 preview.</p>
|
||||
<p><small>New in 2020.3</small></p>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user