This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 7.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 236bec697747762a1147f8039f2fd36d6ec0dfad Author: Mark Thomas <ma...@apache.org> AuthorDate: Mon Feb 17 10:22:18 2020 +0000 Clean-up. Fix Javadoc warnings with newer JREs. Align with 8.5.x. --- java/org/apache/catalina/connector/Response.java | 3 ++ java/org/apache/catalina/core/ContainerBase.java | 67 +++++++++--------------- 2 files changed, 28 insertions(+), 42 deletions(-) diff --git a/java/org/apache/catalina/connector/Response.java b/java/org/apache/catalina/connector/Response.java index 14182f1..61ecf0e 100644 --- a/java/org/apache/catalina/connector/Response.java +++ b/java/org/apache/catalina/connector/Response.java @@ -944,6 +944,9 @@ public class Response implements HttpServletResponse { * Reset this response, and specify the values for the HTTP status code * and corresponding message. * + * @param status The new HTTP status + * @param message The associated text message + * * @exception IllegalStateException if this response has already been * committed */ diff --git a/java/org/apache/catalina/core/ContainerBase.java b/java/org/apache/catalina/core/ContainerBase.java index f22f4f6..9a48670 100644 --- a/java/org/apache/catalina/core/ContainerBase.java +++ b/java/org/apache/catalina/core/ContainerBase.java @@ -304,6 +304,7 @@ public abstract class ContainerBase extends LifecycleMBeanBase private int startStopThreads = 1; protected ThreadPoolExecutor startStopExecutor; + // ------------------------------------------------------------- Properties @Override @@ -475,12 +476,10 @@ public abstract class ContainerBase extends LifecycleMBeanBase */ @Override public Log getLogger() { - if (logger != null) - return (logger); + return logger; logger = LogFactory.getLog(logName()); - return (logger); - + return logger; } @@ -621,6 +620,7 @@ public abstract class ContainerBase extends LifecycleMBeanBase */ @Override public void setCluster(Cluster cluster) { + Cluster oldCluster = null; Lock writeLock = clusterLock.writeLock(); writeLock.lock(); @@ -633,7 +633,7 @@ public abstract class ContainerBase extends LifecycleMBeanBase // Stop the old component if necessary if (getState().isAvailable() && (oldCluster != null) && - (oldCluster instanceof Lifecycle)) { + (oldCluster instanceof Lifecycle)) { try { ((Lifecycle) oldCluster).stop(); } catch (LifecycleException e) { @@ -669,9 +669,7 @@ public abstract class ContainerBase extends LifecycleMBeanBase */ @Override public String getName() { - - return (name); - + return name; } @@ -700,11 +698,11 @@ public abstract class ContainerBase extends LifecycleMBeanBase /** * Return if children of this container will be started automatically when * they are added to this container. + * + * @return <code>true</code> if the children will be started */ public boolean getStartChildren() { - - return (startChildren); - + return startChildren; } @@ -728,9 +726,7 @@ public abstract class ContainerBase extends LifecycleMBeanBase */ @Override public Container getParent() { - - return (parent); - + return parent; } @@ -763,12 +759,11 @@ public abstract class ContainerBase extends LifecycleMBeanBase @Override public ClassLoader getParentClassLoader() { if (parentClassLoader != null) - return (parentClassLoader); + return parentClassLoader; if (parent != null) { - return (parent.getParentClassLoader()); + return parent.getParentClassLoader(); } - return (ClassLoader.getSystemClassLoader()); - + return ClassLoader.getSystemClassLoader(); } @@ -797,9 +792,7 @@ public abstract class ContainerBase extends LifecycleMBeanBase */ @Override public Pipeline getPipeline() { - - return (this.pipeline); - + return this.pipeline; } @@ -812,12 +805,12 @@ public abstract class ContainerBase extends LifecycleMBeanBase public Realm getRealm() { Lock l = realmLock.readLock(); + l.lock(); try { - l.lock(); if (realm != null) - return (realm); + return realm; if (parent != null) - return (parent.getRealm()); + return parent.getRealm(); return null; } finally { l.unlock(); @@ -827,8 +820,8 @@ public abstract class ContainerBase extends LifecycleMBeanBase protected Realm getRealmInternal() { Lock l = realmLock.readLock(); + l.lock(); try { - l.lock(); return realm; } finally { l.unlock(); @@ -844,10 +837,8 @@ public abstract class ContainerBase extends LifecycleMBeanBase public void setRealm(Realm realm) { Lock l = realmLock.writeLock(); - + l.lock(); try { - l.lock(); - // Change components if necessary Realm oldRealm = this.realm; if (oldRealm == realm) @@ -1042,9 +1033,7 @@ public abstract class ContainerBase extends LifecycleMBeanBase */ @Override public void addPropertyChangeListener(PropertyChangeListener listener) { - support.addPropertyChangeListener(listener); - } @@ -1056,13 +1045,12 @@ public abstract class ContainerBase extends LifecycleMBeanBase */ @Override public Container findChild(String name) { - - if (name == null) - return (null); + if (name == null) { + return null; + } synchronized (children) { return children.get(name); } - } @@ -1072,12 +1060,10 @@ public abstract class ContainerBase extends LifecycleMBeanBase */ @Override public Container[] findChildren() { - synchronized (children) { Container results[] = new Container[children.size()]; return children.values().toArray(results); } - } @@ -1508,7 +1494,6 @@ public abstract class ContainerBase extends LifecycleMBeanBase // ------------------------------------------------------ Protected Methods - /** * Notify all container event listeners that a particular event has * occurred for this Container. The default implementation performs @@ -1532,7 +1517,7 @@ public abstract class ContainerBase extends LifecycleMBeanBase /** - * Return the abbreviated name of this container for logging messages + * @return the abbreviated name of this container for logging messages */ protected String logName() { @@ -1624,9 +1609,8 @@ public abstract class ContainerBase extends LifecycleMBeanBase // -------------------------------------- ContainerExecuteDelay Inner Class - /** - * Private thread class to invoke the backgroundProcess method + * Private runnable class to invoke the backgroundProcess method * of this container and its children after a fixed delay. */ protected class ContainerBackgroundProcessor implements Runnable { @@ -1690,7 +1674,7 @@ public abstract class ContainerBase extends LifecycleMBeanBase } - // ----------------------------- Inner classes used with start/stop Executor + // ---------------------------- Inner classes used with start/stop Executor private static class StartChild implements Callable<Void> { @@ -1742,5 +1726,4 @@ public abstract class ContainerBase extends LifecycleMBeanBase return thread; } } - } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org