Vitaly Davidovich wrote:
So it sounds like avoiding these locals is basically trying to work around current compiler limitations, rather than something more fundamental.
If javac did even a smidgen of optimization, this problem would also go away.
I'm also curious if someone has actually noticed any perf degradation in hot code when adding locals like this (Doug? :)). If not (but perf tests were done), then I'm not sure it's worth worrying about.
Of course, I have measured actual performance problems -- otherwise I would not be bringing up this issue :-) Not every case is a problem, but there are some cases that matter, and it is not a good idea to invite people to rewrite, just for the sake of warning suppression, code that explicitly chose not to introduce redundant locals. -Doug