Never use 'this.' when accessing loggers
Ensure that `this.` is never used when accessing loggers. Issue: SPR-16968
This commit is contained in:
committed by
Juergen Hoeller
parent
0b53c1096a
commit
9de3689f63
@@ -492,8 +492,8 @@ public abstract class FrameworkServlet extends HttpServletBean implements Applic
|
||||
@Override
|
||||
protected final void initServletBean() throws ServletException {
|
||||
getServletContext().log("Initializing Spring FrameworkServlet '" + getServletName() + "'");
|
||||
if (this.logger.isInfoEnabled()) {
|
||||
this.logger.info("FrameworkServlet '" + getServletName() + "': initialization started");
|
||||
if (logger.isInfoEnabled()) {
|
||||
logger.info("FrameworkServlet '" + getServletName() + "': initialization started");
|
||||
}
|
||||
long startTime = System.currentTimeMillis();
|
||||
|
||||
@@ -502,13 +502,13 @@ public abstract class FrameworkServlet extends HttpServletBean implements Applic
|
||||
initFrameworkServlet();
|
||||
}
|
||||
catch (ServletException | RuntimeException ex) {
|
||||
this.logger.error("Context initialization failed", ex);
|
||||
logger.error("Context initialization failed", ex);
|
||||
throw ex;
|
||||
}
|
||||
|
||||
if (this.logger.isInfoEnabled()) {
|
||||
if (logger.isInfoEnabled()) {
|
||||
long elapsedTime = System.currentTimeMillis() - startTime;
|
||||
this.logger.info("FrameworkServlet '" + getServletName() + "': initialization completed in " +
|
||||
logger.info("FrameworkServlet '" + getServletName() + "': initialization completed in " +
|
||||
elapsedTime + " ms");
|
||||
}
|
||||
}
|
||||
@@ -567,8 +567,8 @@ public abstract class FrameworkServlet extends HttpServletBean implements Applic
|
||||
// Publish the context as a servlet context attribute.
|
||||
String attrName = getServletContextAttributeName();
|
||||
getServletContext().setAttribute(attrName, wac);
|
||||
if (this.logger.isTraceEnabled()) {
|
||||
this.logger.trace("Published WebApplicationContext of servlet '" + getServletName() +
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("Published WebApplicationContext of servlet '" + getServletName() +
|
||||
"' as ServletContext attribute [" + attrName + "]");
|
||||
}
|
||||
}
|
||||
@@ -617,8 +617,8 @@ public abstract class FrameworkServlet extends HttpServletBean implements Applic
|
||||
*/
|
||||
protected WebApplicationContext createWebApplicationContext(@Nullable ApplicationContext parent) {
|
||||
Class<?> contextClass = getContextClass();
|
||||
if (this.logger.isTraceEnabled()) {
|
||||
this.logger.trace("Servlet '" + getServletName() +
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("Servlet '" + getServletName() +
|
||||
"' will create custom WebApplicationContext context of class '" +
|
||||
contextClass.getName() + "'" + ", parent context [" + parent + "]");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user