Skip to content

Commit

Permalink
464727 - Update Javadoc for Java 8 DocLint
Browse files Browse the repository at this point in the history
+ Fixing javadoc in jetty-http
  • Loading branch information
joakime committed Apr 15, 2015
1 parent 09b5f68 commit 3dc29f5
Show file tree
Hide file tree
Showing 10 changed files with 106 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

/**
* ThreadLocal Date formatters for HTTP style dates.
*
*/
public class DateGenerator
{
Expand Down Expand Up @@ -56,6 +55,8 @@ protected DateGenerator initialValue()

/**
* Format HTTP date "EEE, dd MMM yyyy HH:mm:ss 'GMT'"
* @param date the date in milliseconds
* @return the formatted date
*/
public static String formatDate(long date)
{
Expand All @@ -64,6 +65,8 @@ public static String formatDate(long date)

/**
* Format "EEE, dd-MMM-yyyy HH:mm:ss 'GMT'" for cookies
* @param buf the buffer to put the formatted date into
* @param date the date in milliseconds
*/
public static void formatCookieDate(StringBuilder buf, long date)
{
Expand All @@ -72,6 +75,8 @@ public static void formatCookieDate(StringBuilder buf, long date)

/**
* Format "EEE, dd-MMM-yyyy HH:mm:ss 'GMT'" for cookies
* @param date the date in milliseconds
* @return the formatted date
*/
public static String formatCookieDate(long date)
{
Expand All @@ -85,6 +90,8 @@ public static String formatCookieDate(long date)

/**
* Format HTTP date "EEE, dd MMM yyyy HH:mm:ss 'GMT'"
* @param date the date in milliseconds
* @return the formatted date
*/
public String doFormatDate(long date)
{
Expand Down Expand Up @@ -125,6 +132,8 @@ public String doFormatDate(long date)

/**
* Format "EEE, dd-MMM-yy HH:mm:ss 'GMT'" for cookies
* @param buf the buffer to format the date into
* @param date the date in milliseconds
*/
public void doFormatCookieDate(StringBuilder buf, long date)
{
Expand Down
27 changes: 20 additions & 7 deletions jetty-http/src/main/java/org/eclipse/jetty/http/HttpFields.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,28 @@ public class HttpFields implements Iterable<HttpField>
private HttpField[] _fields;
private int _size;

/**
* Initialize an empty HttpFields.
*/
public HttpFields()
{
_fields=new HttpField[20];
}

/**
* Constructor.
* Initialize an empty HttpFields.
*
* @param capacity the capacity of the http fields
*/
public HttpFields(int capacity)
{
_fields=new HttpField[capacity];
}

/**
* Constructor.
* Initialize HttpFields from copy.
*
* @param fields the fields to copy data from
*/
public HttpFields(HttpFields fields)
{
Expand All @@ -92,6 +99,7 @@ public Iterator<HttpField> iterator()

/**
* Get Collection of header names.
* @return the unique set of field names.
*/
public Set<String> getFieldNamesCollection()
{
Expand All @@ -107,6 +115,7 @@ public Set<String> getFieldNamesCollection()
/**
* Get enumeration of header _names. Returns an enumeration of strings representing the header
* _names for this request.
* @return an enumeration of field names
*/
public Enumeration<String> getFieldNames()
{
Expand All @@ -115,14 +124,14 @@ public Enumeration<String> getFieldNames()

/**
* Get a Field by index.
* @param index the field index
* @return A Field value or null if the Field value has not been set
*
*/
public HttpField getField(int i)
public HttpField getField(int index)
{
if (i>=_size)
if (index>=_size)
throw new NoSuchElementException();
return _fields[i];
return _fields[index];
}

public HttpField getField(HttpHeader header)
Expand Down Expand Up @@ -452,7 +461,7 @@ public void add(HttpHeader header, HttpHeaderValue value) throws IllegalArgument
*
* @param header the header
* @param value the value of the field.
* @exception IllegalArgumentException
* @exception IllegalArgumentException if value is null
*/
public void add(HttpHeader header, String value) throws IllegalArgumentException
{
Expand All @@ -466,6 +475,7 @@ public void add(HttpHeader header, String value) throws IllegalArgumentException
* Remove a field.
*
* @param name the field to remove
* @return the header that was removed
*/
public HttpField remove(HttpHeader name)
{
Expand All @@ -486,6 +496,7 @@ public HttpField remove(HttpHeader name)
* Remove a field.
*
* @param name the field to remove
* @return the header that was removed
*/
public HttpField remove(String name)
{
Expand All @@ -507,6 +518,7 @@ public HttpField remove(String name)
* case of the field name is ignored.
*
* @param name the case-insensitive field name
* @return the value of the field as a long
* @exception NumberFormatException If bad long found
*/
public long getLongField(String name) throws NumberFormatException
Expand All @@ -520,6 +532,7 @@ public long getLongField(String name) throws NumberFormatException
* of the field name is ignored.
*
* @param name the case-insensitive field name
* @return the value of the field as a number of milliseconds since unix epoch
*/
public long getDateField(String name)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,13 @@
import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;

/* ------------------------------------------------------------ */
/**
* HttpGenerator. Builds HTTP Messages.
*
* <p>
* If the system property "org.eclipse.jetty.http.HttpGenerator.STRICT" is set to true,
* then the generator will strictly pass on the exact strings received from methods and header
* fields. Otherwise a fast case insensitive string lookup is used that may alter the
* case and white space of some methods/headers
* </p>
*/
public class HttpGenerator
{
Expand Down
11 changes: 8 additions & 3 deletions jetty-http/src/main/java/org/eclipse/jetty/http/HttpParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
* case of the method and/or headers
* </p>
* <p>
* @see http://tools.ietf.org/html/rfc7230
* @see <a href="http://tools.ietf.org/html/rfc7230">RFC 7230</a>
*/
public class HttpParser
{
Expand Down Expand Up @@ -275,7 +275,7 @@ public long getContentRead()

/* ------------------------------------------------------------ */
/** Set if a HEAD response is expected
* @param head
* @param head true if head response is expected
*/
public void setHeadResponse(boolean head)
{
Expand Down Expand Up @@ -1153,6 +1153,7 @@ else if (_endOfContent == EndOfContent.UNKNOWN_CONTENT)
/* ------------------------------------------------------------------------------- */
/**
* Parse until next Event.
* @param buffer the buffer to parse
* @return True if an {@link RequestHandler} method was called and it returned true;
*/
public boolean parseNext(ByteBuffer buffer)
Expand Down Expand Up @@ -1619,7 +1620,7 @@ public interface RequestHandler extends HttpHandler
* This is the method called by parser when the HTTP request line is parsed
* @param method The method
* @param uri The raw bytes of the URI. These are copied into a ByteBuffer that will not be changed until this parser is reset and reused.
* @param version
* @param version the http version in use
* @return true if handling parsing should return.
*/
public boolean startRequest(String method, String uri, HttpVersion version);
Expand All @@ -1633,6 +1634,10 @@ public interface ResponseHandler extends HttpHandler
{
/**
* This is the method called by parser when the HTTP request line is parsed
* @param version the http version in use
* @param status the response status
* @param reason the response reason phrase
* @return true if handling parsing should return
*/
public boolean startResponse(HttpVersion version, int status, String reason);
}
Expand Down
25 changes: 13 additions & 12 deletions jetty-http/src/main/java/org/eclipse/jetty/http/HttpStatus.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
* </p>
*
* <table border="1" cellpadding="5">
* <caption>HTTP Status Codes Table</caption>
* <tr>
* <th>Enum</th>
* <th>Code</th>
Expand Down Expand Up @@ -155,8 +156,8 @@
* </tr>
* <tr>
* <td>&nbsp;</td>
* <td><strike>207</strike></td>
* <td><strike>Partial Update OK</strike></td>
* <td style="text-decoration: line-through;">207</td>
* <td style="text-decoration: line-through;">Partial Update OK</td>
* <td>&nbsp;</td>
* <td>
* <a href=
Expand Down Expand Up @@ -448,8 +449,8 @@
* </tr>
* <tr>
* <td>&nbsp;</td>
* <td><strike>418</strike></td>
* <td><strike>Reauthentication Required</strike></td>
* <td style="text-decoration: line-through;">418</td>
* <td style="text-decoration: line-through;">Reauthentication Required</td>
* <td>&nbsp;</td>
* <td>
* <a href=
Expand All @@ -459,8 +460,8 @@
* </tr>
* <tr>
* <td>&nbsp;</td>
* <td><strike>418</strike></td>
* <td><strike>Unprocessable Entity</strike></td>
* <td style="text-decoration: line-through;">418</td>
* <td style="text-decoration: line-through;">Unprocessable Entity</td>
* <td>&nbsp;</td>
* <td>&nbsp;</td>
* <td>
Expand All @@ -470,8 +471,8 @@
* </tr>
* <tr>
* <td>&nbsp;</td>
* <td><strike>419</strike></td>
* <td><strike>Proxy Reauthentication Required</stike></td>
* <td style="text-decoration: line-through;">419</td>
* <td style="text-decoration: line-through;">Proxy Reauthentication Required</td>
* <td>&nbsp;</td>
* <td>
* <a href=
Expand All @@ -481,8 +482,8 @@
* </tr>
* <tr>
* <td>&nbsp;</td>
* <td><strike>419</strike></td>
* <td><strike>Insufficient Space on Resource</stike></td>
* <td style="text-decoration: line-through;">419</td>
* <td style="text-decoration: line-through;">Insufficient Space on Resource</td>
* <td>&nbsp;</td>
* <td>&nbsp;</td>
* <td>
Expand All @@ -492,8 +493,8 @@
* </tr>
* <tr>
* <td>&nbsp;</td>
* <td><strike>420</strike></td>
* <td><strike>Method Failure</strike></td>
* <td style="text-decoration: line-through;">420</td>
* <td style="text-decoration: line-through;">Method Failure</td>
* <td>&nbsp;</td>
* <td>&nbsp;</td>
* <td>
Expand Down
14 changes: 11 additions & 3 deletions jetty-http/src/main/java/org/eclipse/jetty/http/HttpURI.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@ private enum State {
/**
* Construct a normalized URI.
* Port is not set if it is the default port.
* @param scheme the URI scheme
* @param host the URI hose
* @param port the URI port
* @param path the URI path
* @param param the URI param
* @param query the URI query
* @param fragment the URI fragment
* @return the normalized URI
*/
public static HttpURI createHttpURI(String scheme, String host, int port, String path, String param, String query, String fragment)
{
Expand Down Expand Up @@ -671,8 +679,8 @@ public void setScheme(String scheme)

/* ------------------------------------------------------------ */
/**
* @param host
* @param port
* @param host the host
* @param port the port
*/
public void setAuthority(String host, int port)
{
Expand All @@ -683,7 +691,7 @@ public void setAuthority(String host, int port)

/* ------------------------------------------------------------ */
/**
* @param path
* @param path the path
*/
public void setPath(String path)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,8 @@ public String getMimeByExtension(String filename)

/* ------------------------------------------------------------ */
/** Set a mime mapping
* @param extension
* @param type
* @param extension the extension
* @param type the mime type
*/
public void addMimeMapping(String extension,String type)
{
Expand Down
Loading

0 comments on commit 3dc29f5

Please sign in to comment.