Skip to content

Commit 0673585

Browse files
garydgregoryok2c
authored andcommitted
Javadoc
- Fix Javadoc warnings - Add missing Javadoc tags - Normalize some comments
1 parent 49b82cb commit 0673585

File tree

2 files changed

+46
-7
lines changed

2 files changed

+46
-7
lines changed

httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/AbstractMessageParser.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ private enum State {
6666
private int emptyLineCount;
6767

6868
/**
69+
* Constructs a new instance for a subclass.
70+
*
71+
* @param http1Config HTTP/1.1 protocol parameters.
72+
* @param lineParser How to parse lines in an HTTP message.
6973
* @since 5.3
7074
*/
7175
public AbstractMessageParser(final Http1Config http1Config, final LineParser lineParser) {
@@ -77,6 +81,10 @@ public AbstractMessageParser(final Http1Config http1Config, final LineParser lin
7781
}
7882

7983
/**
84+
* Constructs a new instance for a subclass.
85+
*
86+
* @param lineParser How to parse lines in an HTTP message.
87+
* @param messageConstraints HTTP/1.1 protocol parameters.
8088
* @deprecated Use {@link #AbstractMessageParser(Http1Config, LineParser)}
8189
*/
8290
@Deprecated

httpcore5/src/main/java/org/apache/hc/core5/net/InetAddressUtils.java

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ private InetAddressUtils() {
101101
private static final int MAX_COLON_COUNT = 7;
102102

103103
/**
104+
* Tests whether the parameter is a valid IPv4 address
105+
*
106+
* @param input the address character sequence to check for validity
107+
* @return true if the input parameter is a valid IPv4 address
104108
* @deprecated Use {@link #isIPv4(CharSequence)}
105109
*/
106110
@Deprecated
@@ -109,7 +113,7 @@ public static boolean isIPv4Address(final String input) {
109113
}
110114

111115
/**
112-
* Checks whether the parameter is a valid IPv4 address
116+
* Tests whether the parameter is a valid IPv4 address.
113117
*
114118
* @param input the address character sequence to check for validity
115119
* @return true if the input parameter is a valid IPv4 address
@@ -120,6 +124,10 @@ public static boolean isIPv4(final CharSequence input) {
120124
}
121125

122126
/**
127+
* Tests if an IPv6 address is an IPv4-mapped IPv6 address.
128+
*
129+
* @param input the IPv6 address to be checked
130+
* @return true if the IPv6 address is an IPv4-mapped IPv6 address, false otherwise.
123131
* @deprecated Use {@link #isIPv4MappedIPv6(CharSequence)}
124132
*/
125133
@Deprecated
@@ -128,7 +136,7 @@ public static boolean isIPv4MappedIPv64Address(final String input) {
128136
}
129137

130138
/**
131-
* Check if an IPv6 address is an IPv4-mapped IPv6 address.
139+
* Tests if an IPv6 address is an IPv4-mapped IPv6 address.
132140
*
133141
* @param input the IPv6 address to be checked
134142
* @return true if the IPv6 address is an IPv4-mapped IPv6 address, false otherwise.
@@ -150,6 +158,10 @@ static boolean hasValidIPv6ColonCount(final CharSequence input) {
150158
}
151159

152160
/**
161+
* Tests whether the parameter is a valid standard (non-compressed) IPv6 address
162+
*
163+
* @param input the address character sequence to check for validity
164+
* @return true if the input parameter is a valid standard (non-compressed) IPv6 address
153165
* @deprecated Use {@link #isIPv6Std(CharSequence)}
154166
*/
155167
@Deprecated
@@ -158,7 +170,7 @@ public static boolean isIPv6StdAddress(final String input) {
158170
}
159171

160172
/**
161-
* Checks whether the parameter is a valid standard (non-compressed) IPv6 address
173+
* Tests whether the parameter is a valid standard (non-compressed) IPv6 address
162174
*
163175
* @param input the address character sequence to check for validity
164176
* @return true if the input parameter is a valid standard (non-compressed) IPv6 address
@@ -169,6 +181,10 @@ public static boolean isIPv6Std(final CharSequence input) {
169181
}
170182

171183
/**
184+
* Tests whether the parameter is a valid compressed IPv6 address
185+
*
186+
* @param input the address character sequence to check for validity
187+
* @return true if the input parameter is a valid compressed IPv6 address
172188
* @deprecated Use {@link #isIPv6HexCompressed(CharSequence)}
173189
*/
174190
@Deprecated
@@ -177,7 +193,7 @@ public static boolean isIPv6HexCompressedAddress(final String input) {
177193
}
178194

179195
/**
180-
* Checks whether the parameter is a valid compressed IPv6 address
196+
* Tests whether the parameter is a valid compressed IPv6 address
181197
*
182198
* @param input the address character sequence to check for validity
183199
* @return true if the input parameter is a valid compressed IPv6 address
@@ -188,6 +204,10 @@ public static boolean isIPv6HexCompressed(final CharSequence input) {
188204
}
189205

190206
/**
207+
* Tests whether the parameter is a valid IPv6 address (including compressed).
208+
*
209+
* @param input the address character sequence to check for validity
210+
* @return true if the input parameter is a valid standard or compressed IPv6 address
191211
* @deprecated Use {@link #isIPv6(CharSequence)}
192212
*/
193213
@Deprecated
@@ -196,7 +216,7 @@ public static boolean isIPv6Address(final String input) {
196216
}
197217

198218
/**
199-
* Checks whether the parameter is a valid IPv6 address (including compressed).
219+
* Tests whether the parameter is a valid IPv6 address (including compressed).
200220
*
201221
* @param input the address character sequence to check for validity
202222
* @return true if the input parameter is a valid standard or compressed IPv6 address
@@ -224,6 +244,11 @@ public static boolean isIPv6(final CharSequence input) {
224244
}
225245

226246
/**
247+
* Tests whether the parameter is a valid URL formatted bracketed IPv6 address (including compressed).
248+
* This matches only bracketed values e.g. {@code [::1]}.
249+
*
250+
* @param input the address character sequence to check for validity
251+
* @return true if the input parameter is a valid URL-formatted bracketed IPv6 address
227252
* @deprecated Use {@link #isIPv6URLBracketed(CharSequence)}
228253
*/
229254
@Deprecated
@@ -232,7 +257,7 @@ public static boolean isIPv6URLBracketedAddress(final String input) {
232257
}
233258

234259
/**
235-
* Checks whether the parameter is a valid URL formatted bracketed IPv6 address (including compressed).
260+
* Tests whether the parameter is a valid URL formatted bracketed IPv6 address (including compressed).
236261
* This matches only bracketed values e.g. {@code [::1]}.
237262
*
238263
* @param input the address character sequence to check for validity
@@ -251,6 +276,8 @@ public static boolean isIPv6URLBracketed(final CharSequence input) {
251276
/**
252277
* Formats {@link SocketAddress} as text.
253278
*
279+
* @param buffer The target buffer to append.
280+
* @param socketAddress The SocketAddress to append to {@code buffer}.
254281
* @since 5.0
255282
*/
256283
public static void formatAddress(
@@ -271,8 +298,12 @@ public static void formatAddress(
271298
}
272299

273300
/**
274-
* Returns canonical name (fully qualified domain name) of the localhost.
301+
* Gets the canonical name of the local host, a fully qualified domain name.
302+
* <p>
303+
* This can be {@code "localhost"} or a fully qualified domain name like {@code "host.docker.internal"}.
304+
* </p>
275305
*
306+
* @return the canonical name of the local host.
276307
* @since 5.0
277308
*/
278309
public static String getCanonicalLocalHostName() {

0 commit comments

Comments
 (0)