Sanne/hibernate-core — comment on commit fcac23d507c864788cb2ed97fd7fedecb46d723e
File: hibernate-core/src/main/java/org/hibernate/cfg/AnnotationBinder.java line 265
By Sanne:

Hi John, sure I'd expect these methods to be cheap but I don't know for sure, especially this one is reading an annotation.
Unless it's very explicit, when in doubt I prefer to guard against it - consider that the trace() method itself is going to check for _isTraceEnabled()_ too, so the comparison in performance is between checking the condition vs checking the condition AND evaluating getName.

I agree that in some cases we should prefer readability, but unless it's very clear that the method doesn't cost much I prefer to be safe.