Bukkit/Bukkit — comment on commit 094baecc0636caff880660a730701e3efb5e0581
File:  line 0
By Afforess:

Boy, you don't know when to give up...

First, This is a helper method. It is not used in every plugin. Anecdotally, I have never used it before. It is called infrequently (at worst, this is used during onEnable). Object creation is not a real concern here.

Second, It is Not a bad habit to, as you put it, to make new objects everywhere. This isn't Fortran. We aren't writing procedural code. Object-Oriented programming means you have to create Objects (The Horror!). Object creation is only troublesome when you abuse it by creating objects that are short lived and unnecessary. Entity.getLocation() is an example of this, as it creates a new location every call. But getResource() is not. If you had ever profiled MC's heap before, you would know this...

Third, there is NO better way to write this to achieve the existing functionality w/o the object overhead. I've been trying to tell you this, but you seem to not understand. There is NOT anything that can be done to reduce the object count. Using it the old way creates bugs. So you are railing against something that could not be fixed, even if all your other arguments were correct.