posted 17 years ago
I think the most important question is not who does the conversion, but whether the conversion needs to be done. I've seen a few examples recently of people declaring variables as, e.g., Integer or Boolean when they really mean int or boolean. In complex code, I can see this causing a lot of unncecssary conversions, and I would guess that's what that article was talking about. In general, I recommend always declaring your primitives as primitives unless you know they will only be used in an object context, like the keys in a Map. Another way to head off unintended conversions is to declare your fields, variables and parameters final whenever you can. Of course, these are things we should have been doing all along, for robustness as well as performance, but auto-boxing makes them more relevant than ever.