Quantcast
Channel: JetBrains Developer Community : Thread List - IntelliJ IDEA Users
Viewing all articles
Browse latest Browse all 5661

"Field can be converted to a local variable" / "Field can be local"

$
0
0

Hi,

 

I believe this warning is false, at least in some cases.

 

I have places where a field is initialized by a call to a method and where that field is used only in a single method, leading to the triggering of this inspection.

 

However, the inspection's validity seems to overlook possible side-effects, non-idempotency and execution costs of the method call used to supply the initializing value for the field in question.

 

Am I mistaken about this?

 

 

Randall Schulz

 

Edited by: Randall Schulz on Apr 29, 2008 12:25 PM — Changed the oxymoronic "local field" to "field" in the 2nd paragraph.


Viewing all articles
Browse latest Browse all 5661

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>