title: Java "self" (static) reference
body: <p>I am looking for a "self" reference to the current class in JAVA in a static context manner like in <a href="http://www.php.net/manual/en/language.oop5.paamayim-nekudotayim.php" rel="noreferrer">PHP Scope Resolution Operator</a>?</p>
  
  <p>Solution: Break out of scope? BEWARE, this is compared to a static definition <em>really</em> slow (by factor 300):</p>
  
  <pre><code>static Logger LOG = LoggerFactory.getLogger(new RuntimeException().getStackTrace()[0].getClassName());
  </code></pre>
  
  <p>The old-fashioned way would be:  </p>
  
  <pre><code>static Logger LOG = LoggerFactory.getLogger(&lt;Classname&gt;.class.getName());
  </code></pre>
  
  <p>Are there any alternatives? I'm looking for a way to put the logger definition in an abstract class. The logger should determine the class it's being called from by itself.</p>