Skip to content

Commit ae20dd6

Browse files
committed
8251496: Fix doclint warnings in jdk.net.httpserver
Reviewed-by: dfuchs, rriggs, chegar
1 parent b9729cb commit ae20dd6

14 files changed

+312
-37
lines changed

src/jdk.httpserver/share/classes/com/sun/net/httpserver/Authenticator.java

+42-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -24,9 +24,6 @@
2424
*/
2525

2626
package com.sun.net.httpserver;
27-
import java.net.*;
28-
import java.io.*;
29-
import java.util.*;
3027

3128
/**
3229
* Authenticator represents an implementation of an HTTP authentication
@@ -38,10 +35,23 @@
3835
*/
3936
public abstract class Authenticator {
4037

38+
/**
39+
* Constructor for subclasses to call.
40+
*/
41+
protected Authenticator () { }
42+
4143
/**
4244
* Base class for return type from authenticate() method
4345
*/
44-
public abstract static class Result {}
46+
public abstract static class Result {
47+
48+
/**
49+
* Constructor for subclasses to call.
50+
*/
51+
protected Result () {}
52+
}
53+
54+
4555

4656
/**
4757
* Indicates an authentication failure. The authentication
@@ -51,12 +61,20 @@ public static class Failure extends Result {
5161

5262
private int responseCode;
5363

64+
/**
65+
* Creates a {@code Failure} instance with given response code.
66+
*
67+
* @param responseCode The response code to associate with this
68+
* {@code Failure} instance
69+
*/
5470
public Failure (int responseCode) {
5571
this.responseCode = responseCode;
5672
}
5773

5874
/**
5975
* returns the response code to send to the client
76+
*
77+
* @return The response code associated with this {@code Failure} instance
6078
*/
6179
public int getResponseCode() {
6280
return responseCode;
@@ -71,11 +89,19 @@ public int getResponseCode() {
7189
public static class Success extends Result {
7290
private HttpPrincipal principal;
7391

92+
/**
93+
* Creates a {@code Success} instance with given {@code Principal}.
94+
*
95+
* @param p The authenticated user you wish to set as Principal
96+
*/
7497
public Success (HttpPrincipal p) {
7598
principal = p;
7699
}
77100
/**
78101
* returns the authenticated user Principal
102+
*
103+
* @return The {@code Principal} instance associated with the authenticated user
104+
*
79105
*/
80106
public HttpPrincipal getPrincipal() {
81107
return principal;
@@ -93,12 +119,20 @@ public static class Retry extends Result {
93119

94120
private int responseCode;
95121

122+
/**
123+
* Creates a {@code Retry} instance with given response code.
124+
*
125+
* @param responseCode The response code to associate with this
126+
* {@code Retry} instance
127+
*/
96128
public Retry (int responseCode) {
97129
this.responseCode = responseCode;
98130
}
99131

100132
/**
101133
* returns the response code to send to the client
134+
*
135+
* @return The response code associated with this {@code Retry} instance
102136
*/
103137
public int getResponseCode() {
104138
return responseCode;
@@ -120,6 +154,9 @@ public int getResponseCode() {
120154
* headers needing to be sent back to the client are set in the
121155
* given HttpExchange. The response code to be returned must be provided
122156
* in the Retry object. Retry may occur multiple times.
157+
*
158+
* @param exch The HttpExchange upon which authenticate is called
159+
* @return The result
123160
*/
124161
public abstract Result authenticate (HttpExchange exch);
125162
}

src/jdk.httpserver/share/classes/com/sun/net/httpserver/BasicAuthenticator.java

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
*/
4040
public abstract class BasicAuthenticator extends Authenticator {
4141

42+
/** The HTTP Basic authentication realm. */
4243
protected final String realm;
4344
private final Charset charset;
4445
private final boolean isUTF8;

src/jdk.httpserver/share/classes/com/sun/net/httpserver/Filter.java

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -41,6 +41,9 @@
4141
*/
4242
public abstract class Filter {
4343

44+
/**
45+
* Constructor for subclasses to call.
46+
*/
4447
protected Filter () {}
4548

4649
/**
@@ -55,6 +58,13 @@ public static class Chain {
5558
private ListIterator<Filter> iter;
5659
private HttpHandler handler;
5760

61+
/**
62+
* Creates a {@code Chain} instance with given filters and handler.
63+
*
64+
* @param filters The filters that make up the Chain
65+
* @param handler The HttpHandler that will be invoked after the final
66+
* Filter has finished
67+
*/
5868
public Chain (List<Filter> filters, HttpHandler handler) {
5969
iter = filters.listIterator();
6070
this.handler = handler;

src/jdk.httpserver/share/classes/com/sun/net/httpserver/Headers.java

+3
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ public class Headers implements Map<String,List<String>> {
6565

6666
HashMap<String,List<String>> map;
6767

68+
/**
69+
* Creates an empty instance of Headers.
70+
*/
6871
public Headers () {map = new HashMap<String,List<String>>(32);}
6972

7073
/* Normalize the key by converting to following form.

src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpContext.java

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -24,9 +24,8 @@
2424
*/
2525

2626
package com.sun.net.httpserver;
27-
import java.net.*;
28-
import java.io.*;
29-
import java.util.*;
27+
import java.util.List;
28+
import java.util.Map;
3029

3130
/**
3231
* HttpContext represents a mapping between the root URI path of an application
@@ -42,6 +41,9 @@
4241
*/
4342
public abstract class HttpContext {
4443

44+
/**
45+
* Constructor for subclasses to call.
46+
*/
4547
protected HttpContext () {
4648
}
4749

@@ -78,6 +80,8 @@ protected HttpContext () {
7880
* <p>
7981
* Every attribute stored in this Map will be visible to
8082
* every HttpExchange processed by this context
83+
*
84+
* @return a map containing the attributes of this context
8185
*/
8286
public abstract Map<String,Object> getAttributes() ;
8387

src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -25,12 +25,11 @@
2525

2626
package com.sun.net.httpserver;
2727

28-
import java.io.*;
29-
import java.nio.*;
30-
import java.nio.channels.*;
31-
import java.net.*;
32-
import javax.net.ssl.*;
33-
import java.util.*;
28+
import java.io.IOException;
29+
import java.io.InputStream;
30+
import java.io.OutputStream;
31+
import java.net.InetSocketAddress;
32+
import java.net.URI;
3433

3534
/**
3635
* This class encapsulates a HTTP request received and a
@@ -66,6 +65,9 @@
6665

6766
public abstract class HttpExchange implements AutoCloseable {
6867

68+
/**
69+
* Constructor for subclasses to call.
70+
*/
6971
protected HttpExchange () {
7072
}
7173

src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpPrincipal.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -24,9 +24,6 @@
2424
*/
2525

2626
package com.sun.net.httpserver;
27-
import java.net.*;
28-
import java.io.*;
29-
import java.util.*;
3027
import java.security.Principal;
3128

3229
/**
@@ -75,13 +72,17 @@ public String getName() {
7572

7673
/**
7774
* returns the username this object was created with.
75+
*
76+
* @return The name of the user assoicated with this object
7877
*/
7978
public String getUsername() {
8079
return username;
8180
}
8281

8382
/**
8483
* returns the realm this object was created with.
84+
*
85+
* @return The realm associated with this object
8586
*/
8687
public String getRealm() {
8788
return realm;

src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpServer.java

+14-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -25,16 +25,13 @@
2525

2626
package com.sun.net.httpserver;
2727

28-
import java.net.*;
29-
import java.io.*;
30-
import java.nio.*;
31-
import java.security.*;
32-
import java.nio.channels.*;
33-
import java.util.*;
34-
import java.util.concurrent.*;
35-
import javax.net.ssl.*;
3628
import com.sun.net.httpserver.spi.HttpServerProvider;
3729

30+
import java.io.IOException;
31+
import java.net.BindException;
32+
import java.net.InetSocketAddress;
33+
import java.util.concurrent.Executor;
34+
3835
/**
3936
* This class implements a simple HTTP server. A HttpServer is bound to an IP address
4037
* and port number and listens for incoming TCP connections from clients on this address.
@@ -98,6 +95,7 @@
9895
public abstract class HttpServer {
9996

10097
/**
98+
* Constructor for subclasses to call.
10199
*/
102100
protected HttpServer () {
103101
}
@@ -106,7 +104,9 @@ protected HttpServer () {
106104
* creates a HttpServer instance which is initially not bound to any local address/port.
107105
* The HttpServer is acquired from the currently installed {@link HttpServerProvider}
108106
* The server must be bound using {@link #bind(InetSocketAddress,int)} before it can be used.
109-
* @throws IOException
107+
*
108+
* @throws IOException if an I/O error occurs
109+
* @return An instance of HttpServer
110110
*/
111111
public static HttpServer create () throws IOException {
112112
return create (null, 0);
@@ -127,7 +127,8 @@ public static HttpServer create () throws IOException {
127127
* then a system default value is used.
128128
* @throws BindException if the server cannot bind to the requested address,
129129
* or if the server is already bound.
130-
* @throws IOException
130+
* @throws IOException if an I/O error occurs
131+
* @return An instance of HttpServer
131132
*/
132133

133134
public static HttpServer create (
@@ -215,6 +216,7 @@ public static HttpServer create (
215216
* @throws IllegalArgumentException if path is invalid, or if a context
216217
* already exists for this path
217218
* @throws NullPointerException if either path, or handler are <code>null</code>
219+
* @return An instance of HttpContext
218220
*/
219221
public abstract HttpContext createContext (String path, HttpHandler handler) ;
220222

@@ -239,6 +241,7 @@ public static HttpServer create (
239241
* @throws IllegalArgumentException if path is invalid, or if a context
240242
* already exists for this path
241243
* @throws NullPointerException if path is <code>null</code>
244+
* @return An instance of HttpContext
242245
*/
243246
public abstract HttpContext createContext (String path) ;
244247

src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpsParameters.java

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,9 @@
2424
*/
2525

2626
package com.sun.net.httpserver;
27+
2728
import java.net.InetSocketAddress;
29+
2830
//BEGIN_TIGER_EXCLUDE
2931
import javax.net.ssl.SSLParameters;
3032
//END_TIGER_EXCLUDE
@@ -56,16 +58,23 @@ public abstract class HttpsParameters {
5658
private boolean wantClientAuth;
5759
private boolean needClientAuth;
5860

61+
/**
62+
* Constructor for subclasses to call.
63+
*/
5964
protected HttpsParameters() {}
6065

6166
/**
6267
* Returns the HttpsConfigurator for this HttpsParameters.
68+
*
69+
* @return HttpsConfigurator for this instance of HttpsParameters
6370
*/
6471
public abstract HttpsConfigurator getHttpsConfigurator();
6572

6673
/**
6774
* Returns the address of the remote client initiating the
6875
* connection.
76+
*
77+
* @return Address of the remote client initiating the connection
6978
*/
7079
public abstract InetSocketAddress getClientAddress();
7180

0 commit comments

Comments
 (0)