So if I were logging and wanted to reference a class, it might not be a bad idea to use something like this:
log.warn("I did not find an instance of class "+SomeClass.class.getName());
This way a refactor would be guaranteed to update the string to use the correct name.
It would be really neat to be able to do this with Methods. You can't with Java 7, but perhaps something based on java 8 would work, like this:
log.warn("You forgot to call "+(SomeClass::aMethod).getName()+" before calling this method");
--it WOULD work great if SomeClass::aMethod was actually a method reference and not a Lambda.
Does anyone know of a way to make this work, perhaps extract the original method name from the lambda?