mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-05 01:50:56 +07:00
17 lines
533 B
HTML
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> |