Files
openide/plugins/kotlin/code-insight/descriptions/resources-en/inspectionDescriptions/MemberVisibilityCanBePrivate.html
Ilya Kirillov 3386f8f5a9 [kotlin] move inspection descriptions to separate module to reuse in K2
GitOrigin-RevId: e9d7382f4d640e27b1958d1bf2d4c3e639915137
2022-07-13 09:59:31 +00:00

17 lines
533 B
HTML

<html>
<body>
Reports declarations that can be made <code>private</code> to follow the encapsulation principle.
<p><b>Example:</b></p>
<pre><code>
class Service(val url: String) {
fun connect(): URLConnection = URL(url).openConnection()
}
</code></pre>
<p>After the quick-fix is applied (considering there are no usages of <code>url</code> outside of <code>Service</code> class):</p>
<pre><code>
class Service(private val url: String) {
fun connect(): URLConnection = URL(url).openConnection()
}
</code></pre>
</body>
</html>