How comes that it is possible to write this.class in the fields declaration of a class and it will actually do what is expected?
E.g.:
private static final logger = Logger.getLogger(this.class)
P.S.: Seems like a great place for Schroedinbug. 🙂
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In Groovy
thisis bound to the class in a static context, and you can call static methods on it.Logger.getLogger(this.class)would be equivalent to justLogger.getLogger(Class).