<div dir="ltr">Hi everyone , <br><br>This is my first proposal to Java open JDK , so I&#39;m not sure I&#39;m in the right place.<br><br>I propose that Java will include a static equivalent to &#39;&quot;this&quot; keyword. like this &quot;this#&quot; to return the class is static scope.<br>

<br>I had this needs because of the logger as every time you want to use the static class inside the class itself you need to hard code that. <br><br>Example :<br><br>private static Logger logger = Logger.getLogger(&quot;com.Customer&quot;);  &lt;-- hardcoded class name !<br>

// or private static Logger logger = Logger.getLogger(Customer.class.getName());  &lt;--
 Still hardcoded class <br><br>public static void getCustomerName(){<br>...<br>logger.log(...);<br>}<br clear="all"><br>As you can see, that I had to hardcoded the &quot;com.Customer&quot;, if my logger was non-static , it would have been easy and I would just did the following:<br>

<br><br>private static Logger logger = Logger.getLogger(this.getClass().getName());<br><br>But I&#39;m proposing ?<br><br>private static Logger logger = Logger.getLogger(this#.class.getName()); &lt;-- this way you can copy &amp; paste that at any class, right ? <br>

<br><br><br>As you can see &quot;this#&quot; will return my class in a static scope. <br><br>I came to this problem because I had to copy &amp; paste (private static Logger logger = Logger.getLogger(&quot;Some Class Name ...&quot;);) and rewrite the class name !!! into hundreds of classes.<br>

<br>Best Regards,<br>Alaa Murad<br><br><br>
<br><br><br>-- <br>Alaa Murad<br>E-Service Development Department<br>Bank ALJazira<br>Website: <a href="http://www.alaamurad.com">http://www.alaamurad.com</a><br>Email: <a href="mailto:alaa@alaamurad.com">alaa@alaamurad.com</a><br>

<br>
</div>