Author: remm Date: Thu Jan 7 16:47:50 2016 New Revision: 1723586 URL: http://svn.apache.org/viewvc?rev=1723586&view=rev Log: Javadoc fixes.
Modified: tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorConditionBase.java tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorCreateTask.java tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorGetTask.java tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorInvokeTask.java tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorQueryTask.java tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorSetTask.java tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorTask.java tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorUnregisterTask.java tomcat/trunk/java/org/apache/catalina/authenticator/AuthenticatorBase.java tomcat/trunk/java/org/apache/catalina/authenticator/DigestAuthenticator.java tomcat/trunk/java/org/apache/catalina/authenticator/FormAuthenticator.java tomcat/trunk/java/org/apache/catalina/connector/Connector.java tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java tomcat/trunk/java/org/apache/catalina/connector/LocalStrings.properties tomcat/trunk/java/org/apache/catalina/connector/OutputBuffer.java tomcat/trunk/java/org/apache/catalina/connector/Request.java tomcat/trunk/java/org/apache/catalina/connector/Response.java tomcat/trunk/java/org/apache/catalina/util/LifecycleBase.java Modified: tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorConditionBase.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorConditionBase.java?rev=1723586&r1=1723585&r2=1723586&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorConditionBase.java (original) +++ tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorConditionBase.java Thu Jan 7 16:47:50 2016 @@ -150,8 +150,8 @@ public abstract class JMXAccessorConditi * from jmxOpen Task). * * @return active JMXConnection - * @throws MalformedURLException - * @throws IOException + * @throws MalformedURLException Invalid URL for JMX server + * @throws IOException Connection error */ protected MBeanServerConnection getJMXConnection() throws MalformedURLException, IOException { Modified: tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorCreateTask.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorCreateTask.java?rev=1723586&r1=1723585&r2=1723586&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorCreateTask.java (original) +++ tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorCreateTask.java Thu Jan 7 16:47:50 2016 @@ -113,14 +113,6 @@ public class JMXAccessorCreateTask exten // ------------------------------------------------------ protected Methods - /** - * Execute the specified command, based on the configured properties. The - * input stream will be closed upon completion of this task, whether it was - * executed successfully or not. - * - * @exception Exception - * if an error occurs - */ @Override public String jmxExecute(MBeanServerConnection jmxServerConnection) throws Exception { @@ -132,19 +124,19 @@ public class JMXAccessorCreateTask exten throw new BuildException( "Must specify a 'className' for get"); } - return jmxCreate(jmxServerConnection, getName()); + jmxCreate(jmxServerConnection, getName()); + return null; } /** - * create new Mbean and when set from ClassLoader Objectname - * @param jmxServerConnection - * @param name - * @return The value of the given named attribute - * @throws Exception + * Create new Mbean and when set from ClassLoader Objectname. + * + * @param jmxServerConnection Connection to the JMX server + * @param name MBean name + * @throws Exception Error crating MBean */ - protected String jmxCreate(MBeanServerConnection jmxServerConnection, + protected void jmxCreate(MBeanServerConnection jmxServerConnection, String name) throws Exception { - String error = null; Object argsA[] = null; String sigA[] = null; if (args != null) { @@ -182,7 +174,6 @@ public class JMXAccessorCreateTask exten else jmxServerConnection.createMBean(className, new ObjectName(name),argsA,sigA); } - return error; } } Modified: tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorGetTask.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorGetTask.java?rev=1723586&r1=1723585&r2=1723586&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorGetTask.java (original) +++ tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorGetTask.java Thu Jan 7 16:47:50 2016 @@ -80,14 +80,6 @@ public class JMXAccessorGetTask extends // ------------------------------------------------------ protected Methods - /** - * Execute the specified command, based on the configured properties. The - * input stream will be closed upon completion of this task, whether it was - * executed successfully or not. - * - * @exception BuildException - * if an error occurs - */ @Override public String jmxExecute(MBeanServerConnection jmxServerConnection) throws Exception { @@ -104,12 +96,14 @@ public class JMXAccessorGetTask extends /** - * @param jmxServerConnection - * @param name - * @return The value of the given named attribute - * @throws Exception + * Get property value. + * + * @param jmxServerConnection The JMX connection name + * @param name The MBean name + * @return The error message if any + * @throws Exception An error occurred */ - protected String jmxGet(MBeanServerConnection jmxServerConnection,String name) throws Exception { + protected String jmxGet(MBeanServerConnection jmxServerConnection, String name) throws Exception { String error = null; if(isEcho()) { handleOutput("MBean " + name + " get attribute " + attribute ); Modified: tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorInvokeTask.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorInvokeTask.java?rev=1723586&r1=1723585&r2=1723586&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorInvokeTask.java (original) +++ tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorInvokeTask.java Thu Jan 7 16:47:50 2016 @@ -131,14 +131,6 @@ public class JMXAccessorInvokeTask exten // ------------------------------------------------------ protected Methods - /** - * Execute the specified command, based on the configured properties. The - * input stream will be closed upon completion of this task, whether it was - * executed successfully or not. - * - * @exception BuildException - * if an error occurs - */ @Override public String jmxExecute(MBeanServerConnection jmxServerConnection) throws Exception { @@ -154,8 +146,12 @@ public class JMXAccessorInvokeTask exten } /** - * @param jmxServerConnection - * @throws Exception + * Invoke specified operation. + * + * @param jmxServerConnection The JMX connection name + * @param name The MBean name + * @return null (no error message to report other than exception) + * @throws Exception An error occurred */ protected String jmxInvoke(MBeanServerConnection jmxServerConnection, String name) throws Exception { Object result ; Modified: tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorQueryTask.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorQueryTask.java?rev=1723586&r1=1723585&r2=1723586&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorQueryTask.java (original) +++ tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorQueryTask.java Thu Jan 7 16:47:50 2016 @@ -82,14 +82,6 @@ public class JMXAccessorQueryTask extend // ------------------------------------------------------ protected Methods - /** - * Execute the specified command, based on the configured properties. The - * input stream will be closed upon completion of this task, whether it was - * executed successfully or not. - * - * @exception Exception - * if an error occurs - */ @Override public String jmxExecute(MBeanServerConnection jmxServerConnection) throws Exception { @@ -105,10 +97,10 @@ public class JMXAccessorQueryTask extend /** * Call Mbean server for some mbeans with same domain, attributes. * with <em>attributebinding=true</em> you can save all attributes from all found objects - * as your ant properties - * @param jmxServerConnection - * @param qry - * @return The query result + * + * @param jmxServerConnection The JMX connection name + * @param qry The query + * @return null (no error message to report other than exception) */ protected String jmxQuery(MBeanServerConnection jmxServerConnection, String qry) { @@ -134,58 +126,48 @@ public class JMXAccessorQueryTask extend ObjectName oname = it.next(); pname = resultproperty + "." + Integer.toString(oindex) + "."; oindex++; - setProperty(pname + "Name", oname.toString()); - if (isAttributebinding()) { - bindAttributes(jmxServerConnection, resultproperty, pname, oname); - - } + setProperty(pname + "Name", oname.toString()); + if (isAttributebinding()) { + bindAttributes(jmxServerConnection, resultproperty, pname, oname); } + } } return isError; } - /** - * @param jmxServerConnection - * @param resultproperty - * @param pname - * @param oname - */ protected void bindAttributes(MBeanServerConnection jmxServerConnection, String resultproperty, String pname, ObjectName oname) { - if (jmxServerConnection != null && resultproperty != null - && pname != null && oname != null ) { - try { - MBeanInfo minfo = jmxServerConnection.getMBeanInfo(oname); - MBeanAttributeInfo attrs[] = minfo.getAttributes(); - Object value = null; - - for (int i = 0; i < attrs.length; i++) { - if (!attrs[i].isReadable()) - continue; - String attName = attrs[i].getName(); - if (attName.indexOf('=') >= 0 || attName.indexOf(':') >= 0 - || attName.indexOf(' ') >= 0) { - continue; - } - - try { - value = jmxServerConnection - .getAttribute(oname, attName); - } catch (Exception e) { - if (isEcho()) - handleErrorOutput("Error getting attribute " - + oname + " " + pname + attName + " " - + e.toString()); - continue; - } - if (value == null) - continue; - if ("modelerType".equals(attName)) - continue; - createProperty(pname + attName, value); + try { + MBeanInfo minfo = jmxServerConnection.getMBeanInfo(oname); + MBeanAttributeInfo attrs[] = minfo.getAttributes(); + Object value = null; + + for (int i = 0; i < attrs.length; i++) { + if (!attrs[i].isReadable()) + continue; + String attName = attrs[i].getName(); + if (attName.indexOf('=') >= 0 || attName.indexOf(':') >= 0 + || attName.indexOf(' ') >= 0) { + continue; } - } catch (Exception e) { - // Ignore + + try { + value = jmxServerConnection + .getAttribute(oname, attName); + } catch (Exception e) { + if (isEcho()) + handleErrorOutput("Error getting attribute " + + oname + " " + pname + attName + " " + + e.toString()); + continue; + } + if (value == null) + continue; + if ("modelerType".equals(attName)) + continue; + createProperty(pname + attName, value); } + } catch (Exception e) { + // Ignore } } } Modified: tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorSetTask.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorSetTask.java?rev=1723586&r1=1723585&r2=1723586&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorSetTask.java (original) +++ tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorSetTask.java Thu Jan 7 16:47:50 2016 @@ -128,14 +128,6 @@ public class JMXAccessorSetTask extends } // ------------------------------------------------------ protected Methods - /** - * Execute the specified command, based on the configured properties. The - * input stream will be closed upon completion of this task, whether it was - * executed successfully or not. - * - * @exception Exception - * if an error occurs - */ @Override public String jmxExecute(MBeanServerConnection jmxServerConnection) throws Exception { @@ -151,9 +143,12 @@ public class JMXAccessorSetTask extends } /** - * @param jmxServerConnection - * @param name - * @throws Exception + * Set property value. + * + * @param jmxServerConnection The JMX connection name + * @param name The MBean name + * @return null (no error message to report other than exception) + * @throws Exception An error occurred */ protected String jmxSet(MBeanServerConnection jmxServerConnection, String name) throws Exception { @@ -176,11 +171,12 @@ public class JMXAccessorSetTask extends /** * Get MBean Attribute from Mbean Server - * @param jmxServerConnection - * @param name - * @param attribute - * @return The type - * @throws Exception + * + * @param jmxServerConnection The JMX connection name + * @param name The MBean name + * @param attribute The attribute name + * @return The type of the attribute + * @throws Exception An error occurred */ protected String getMBeanAttributeType( MBeanServerConnection jmxServerConnection, Modified: tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorTask.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorTask.java?rev=1723586&r1=1723585&r2=1723586&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorTask.java (original) +++ tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorTask.java Thu Jan 7 16:47:50 2016 @@ -197,7 +197,7 @@ public class JMXAccessorTask extends Bas } /** - * The login password for the <code>Manager</code> application. + * @return The login password for the <code>Manager</code> application. */ public String getPassword() { return (this.password); @@ -208,7 +208,7 @@ public class JMXAccessorTask extends Bas } /** - * The login username for the <code>JMX</code> MBeanServer. + * @return The login username for the <code>JMX</code> MBeanServer. */ public String getUsername() { return (this.username); @@ -219,9 +219,8 @@ public class JMXAccessorTask extends Bas } /** - * The URL of the <code>JMX JSR 160</code> MBeanServer to be used. + * @return The URL of the <code>JMX JSR 160</code> MBeanServer to be used. */ - public String getUrl() { return (this.url); } @@ -231,9 +230,8 @@ public class JMXAccessorTask extends Bas } /** - * The Host of the <code>JMX JSR 160</code> MBeanServer to be used. + * @return The Host of the <code>JMX JSR 160</code> MBeanServer to be used. */ - public String getHost() { return (this.host); } @@ -243,9 +241,8 @@ public class JMXAccessorTask extends Bas } /** - * The Port of the <code>JMX JSR 160</code> MBeanServer to be used. + * @return The Port of the <code>JMX JSR 160</code> MBeanServer to be used. */ - public String getPort() { return (this.port); } @@ -345,7 +342,18 @@ public class JMXAccessorTask extends Bas } /** - * create a new JMX Connection with auth when username and password is set. + * Create a new JMX Connection with auth when username and password is set. + * + * @param url URL to be used for the JMX connection + * (if specified, it is a complete URL so host and port will not + * be used) + * @param host Host name of the JMX server + * @param port Port number for the JMX server + * @param username User name for the connection + * @param password Credentials corresponding to the specified user + * @throws MalformedURLException Invalid URL specified + * @throws IOException Other connection error + * @return the JMX connection */ public static MBeanServerConnection createJMXConnection(String url, String host, String port, String username, String password) @@ -397,9 +405,18 @@ public class JMXAccessorTask extends Bas /** * Get Current Connection from <em>ref</em> parameter or create a new one! * - * @return The server connection - * @throws MalformedURLException - * @throws IOException + * @param project The Ant project + * @param url URL to be used for the JMX connection + * (if specified, it is a complete URL so host and port will not + * be used) + * @param host Host name of the JMX server + * @param port Port number for the JMX server + * @param username User name for the connection + * @param password Credentials corresponding to the specified user + * @param refId The Id of the reference to retrieve in the project + * @throws MalformedURLException Invalid URL specified + * @throws IOException Other connection error + * @return the JMX connection */ @SuppressWarnings("null") public static MBeanServerConnection accessJMXConnection(Project project, @@ -433,9 +450,9 @@ public class JMXAccessorTask extends Bas /** * get JMXConnection * - * @return The connection - * @throws MalformedURLException - * @throws IOException + * @throws MalformedURLException Invalid URL specified + * @throws IOException Other connection error + * @return the JMX connection */ protected MBeanServerConnection getJMXConnection() throws MalformedURLException, IOException { @@ -473,8 +490,9 @@ public class JMXAccessorTask extends Bas * input stream will be closed upon completion of this task, whether it was * executed successfully or not. * - * @exception Exception - * if an error occurs + * @param jmxServerConnection The JMX connection that should be used + * @return An error message string in some situations + * @exception Exception if an error occurs */ public String jmxExecute(MBeanServerConnection jmxServerConnection) throws Exception { @@ -556,7 +574,7 @@ public class JMXAccessorTask extends Bas /** * @param name context of result - * @param result + * @param result The result */ protected void echoResult(String name, Object result) { if (isEcho()) { @@ -589,8 +607,8 @@ public class JMXAccessorTask extends Bas * option is that you delimit your result with a delimiter * (java.util.StringTokenizer is used). * - * @param propertyPrefix - * @param result + * @param propertyPrefix Prefix for the property + * @param result The result */ protected void createProperty(String propertyPrefix, Object result) { if (propertyPrefix == null) Modified: tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorUnregisterTask.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorUnregisterTask.java?rev=1723586&r1=1723585&r2=1723586&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorUnregisterTask.java (original) +++ tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorUnregisterTask.java Thu Jan 7 16:47:50 2016 @@ -53,14 +53,6 @@ public class JMXAccessorUnregisterTask e // ------------------------------------------------------ protected Methods - /** - * Execute the specified command, based on the configured properties. The - * input stream will be closed upon completion of this task, whether it was - * executed successfully or not. - * - * @exception Exception - * if an error occurs - */ @Override public String jmxExecute(MBeanServerConnection jmxServerConnection) throws Exception { @@ -73,11 +65,12 @@ public class JMXAccessorUnregisterTask e /** - * Unregister Mbean - * @param jmxServerConnection - * @param name - * @return The value of the given named attribute - * @throws Exception + * Unregister MBean. + * + * @param jmxServerConnection The JMX connection name + * @param name The MBean name + * @return null (no error message to report other than exception) + * @throws Exception An error occurred */ protected String jmxUuregister(MBeanServerConnection jmxServerConnection,String name) throws Exception { String error = null; Modified: tomcat/trunk/java/org/apache/catalina/authenticator/AuthenticatorBase.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/authenticator/AuthenticatorBase.java?rev=1723586&r1=1723585&r2=1723586&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/authenticator/AuthenticatorBase.java (original) +++ tomcat/trunk/java/org/apache/catalina/authenticator/AuthenticatorBase.java Thu Jan 7 16:47:50 2016 @@ -770,6 +770,7 @@ public abstract class AuthenticatorBase * @param ssoId identifier of SingleSignOn session with which the * caller is associated * @param request the request that needs to be authenticated + * @return <code>true</code> if the reauthentication from SSL occurred */ protected boolean reauthenticateFromSSO(String ssoId, Request request) { @@ -945,7 +946,8 @@ public abstract class AuthenticatorBase * @param username The user * @param password The password * @return The authenticated Principal - * @throws ServletException + * @throws ServletException No principal was authenticated with + * the specified credentials */ protected Principal doLogin(Request request, String username, String password) throws ServletException { Modified: tomcat/trunk/java/org/apache/catalina/authenticator/DigestAuthenticator.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/authenticator/DigestAuthenticator.java?rev=1723586&r1=1723585&r2=1723586&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/authenticator/DigestAuthenticator.java (original) +++ tomcat/trunk/java/org/apache/catalina/authenticator/DigestAuthenticator.java Thu Jan 7 16:47:50 2016 @@ -254,6 +254,10 @@ public class DigestAuthenticator extends /** * Removes the quotes on a string. RFC2617 states quotes are optional for * all parameters except realm. + * + * @param quotedString The quoted string + * @param quotesRequired <code>true</code> if quotes were required + * @return The unquoted string */ protected static String removeQuotes(String quotedString, boolean quotesRequired) { @@ -270,6 +274,9 @@ public class DigestAuthenticator extends /** * Removes the quotes on a string. + * + * @param quotedString The quoted string + * @return The unquoted string */ protected static String removeQuotes(String quotedString) { return removeQuotes(quotedString, false); @@ -281,6 +288,7 @@ public class DigestAuthenticator extends * time-stamp ":" private-key ) ). * * @param request HTTP Servlet request + * @return The generated nonce */ protected String generateNonce(Request request) { @@ -334,6 +342,7 @@ public class DigestAuthenticator extends * @param request HTTP Servlet request * @param response HTTP Servlet response * @param nonce nonce token + * @param isNonceStale <code>true</code> to add a stale parameter */ protected void setAuthenticateHeader(HttpServletRequest request, HttpServletResponse response, Modified: tomcat/trunk/java/org/apache/catalina/authenticator/FormAuthenticator.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/authenticator/FormAuthenticator.java?rev=1723586&r1=1723585&r2=1723586&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/authenticator/FormAuthenticator.java (original) +++ tomcat/trunk/java/org/apache/catalina/authenticator/FormAuthenticator.java Thu Jan 7 16:47:50 2016 @@ -466,6 +466,7 @@ public class FormAuthenticator * we signaled after successful authentication? * * @param request The request to be verified + * @return <code>true</code> if the requests matched the saved one */ protected boolean matchRequest(Request request) { // Has a session been created? @@ -503,6 +504,8 @@ public class FormAuthenticator * * @param request The request to be restored * @param session The session containing the saved information + * @return <code>true</code> if the request was successfully restored + * @throws IOException if an IO error occurred during the process */ protected boolean restoreRequest(Request request, Session session) throws IOException { @@ -593,7 +596,7 @@ public class FormAuthenticator * * @param request The request to be saved * @param session The session to contain the saved information - * @throws IOException + * @throws IOException if an IO error occurred during the process */ protected void saveRequest(Request request, Session session) throws IOException { @@ -656,6 +659,7 @@ public class FormAuthenticator * from the saved request so that we can redirect to it. * * @param session Our current session + * @return the original request URL */ protected String savedRequestURL(Session session) { Modified: tomcat/trunk/java/org/apache/catalina/connector/Connector.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Connector.java?rev=1723586&r1=1723585&r2=1723586&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/connector/Connector.java (original) +++ tomcat/trunk/java/org/apache/catalina/connector/Connector.java Thu Jan 7 16:47:50 2016 @@ -254,7 +254,10 @@ public class Connector extends Lifecycle // ------------------------------------------------------------- Properties /** - * Return a configured property. + * Return a property from the protocol handler. + * + * @param name the property name + * @return the property value */ public Object getProperty(String name) { String repl = name; @@ -266,7 +269,11 @@ public class Connector extends Lifecycle /** - * Set a configured property. + * Set a property on the protocol handler. + * + * @param name the property name + * @param value the property value + * @return <code>true</code> if the property was successfully set */ public boolean setProperty(String name, String value) { String repl = name; @@ -277,7 +284,10 @@ public class Connector extends Lifecycle } /** - * Return a configured property. + * Return a property from the protocol handler. + * + * @param name the property name + * @return the property value */ public Object getAttribute(String name) { return getProperty(name); @@ -285,7 +295,10 @@ public class Connector extends Lifecycle /** - * Set a configured property. + * Set a property on the protocol handler. + * + * @param name the property name + * @param value the property value */ public void setAttribute(String name, Object value) { setProperty(name, String.valueOf(value)); @@ -293,7 +306,7 @@ public class Connector extends Lifecycle /** - * Return the <code>Service</code> with which we are associated (if any). + * @return the <code>Service</code> with which we are associated (if any). */ public Service getService() { @@ -315,7 +328,7 @@ public class Connector extends Lifecycle /** - * True if the TRACE method is allowed. Default value is "false". + * @return <code>true</code> if the TRACE method is allowed. Default value is <code>false</code>. */ public boolean getAllowTrace() { @@ -338,7 +351,7 @@ public class Connector extends Lifecycle /** - * Return the default timeout for async requests in ms. + * @return the default timeout for async requests in ms. */ public long getAsyncTimeout() { @@ -361,7 +374,7 @@ public class Connector extends Lifecycle /** - * Return the "enable DNS lookups" flag. + * @return the "enable DNS lookups" flag. */ public boolean getEnableLookups() { @@ -384,7 +397,7 @@ public class Connector extends Lifecycle /** - * Return the maximum number of headers that are allowed by the container. A + * @return the maximum number of headers that are allowed by the container. A * value of less than 0 means no limit. */ public int getMaxHeaderCount() { @@ -402,7 +415,7 @@ public class Connector extends Lifecycle } /** - * Return the maximum number of parameters (GET plus POST) that will be + * @return the maximum number of parameters (GET plus POST) that will be * automatically parsed by the container. A value of less than 0 means no * limit. */ @@ -424,7 +437,7 @@ public class Connector extends Lifecycle /** - * Return the maximum size of a POST which will be automatically + * @return the maximum size of a POST which will be automatically * parsed by the container. */ public int getMaxPostSize() { @@ -448,7 +461,7 @@ public class Connector extends Lifecycle /** - * Return the maximum size of a POST which will be saved by the container + * @return the maximum size of a POST which will be saved by the container * during authentication. */ public int getMaxSavePostSize() { @@ -472,12 +485,21 @@ public class Connector extends Lifecycle } + /** + * @return the HTTP methods which will support body parameters parsing + */ public String getParseBodyMethods() { return this.parseBodyMethods; } + /** + * Set list of HTTP methods which should allow body parameter + * parsing. This defaults to <code>POST</code>. + * + * @param methods Comma separated list of HTTP method names + */ public void setParseBodyMethods(String methods) { HashSet<String> methodSet = new HashSet<>(); @@ -502,7 +524,7 @@ public class Connector extends Lifecycle } /** - * Return the port number on which this connector is configured to listen + * @return the port number on which this connector is configured to listen * for requests. The special value of 0 means select a random free port * when the socket is bound. */ @@ -527,7 +549,7 @@ public class Connector extends Lifecycle /** - * Return the port number on which this connector is listening to requests. + * @return the port number on which this connector is listening to requests. * If the special value for {@link #getPort} of zero is used then this method * will report the actual port bound. */ @@ -537,7 +559,7 @@ public class Connector extends Lifecycle /** - * Return the Coyote protocol handler in use. + * @return the Coyote protocol handler in use. */ public String getProtocol() { @@ -593,7 +615,7 @@ public class Connector extends Lifecycle /** - * Return the class name of the Coyote protocol handler in use. + * @return the class name of the Coyote protocol handler in use. */ public String getProtocolHandlerClassName() { @@ -616,7 +638,7 @@ public class Connector extends Lifecycle /** - * Return the protocol handler associated with the connector. + * @return the protocol handler associated with the connector. */ public ProtocolHandler getProtocolHandler() { @@ -626,7 +648,7 @@ public class Connector extends Lifecycle /** - * Return the proxy server name for this Connector. + * @return the proxy server name for this Connector. */ public String getProxyName() { @@ -653,7 +675,7 @@ public class Connector extends Lifecycle /** - * Return the proxy server port for this Connector. + * @return the proxy server port for this Connector. */ public int getProxyPort() { @@ -676,7 +698,7 @@ public class Connector extends Lifecycle /** - * Return the port number to which a request should be redirected if + * @return the port number to which a request should be redirected if * it comes in on a non-SSL port and is subject to a security constraint * with a transport guarantee that requires SSL. */ @@ -701,7 +723,7 @@ public class Connector extends Lifecycle /** - * Return the scheme that will be assigned to requests received + * @return the scheme that will be assigned to requests received * through this connector. Default value is "http". */ public String getScheme() { @@ -725,7 +747,7 @@ public class Connector extends Lifecycle /** - * Return the secure connection flag that will be assigned to requests + * @return the secure connection flag that will be assigned to requests * received through this connector. Default value is "false". */ public boolean getSecure() { @@ -748,7 +770,7 @@ public class Connector extends Lifecycle } /** - * Return the character encoding to be used for the URI using the original + * @return the character encoding to be used for the URI using the original * case. */ public String getURIEncoding() { @@ -757,7 +779,7 @@ public class Connector extends Lifecycle /** - * Return the character encoding to be used for the URI using lower case. + * @return the character encoding to be used for the URI using lower case. */ public String getURIEncodingLower() { return this.URIEncodingLower; @@ -781,7 +803,7 @@ public class Connector extends Lifecycle /** - * Return the true if the entity body encoding should be used for the URI. + * @return the true if the entity body encoding should be used for the URI. */ public boolean getUseBodyEncodingForURI() { @@ -805,9 +827,9 @@ public class Connector extends Lifecycle /** * Indicates whether the generation of an X-Powered-By response header for - * servlet-generated responses is enabled or disabled for this Connector. + * Servlet-generated responses is enabled or disabled for this Connector. * - * @return true if generation of X-Powered-By response header is enabled, + * @return <code>true</code> if generation of X-Powered-By response header is enabled, * false otherwise */ public boolean getXpoweredBy() { @@ -841,6 +863,8 @@ public class Connector extends Lifecycle /** * Test if IP-based virtual hosting is enabled. + * + * @return <code>true</code> if IP vhosts are enabled */ public boolean getUseIPVHosts() { return useIPVHosts; @@ -878,6 +902,8 @@ public class Connector extends Lifecycle /** * Create (or allocate) and return a Request object suitable for * specifying the contents of a Request to the responsible Container. + * + * @return a new Servlet request object */ public Request createRequest() { @@ -891,6 +917,8 @@ public class Connector extends Lifecycle /** * Create (or allocate) and return a Response object suitable for * receiving the contents of a Response from the responsible Container. + * + * @return a new Servlet response object */ public Response createResponse() { Modified: tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java?rev=1723586&r1=1723585&r2=1723586&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java (original) +++ tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java Thu Jan 7 16:47:50 2016 @@ -847,8 +847,8 @@ public class CoyoteAdapter implements Ad * interested in the session ID that will be in this form. Other parameters * can safely be ignored. * - * @param req - * @param request + * @param req The Coyote request object + * @param request The Servlet request object */ protected void parsePathParameters(org.apache.coyote.Request req, Request request) { @@ -947,6 +947,8 @@ public class CoyoteAdapter implements Ad /** * Look for SSL session ID if required. Only look for SSL Session ID if it * is the only tracking method enabled. + * + * @param request The Servlet request obejct */ protected void parseSessionSslId(Request request) { if (request.getRequestedSessionId() == null && @@ -962,6 +964,8 @@ public class CoyoteAdapter implements Ad /** * Parse session id in URL. + * + * @param request The Servlet request obejct */ protected void parseSessionCookiesId(Request request) { @@ -1016,6 +1020,10 @@ public class CoyoteAdapter implements Ad /** * Character conversion of the URI. + * + * @param uri MessageBytes object containing the URI + * @param request The Servlet request obejct + * @throws IOException if a IO exception occurs sending an error to the client */ protected void convertURI(MessageBytes uri, Request request) throws IOException { @@ -1035,7 +1043,7 @@ public class CoyoteAdapter implements Ad conv.recycle(); } } catch (IOException e) { - log.error("Invalid URI encoding; using HTTP default"); + log.error(sm.getString("coyoteAdapter.invalidEncoding")); connector.setURIEncoding(null); } if (conv != null) { @@ -1065,6 +1073,8 @@ public class CoyoteAdapter implements Ad /** * Character conversion of the a US-ASCII MessageBytes. + * + * @param mb The MessageBytes instance contaning the bytes that should be converted to chars */ protected void convertMB(MessageBytes mb) { @@ -1275,6 +1285,11 @@ public class CoyoteAdapter implements Ad /** * Copy an array of bytes to a different position. Used during * normalization. + * + * @param b The bytes that should be copied + * @param dest Destination offset + * @param src Source offset + * @param len Length */ protected static void copyBytes(byte[] b, int dest, int src, int len) { for (int pos = 0; pos < len; pos++) { Modified: tomcat/trunk/java/org/apache/catalina/connector/LocalStrings.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/LocalStrings.properties?rev=1723586&r1=1723585&r2=1723586&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/connector/LocalStrings.properties (original) +++ tomcat/trunk/java/org/apache/catalina/connector/LocalStrings.properties Thu Jan 7 16:47:50 2016 @@ -19,6 +19,7 @@ coyoteAdapter.authorize=Authorizing user coyoteAdapter.checkRecycled.request=Encountered a non-recycled request and recycled it forcedly. coyoteAdapter.checkRecycled.response=Encountered a non-recycled response and recycled it forcedly. coyoteAdapter.debug=The variable [{0}] has value [{1}] +coyoteAdapter.invalidEncoding=Invalid URI encoding, using HTTP default coyoteAdapter.parsePathParam=Unable to parse the path parameters using encoding [{0}]. The path parameters in the URL will be ignored. coyoteConnector.invalidPort=The connector cannot start since the specified port value of [{0}] is invalid Modified: tomcat/trunk/java/org/apache/catalina/connector/OutputBuffer.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/OutputBuffer.java?rev=1723586&r1=1723585&r2=1723586&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/connector/OutputBuffer.java (original) +++ tomcat/trunk/java/org/apache/catalina/connector/OutputBuffer.java Thu Jan 7 16:47:50 2016 @@ -306,6 +306,7 @@ public class OutputBuffer extends Writer /** * Flush bytes or chars contained in the buffer. * + * @param realFlush <code>true</code> if this should also cause a real network flush * @throws IOException An underlying IOException occurred */ protected void doFlush(boolean realFlush) throws IOException { Modified: tomcat/trunk/java/org/apache/catalina/connector/Request.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Request.java?rev=1723586&r1=1723585&r2=1723586&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/connector/Request.java (original) +++ tomcat/trunk/java/org/apache/catalina/connector/Request.java Thu Jan 7 16:47:50 2016 @@ -152,6 +152,8 @@ public class Request implements HttpServ /** * Get the Coyote request. + * + * @return the Coyote request object */ public org.apache.coyote.Request getCoyoteRequest() { return (this.coyoteRequest); @@ -536,7 +538,7 @@ public class Request implements HttpServ protected Connector connector; /** - * Return the Connector through which this Request was received. + * @return the Connector through which this Request was received. */ public Connector getConnector() { return this.connector; @@ -558,6 +560,8 @@ public class Request implements HttpServ * This is available as soon as the appropriate Context is identified. * Note that availability of a Context allows <code>getContextPath()</code> * to return a value, and thus enables parsing of the request URI. + * + * @return the Context mapped with the request */ public Context getContext() { return mappingData.context; @@ -583,6 +587,8 @@ public class Request implements HttpServ /** * Get filter chain associated with the request. + * + * @return the associated filter chain */ public FilterChain getFilterChain() { return this.filterChain; @@ -599,7 +605,7 @@ public class Request implements HttpServ /** - * Return the Host within which this Request is being processed. + * @return the Host within which this Request is being processed. */ public Host getHost() { return mappingData.host; @@ -612,7 +618,7 @@ public class Request implements HttpServ protected final MappingData mappingData = new MappingData(); /** - * Return mapping data. + * @return mapping data. */ public MappingData getMappingData() { return mappingData; @@ -625,7 +631,7 @@ public class Request implements HttpServ protected RequestFacade facade = null; /** - * Return the <code>ServletRequest</code> for which this object + * @return the <code>ServletRequest</code> for which this object * is the facade. This method must be implemented by a subclass. */ public HttpServletRequest getRequest() { @@ -642,7 +648,7 @@ public class Request implements HttpServ protected org.apache.catalina.connector.Response response = null; /** - * Return the Response with which this Request is associated. + * @return the Response with which this Request is associated. */ public org.apache.catalina.connector.Response getResponse() { return this.response; @@ -658,7 +664,7 @@ public class Request implements HttpServ } /** - * Return the input stream associated with this Request. + * @return the input stream associated with this Request. */ public InputStream getStream() { if (inputStream == null) { @@ -673,7 +679,7 @@ public class Request implements HttpServ protected B2CConverter URIConverter = null; /** - * Return the URI converter. + * @return the URI converter. */ protected B2CConverter getURIConverter() { return URIConverter; @@ -690,7 +696,7 @@ public class Request implements HttpServ /** - * Return the Wrapper within which this Request is being processed. + * @return the Wrapper within which this Request is being processed. */ public Wrapper getWrapper() { return mappingData.wrapper; @@ -716,6 +722,7 @@ public class Request implements HttpServ * Create and return a ServletInputStream to read the content * associated with this Request. * + * @return the created input stream * @exception IOException if an input/output error occurs */ public ServletInputStream createInputStream() @@ -745,7 +752,7 @@ public class Request implements HttpServ /** - * Return the object bound with the specified name to the internal notes + * @return the object bound with the specified name to the internal notes * for this request, or <code>null</code> if no such binding exists. * * @param name Name of the note to be returned @@ -834,7 +841,7 @@ public class Request implements HttpServ /** - * Return the specified request attribute if it exists; otherwise, return + * @return the specified request attribute if it exists; otherwise, return * <code>null</code>. * * @param name Name of the request attribute to return @@ -899,6 +906,8 @@ public class Request implements HttpServ /** * Test if a given name is one of the special Servlet-spec SSL attributes. + * + * @return <code>true</code> if this is a special SSL attribute */ static boolean isSSLAttribute(String name) { return Globals.CERTIFICATES_ATTR.equals(name) || @@ -933,6 +942,8 @@ public class Request implements HttpServ * </ul> * Connector implementations may return some, all or none of these * attributes and may also support additional attributes. + * + * @return the attribute names enumeration */ @Override public Enumeration<String> getAttributeNames() { @@ -948,7 +959,7 @@ public class Request implements HttpServ /** - * Return the character encoding for this Request. + * @return the character encoding for this Request. */ @Override public String getCharacterEncoding() { @@ -957,7 +968,7 @@ public class Request implements HttpServ /** - * Return the content length for this Request. + * @return the content length for this Request. */ @Override public int getContentLength() { @@ -966,7 +977,7 @@ public class Request implements HttpServ /** - * Return the content type for this Request. + * @return the content type for this Request. */ @Override public String getContentType() { @@ -976,6 +987,8 @@ public class Request implements HttpServ /** * Set the content type for this Request. + * + * @param contentType The content type */ public void setContentType(String contentType) { coyoteRequest.setContentType(contentType); @@ -983,7 +996,7 @@ public class Request implements HttpServ /** - * Return the servlet input stream for this Request. The default + * @return the servlet input stream for this Request. The default * implementation returns a servlet input stream created by * <code>createInputStream()</code>. * @@ -1009,7 +1022,7 @@ public class Request implements HttpServ /** - * Return the preferred Locale that the client will accept content in, + * @return the preferred Locale that the client will accept content in, * based on the value for the first <code>Accept-Language</code> header * that was encountered. If the request did not specify a preferred * language, the server's default Locale is returned. @@ -1030,7 +1043,7 @@ public class Request implements HttpServ /** - * Return the set of preferred Locales that the client will accept + * @return the set of preferred Locales that the client will accept * content in, based on the values for any <code>Accept-Language</code> * headers that were encountered. If the request did not specify a * preferred language, the server's default Locale is returned. @@ -1053,7 +1066,7 @@ public class Request implements HttpServ /** - * Return the value of the specified request parameter, if any; otherwise, + * @return the value of the specified request parameter, if any; otherwise, * return <code>null</code>. If there is more than one value defined, * return only the first one. * @@ -1073,7 +1086,7 @@ public class Request implements HttpServ /** - * Returns a <code>Map</code> of the parameters of this request. + * @return a <code>Map</code> of the parameters of this request. * Request parameters are extra information sent with the request. * For HTTP servlets, parameters are contained in the query string * or posted form data. @@ -1103,7 +1116,7 @@ public class Request implements HttpServ /** - * Return the names of all defined request parameters for this request. + * @return the names of all defined request parameters for this request. */ @Override public Enumeration<String> getParameterNames() { @@ -1118,7 +1131,7 @@ public class Request implements HttpServ /** - * Return the defined values for the specified request parameter, if any; + * @return the defined values for the specified request parameter, if any; * otherwise, return <code>null</code>. * * @param name Name of the desired request parameter @@ -1136,7 +1149,7 @@ public class Request implements HttpServ /** - * Return the protocol and version used to make this Request. + * @return the protocol and version used to make this Request. */ @Override public String getProtocol() { @@ -1149,6 +1162,7 @@ public class Request implements HttpServ * default implementation wraps a <code>BufferedReader</code> around the * servlet input stream returned by <code>createInputStream()</code>. * + * @return a buffered reader for the request * @exception IllegalStateException if <code>getInputStream()</code> * has already been called for this request * @exception IOException if an input/output error occurs @@ -1172,7 +1186,7 @@ public class Request implements HttpServ /** - * Return the real path of the specified virtual path. + * @return the real path of the specified virtual path. * * @param path Path to be translated * @@ -1201,7 +1215,7 @@ public class Request implements HttpServ /** - * Return the remote IP address making this Request. + * @return the remote IP address making this Request. */ @Override public String getRemoteAddr() { @@ -1215,7 +1229,7 @@ public class Request implements HttpServ /** - * Return the remote host name making this Request. + * @return the remote host name making this Request. */ @Override public String getRemoteHost() { @@ -1232,7 +1246,7 @@ public class Request implements HttpServ } /** - * Returns the Internet Protocol (IP) source port of the client + * @return the Internet Protocol (IP) source port of the client * or last proxy that sent the request. */ @Override @@ -1246,7 +1260,7 @@ public class Request implements HttpServ } /** - * Returns the host name of the Internet Protocol (IP) interface on + * @return the host name of the Internet Protocol (IP) interface on * which the request was received. */ @Override @@ -1260,7 +1274,7 @@ public class Request implements HttpServ } /** - * Returns the Internet Protocol (IP) address of the interface on + * @return the Internet Protocol (IP) address of the interface on * which the request was received. */ @Override @@ -1275,7 +1289,7 @@ public class Request implements HttpServ /** - * Returns the Internet Protocol (IP) port number of the interface + * @return the Internet Protocol (IP) port number of the interface * on which the request was received. */ @Override @@ -1289,7 +1303,7 @@ public class Request implements HttpServ } /** - * Return a RequestDispatcher that wraps the resource at the specified + * @return a RequestDispatcher that wraps the resource at the specified * path, which may be interpreted as relative to the current request path. * * @param path Path of the resource to be wrapped @@ -1340,7 +1354,7 @@ public class Request implements HttpServ /** - * Return the scheme used to make this Request. + * @return the scheme used to make this Request. */ @Override public String getScheme() { @@ -1349,7 +1363,7 @@ public class Request implements HttpServ /** - * Return the server name responding to this Request. + * @return the server name responding to this Request. */ @Override public String getServerName() { @@ -1358,7 +1372,7 @@ public class Request implements HttpServ /** - * Return the server port responding to this Request. + * @return the server port responding to this Request. */ @Override public int getServerPort() { @@ -1367,7 +1381,7 @@ public class Request implements HttpServ /** - * Was this request received on a secure connection? + * @return <code>true</code> if this request was received on a secure connection. */ @Override public boolean isSecure() { @@ -1464,6 +1478,10 @@ public class Request implements HttpServ /** * Notify interested listeners that attribute has been assigned a value. + * + * @param name Attribute name + * @param value New attribute value + * @param oldValue Old attribute value */ private void notifyAttributeAssigned(String name, Object value, Object oldValue) { @@ -1506,6 +1524,9 @@ public class Request implements HttpServ /** * Notify interested listeners that attribute has been removed. + * + * @param name Attribute name + * @param value Attribute value */ private void notifyAttributeRemoved(String name, Object value) { Context context = getContext(); @@ -2002,6 +2023,8 @@ public class Request implements HttpServ * Return the set of Cookies received with this Request. Triggers parsing of * the Cookie HTTP headers followed by conversion to Cookie objects if this * has not already been performed. + * + * @return the array of cookies */ @Override public Cookie[] getCookies() { @@ -2016,6 +2039,8 @@ public class Request implements HttpServ * Return the server representation of the cookies associated with this * request. Triggers parsing of the Cookie HTTP headers (but not conversion * to Cookie objects) if the headers have not yet been parsed. + * + * @return the server cookies */ public ServerCookies getServerCookies() { parseCookies(); @@ -2028,6 +2053,7 @@ public class Request implements HttpServ * return -1. * * @param name Name of the requested date header + * @return the date as a long * * @exception IllegalArgumentException if the specified header value * cannot be converted to a date @@ -2055,6 +2081,7 @@ public class Request implements HttpServ * return <code>null</code> * * @param name Name of the requested header + * @return the header value */ @Override public String getHeader(String name) { @@ -2067,6 +2094,7 @@ public class Request implements HttpServ * return an empty enumeration. * * @param name Name of the requested header + * @return the enumeration with the header values */ @Override public Enumeration<String> getHeaders(String name) { @@ -2075,7 +2103,7 @@ public class Request implements HttpServ /** - * Return the names of all headers received with this request. + * @return the names of all headers received with this request. */ @Override public Enumeration<String> getHeaderNames() { @@ -2088,6 +2116,7 @@ public class Request implements HttpServ * is no such header for this request. * * @param name Name of the requested header + * @return the header value as an int * * @exception IllegalArgumentException if the specified header value * cannot be converted to an integer @@ -2105,7 +2134,7 @@ public class Request implements HttpServ /** - * Return the HTTP request method used in this Request. + * @return the HTTP request method used in this Request. */ @Override public String getMethod() { @@ -2114,7 +2143,7 @@ public class Request implements HttpServ /** - * Return the path information associated with this Request. + * @return the path information associated with this Request. */ @Override public String getPathInfo() { @@ -2123,7 +2152,7 @@ public class Request implements HttpServ /** - * Return the extra path information for this request, translated + * @return the extra path information for this request, translated * to a real path. */ @Override @@ -2143,7 +2172,7 @@ public class Request implements HttpServ /** - * Return the query string associated with this request. + * @return the query string associated with this request. */ @Override public String getQueryString() { @@ -2152,7 +2181,7 @@ public class Request implements HttpServ /** - * Return the name of the remote user that has been authenticated + * @return the name of the remote user that has been authenticated * for this Request. */ @Override @@ -2177,7 +2206,7 @@ public class Request implements HttpServ /** - * Return the session identifier included in this request, if any. + * @return the session identifier included in this request, if any. */ @Override public String getRequestedSessionId() { @@ -2186,7 +2215,7 @@ public class Request implements HttpServ /** - * Return the request URI for this request. + * @return the request URI for this request. */ @Override public String getRequestURI() { @@ -2236,7 +2265,7 @@ public class Request implements HttpServ /** - * Return the portion of the request URI used to select the servlet + * @return the portion of the request URI used to select the servlet * that will process this request. */ @Override @@ -2246,7 +2275,7 @@ public class Request implements HttpServ /** - * Return the session associated with this Request, creating one + * @return the session associated with this Request, creating one * if necessary. */ @Override @@ -2261,7 +2290,7 @@ public class Request implements HttpServ /** - * Return the session associated with this Request, creating one + * @return the session associated with this Request, creating one * if necessary and requested. * * @param create Create a new session if one does not exist @@ -2278,7 +2307,7 @@ public class Request implements HttpServ /** - * Return <code>true</code> if the session identifier included in this + * @return <code>true</code> if the session identifier included in this * request came from a cookie. */ @Override @@ -2293,7 +2322,7 @@ public class Request implements HttpServ /** - * Return <code>true</code> if the session identifier included in this + * @return <code>true</code> if the session identifier included in this * request came from the request URI. */ @Override @@ -2308,7 +2337,7 @@ public class Request implements HttpServ /** - * Return <code>true</code> if the session identifier included in this + * @return <code>true</code> if the session identifier included in this * request came from the request URI. * * @deprecated As of Version 2.1 of the Java Servlet API, use @@ -2322,7 +2351,7 @@ public class Request implements HttpServ /** - * Return <code>true</code> if the session identifier included in this + * @return <code>true</code> if the session identifier included in this * request identifies a valid session. */ @Override @@ -2374,7 +2403,7 @@ public class Request implements HttpServ /** - * Return <code>true</code> if the authenticated user principal + * @return <code>true</code> if the authenticated user principal * possesses the specified role name. * * @param role Role name to be validated @@ -2416,7 +2445,7 @@ public class Request implements HttpServ /** - * Return the principal that has been authenticated for this Request. + * @return the principal that has been authenticated for this Request. */ public Principal getPrincipal() { return userPrincipal; @@ -2424,7 +2453,7 @@ public class Request implements HttpServ /** - * Return the principal that has been authenticated for this Request. + * @return the principal that has been authenticated for this Request. */ @Override public Principal getUserPrincipal() { @@ -2458,7 +2487,7 @@ public class Request implements HttpServ /** - * Return the session associated with this Request, creating one + * @return the session associated with this Request, creating one * if necessary. */ public Session getSessionInternal() { @@ -2523,7 +2552,7 @@ public class Request implements HttpServ } /** - * Return the session associated with this Request, creating one + * @return the session associated with this Request, creating one * if necessary and requested. * * @param create Create a new session if one does not exist @@ -2534,14 +2563,14 @@ public class Request implements HttpServ /** - * return true if we have parsed parameters + * @return <code>true</code> if we have parsed parameters */ public boolean isParametersParsed() { return parametersParsed; } /** - * Return true if bytes are available. + * @return <code>true</code> if bytes are available. */ public boolean getAvailable() { return (inputBuffer.available() > 0); @@ -2549,7 +2578,7 @@ public class Request implements HttpServ /** - * Return true if an attempt has been made to read the request body and all + * @return <code>true</code> if an attempt has been made to read the request body and all * of the request body has been read */ public boolean isFinished() { @@ -2568,10 +2597,7 @@ public class Request implements HttpServ } /** - * @throws IOException If an I/O error occurs - * @throws IllegalStateException If the response has been committed - * @throws ServletException If the caller is responsible for handling the - * error and the container has NOT set the HTTP response code etc. + * {@inheritDoc} */ @Override public boolean authenticate(HttpServletResponse response) @@ -3177,8 +3203,13 @@ public class Request implements HttpServ /** * Read post body in an array. + * + * @param body The bytes array in which the body will be read + * @param len The body length + * @return the bytes count that has been read + * @throws IOException if an IO exception occurred */ - protected int readPostBody(byte body[], int len) + protected int readPostBody(byte[] body, int len) throws IOException { int offset = 0; @@ -3196,6 +3227,9 @@ public class Request implements HttpServ /** * Read chunked post body. + * + * @return the post body as a bytes array + * @throws IOException if an IO exception occurred */ protected byte[] readChunkedPostBody() throws IOException { ByteChunk body = new ByteChunk(); @@ -3262,6 +3296,9 @@ public class Request implements HttpServ /** * Parse accept-language header value. + * + * @param value the header value + * @param locales the map that will hold the result */ protected void parseLocalesHeader(String value, TreeMap<Double, ArrayList<Locale>> locales) { Modified: tomcat/trunk/java/org/apache/catalina/connector/Response.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Response.java?rev=1723586&r1=1723585&r2=1723586&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/connector/Response.java (original) +++ tomcat/trunk/java/org/apache/catalina/connector/Response.java Thu Jan 7 16:47:50 2016 @@ -143,7 +143,7 @@ public class Response } /** - * Get the Coyote response. + * @return the Coyote response. */ public org.apache.coyote.Response getCoyoteResponse() { return this.coyoteResponse; @@ -151,7 +151,7 @@ public class Response /** - * Return the Context within which this Request is being processed. + * @return the Context within which this Request is being processed. */ public Context getContext() { return (request.getContext()); @@ -301,7 +301,7 @@ public class Response // ------------------------------------------------------- Response Methods /** - * Return the number of bytes the application has actually written to the + * @return the number of bytes the application has actually written to the * output stream. This excludes chunking, compression, etc. as well as * headers. */ @@ -311,8 +311,9 @@ public class Response /** - * Return the number of bytes the actually written to the socket. This + * @return the number of bytes the actually written to the socket. This * includes chunking, compression, etc. but excludes headers. + * @param flush if <code>true</code> will perform a buffer flush first */ public long getBytesWritten(boolean flush) { if (flush) { @@ -337,6 +338,8 @@ public class Response /** * Application commit flag accessor. + * + * @return <code>true</code> if the application has committed the response */ public boolean isAppCommitted() { return (this.appCommitted || isCommitted() || isSuspended() @@ -351,7 +354,7 @@ public class Response protected Request request = null; /** - * Return the Request with which this Response is associated. + * @return the Request with which this Response is associated. */ public org.apache.catalina.connector.Request getRequest() { return (this.request); @@ -373,7 +376,7 @@ public class Response protected ResponseFacade facade = null; /** - * Return the <code>ServletResponse</code> for which this object + * @return the <code>ServletResponse</code> for which this object * is the facade. */ public HttpServletResponse getResponse() { @@ -396,6 +399,8 @@ public class Response /** * Suspended flag accessor. + * + * @return <code>true</code> if the response is suspended */ public boolean isSuspended() { return outputBuffer.isSuspended(); @@ -404,6 +409,8 @@ public class Response /** * Closed flag accessor. + * + * @return <code>true</code> if the response has been closed */ public boolean isClosed() { return outputBuffer.isClosed(); @@ -412,6 +419,8 @@ public class Response /** * Set the error flag. + * + * @return <code>false</code> if the error flag was already set */ public boolean setError() { boolean result = errorState.compareAndSet(0, 1); @@ -427,6 +436,8 @@ public class Response /** * Error flag accessor. + * + * @return <code>true</code> if the response has encountered an error */ public boolean isError() { return errorState.get() > 0; @@ -456,7 +467,7 @@ public class Response /** - * Return the content length that was set or calculated for this Response. + * @return the content length that was set or calculated for this Response. */ public int getContentLength() { return getCoyoteResponse().getContentLength(); @@ -464,7 +475,7 @@ public class Response /** - * Return the content type that was set or calculated for this response, + * @return the content type that was set or calculated for this response, * or <code>null</code> if no content type was set. */ @Override @@ -513,7 +524,7 @@ public class Response /** - * Return the actual buffer size used for this Response. + * @return the actual buffer size used for this Response. */ @Override public int getBufferSize() { @@ -522,7 +533,7 @@ public class Response /** - * Return the character encoding used for this Response. + * @return the character encoding used for this Response. */ @Override public String getCharacterEncoding() { @@ -531,7 +542,7 @@ public class Response /** - * Return the servlet output stream associated with this Response. + * @return the servlet output stream associated with this Response. * * @exception IllegalStateException if <code>getWriter</code> has * already been called for this response @@ -556,7 +567,7 @@ public class Response /** - * Return the Locale assigned to this response. + * @return the Locale assigned to this response. */ @Override public Locale getLocale() { @@ -565,7 +576,7 @@ public class Response /** - * Return the writer associated with this Response. + * @return the writer associated with this Response. * * @exception IllegalStateException if <code>getOutputStream</code> has * already been called for this response @@ -607,6 +618,8 @@ public class Response /** * Has the output of this response already been committed? + * + * @return <code>true</code> if the response has been committed */ @Override public boolean isCommitted() { @@ -766,7 +779,7 @@ public class Response } - /* + /** * Overrides the name of the character encoding used in the body * of the request. This method must be called prior to reading * request parameters or reading input using getReader(). @@ -870,7 +883,7 @@ public class Response /** - * Return the error message that was set with <code>sendError()</code> + * @return the error message that was set with <code>sendError()</code> * for this Response. */ public String getMessage() { @@ -1036,7 +1049,7 @@ public class Response * visible to {@link org.apache.coyote.Response} * * Called from set/addHeader. - * Return true if the header is special, no need to set the header. + * @return <code>true</code> if the header is special, no need to set the header. */ private boolean checkSpecialHeader(String name, String value) { if (name.equalsIgnoreCase("Content-Type")) { @@ -1078,6 +1091,7 @@ public class Response * Has the specified header been set already in this response? * * @param name Name of the header to check + * @return <code>true</code> if the header has been set */ @Override public boolean containsHeader(String name) { @@ -1104,6 +1118,7 @@ public class Response * into the specified redirect URL, if necessary. * * @param url URL to be encoded + * @return <code>true</code> if the URL was encoded */ @Override public String encodeRedirectURL(String url) { @@ -1122,6 +1137,7 @@ public class Response * into the specified redirect URL, if necessary. * * @param url URL to be encoded + * @return <code>true</code> if the URL was encoded * * @deprecated As of Version 2.1 of the Java Servlet API, use * <code>encodeRedirectURL()</code> instead. @@ -1138,6 +1154,7 @@ public class Response * into the specified URL, if necessary. * * @param url URL to be encoded + * @return <code>true</code> if the URL was encoded */ @Override public String encodeURL(String url) { @@ -1170,6 +1187,7 @@ public class Response * into the specified URL, if necessary. * * @param url URL to be encoded + * @return <code>true</code> if the URL was encoded * * @deprecated As of Version 2.1 of the Java Servlet API, use * <code>encodeURL()</code> instead. @@ -1273,6 +1291,10 @@ public class Response * Internal method that allows a redirect to be sent with a status other * than {@link HttpServletResponse#SC_FOUND} (302). No attempt is made to * validate the status code. + * + * @param location Location URL to redirect to + * @param status HTTP status code that will be sent + * @throws IOException an IO exception occurred */ public void sendRedirect(String location, int status) throws IOException { if (isCommitted()) { @@ -1460,6 +1482,7 @@ public class Response * </ul> * * @param location Absolute URL to be validated + * @return <code>true</code> if the URL should be encoded */ protected boolean isEncodeable(final String location) { @@ -1565,6 +1588,7 @@ public class Response * already absolute, return it unchanged. * * @param location URL to be (possibly) converted and then returned + * @return the encoded URL * * @exception IllegalArgumentException if a MalformedURLException is * thrown when converting the relative URL to an absolute one @@ -1660,9 +1684,11 @@ public class Response } - /* + /** * Removes /./ and /../ sequences from absolute URLs. * Code borrowed heavily from CoyoteAdapter.normalize() + * + * @param cc the char chunk containing the chars to normalize */ private void normalize(CharChunk cc) { // Strip query string and/or fragment first as doing it this way makes @@ -1755,7 +1781,10 @@ public class Response /** - * Determine if an absolute URL has a path component + * Determine if an absolute URL has a path component. + * + * @param uri the URL that will be checked + * @return <code>true</code> if the URL has a path */ private boolean hasPath(String uri) { int pos = uri.indexOf("://"); @@ -1775,6 +1804,7 @@ public class Response * * @param url URL to be encoded with the session id * @param sessionId Session id to be included in the encoded URL + * @return the encoded URL */ protected String toEncoded(String url, String sessionId) { Modified: tomcat/trunk/java/org/apache/catalina/util/LifecycleBase.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/util/LifecycleBase.java?rev=1723586&r1=1723585&r2=1723586&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/util/LifecycleBase.java (original) +++ tomcat/trunk/java/org/apache/catalina/util/LifecycleBase.java Thu Jan 7 16:47:50 2016 @@ -186,7 +186,7 @@ public abstract class LifecycleBase impl * will be called on the failed component but the parent component will * continue to start normally. * - * @throws LifecycleException + * @throws LifecycleException Start error occurred */ protected abstract void startInternal() throws LifecycleException; @@ -264,7 +264,7 @@ public abstract class LifecycleBase impl * {@link LifecycleState#STOPPING} during the execution of this method. * Changing state will trigger the {@link Lifecycle#STOP_EVENT} event. * - * @throws LifecycleException + * @throws LifecycleException Stop error occurred */ protected abstract void stopInternal() throws LifecycleException; @@ -346,6 +346,7 @@ public abstract class LifecycleBase impl * transition is valid for a sub-class. * * @param state The new state for this component + * @throws LifecycleException when attempting to set an invalid state */ protected synchronized void setState(LifecycleState state) throws LifecycleException { @@ -361,6 +362,7 @@ public abstract class LifecycleBase impl * * @param state The new state for this component * @param data The data to pass to the associated {@link Lifecycle} event + * @throws LifecycleException when attempting to set an invalid state */ protected synchronized void setState(LifecycleState state, Object data) throws LifecycleException { --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org