Author: markt
Date: Wed Dec 9 12:36:15 2015
New Revision: 1718836
URL: http://svn.apache.org/viewvc?rev=1718836&view=rev
Log:
Clean-up. No functional change.
Modified:
tomcat/trunk/java/org/apache/catalina/core/StandardWrapper.java
Modified: tomcat/trunk/java/org/apache/catalina/core/StandardWrapper.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardWrapper.java?rev=1718836&r1=1718835&r2=1718836&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/StandardWrapper.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardWrapper.java Wed Dec 9
12:36:15 2015
@@ -797,22 +797,22 @@ public class StandardWrapper extends Con
public Servlet allocate() throws ServletException {
// If we are currently unloading this servlet, throw an exception
- if (unloading)
- throw new ServletException
- (sm.getString("standardWrapper.unloading", getName()));
+ if (unloading) {
+ throw new
ServletException(sm.getString("standardWrapper.unloading", getName()));
+ }
boolean newInstance = false;
// If not SingleThreadedModel, return the same instance every time
if (!singleThreadModel) {
-
// Load and initialize our instance if necessary
if (instance == null) {
synchronized (this) {
if (instance == null) {
try {
- if (log.isDebugEnabled())
+ if (log.isDebugEnabled()) {
log.debug("Allocating non-STM instance");
+ }
// Note: We don't know if the Servlet implements
// SingleThreadModel until we have loaded it.
@@ -828,8 +828,7 @@ public class StandardWrapper extends Con
throw e;
} catch (Throwable e) {
ExceptionUtils.handleThrowable(e);
- throw new ServletException
- (sm.getString("standardWrapper.allocate"), e);
+ throw new
ServletException(sm.getString("standardWrapper.allocate"), e);
}
}
}
@@ -849,19 +848,19 @@ public class StandardWrapper extends Con
}
}
} else {
- if (log.isTraceEnabled())
+ if (log.isTraceEnabled()) {
log.trace(" Returning non-STM instance");
+ }
// For new instances, count will have been incremented at the
// time of creation
if (!newInstance) {
countAllocated.incrementAndGet();
}
- return (instance);
+ return instance;
}
}
synchronized (instancePool) {
-
while (countAllocated.get() >= nInstances) {
// Allocate a new instance if possible, or else wait
if (nInstances < maxInstances) {
@@ -872,8 +871,7 @@ public class StandardWrapper extends Con
throw e;
} catch (Throwable e) {
ExceptionUtils.handleThrowable(e);
- throw new ServletException
- (sm.getString("standardWrapper.allocate"), e);
+ throw new
ServletException(sm.getString("standardWrapper.allocate"), e);
}
} else {
try {
@@ -883,13 +881,12 @@ public class StandardWrapper extends Con
}
}
}
- if (log.isTraceEnabled())
+ if (log.isTraceEnabled()) {
log.trace(" Returning allocated STM instance");
+ }
countAllocated.incrementAndGet();
return instancePool.pop();
-
}
-
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]