Skip to content

Commit bc34756

Browse files
committed
javadoc fixes
1 parent f4027e7 commit bc34756

12 files changed

Lines changed: 27 additions & 99 deletions

File tree

httpclient5-observation/src/main/java/org/apache/hc/client5/http/observation/HttpClientObservationSupport.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
* connection pool gauges.</li>
5858
* </ul>
5959
*
60-
* <h3>Optional dependencies</h3>
60+
* <p><strong>Optional dependencies</strong></p>
6161
* <p>
6262
* Micrometer and OpenTelemetry are <em>optional</em> dependencies. Use the
6363
* overloads that accept explicit registries (recommended) or the convenience
@@ -66,7 +66,7 @@
6666
* will be required.
6767
* </p>
6868
*
69-
* <h3>Typical usage (classic client)</h3>
69+
* <p><strong>Typical usage (classic client)</strong></p>
7070
* <pre>{@code
7171
* ObservationRegistry obs = ObservationRegistry.create();
7272
* MeterRegistry meters = new PrometheusMeterRegistry(PrometheusConfig.DEFAULT);
@@ -80,7 +80,7 @@
8080
* CloseableHttpClient client = b.build();
8181
* }</pre>
8282
*
83-
* <h3>What gets installed</h3>
83+
* <p><strong>What gets installed</strong></p>
8484
* <ul>
8585
* <li>An <em>observation</em> interceptor (if {@code obsReg} is non-null)
8686
* that surrounds each execution with a start/stop span.</li>

httpclient5-observation/src/main/java/org/apache/hc/client5/http/observation/binder/ConnPoolMeters.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
* </ul>
4747
* The {@code prefix} and any common tags come from {@link MetricConfig}.
4848
*
49-
* <h3>Usage</h3>
49+
* <p><strong>Usage</strong></p>
5050
* <pre>{@code
5151
* MeterRegistry meters = new PrometheusMeterRegistry(PrometheusConfig.DEFAULT);
5252
* MetricConfig mc = MetricConfig.builder().prefix("http_client").build();

httpclient5-observation/src/main/java/org/apache/hc/client5/http/observation/binder/ConnPoolMetersAsync.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
* </ul>
4747
* The {@code prefix} and any common tags come from {@link MetricConfig}.
4848
*
49-
* <h3>Usage</h3>
49+
* <p><strong>Usage</strong></p>
5050
* <pre>{@code
5151
* MeterRegistry meters = new PrometheusMeterRegistry(PrometheusConfig.DEFAULT);
5252
* MetricConfig mc = MetricConfig.builder().prefix("http_client").build();

httpclient5/src/main/java/org/apache/hc/client5/http/async/methods/DeflatingBrotliEntityProducer.java

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@
5050
* has been fully drained.
5151
* </p>
5252
*
53-
* <h4>Content metadata</h4>
53+
* <p><strong>Content metadata</strong></p>
5454
* Returns {@code Content-Encoding: br}, {@code Content-Length: -1} and {@code chunked=true}.
5555
* Repeatability matches the upstream producer.
5656
*
57-
* <h4>Implementation notes</h4>
57+
* <p><strong>Implementation notes</strong></p>
5858
* Uses Brotli4j’s {@code EncoderJNI.Wrapper}. JNI-owned output buffers are written directly
5959
* when possible; if the channel applies back-pressure, the unwritten tail is copied into
6060
* small pooled direct {@link java.nio.ByteBuffer}s to reduce allocation churn. Native
@@ -64,15 +64,6 @@
6464
* called once at startup; this class also invokes it in a static initializer as a safeguard.
6565
* </p>
6666
*
67-
* <h4>Usage</h4>
68-
* <pre>{@code
69-
* AsyncEntityProducer plain = new StringAsyncEntityProducer("hello", ContentType.TEXT_PLAIN);
70-
* AsyncEntityProducer br = new DeflatingBrotliEntityProducer(plain); // defaults q=5, lgwin=22
71-
* client.execute(new BasicRequestProducer(post, br),
72-
* new BasicResponseConsumer<>(new StringAsyncEntityConsumer()),
73-
* null);
74-
* }</pre>
75-
*
7667
* @see org.apache.hc.core5.http.nio.AsyncEntityProducer
7768
* @see org.apache.hc.core5.http.nio.DataStreamChannel
7869
* @see com.aayushatharva.brotli4j.encoder.EncoderJNI

httpclient5/src/main/java/org/apache/hc/client5/http/async/methods/DeflatingZstdEntityProducer.java

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -59,24 +59,9 @@
5959
* <li>{@link #isChunked()} returns {@code true} (requests are typically sent chunked).</li>
6060
* </ul>
6161
*
62-
* <h3>Usage</h3>
63-
* <pre>{@code
64-
* AsyncEntityProducer plain = new StringAsyncEntityProducer("payload", ContentType.TEXT_PLAIN);
65-
* AsyncEntityProducer zstd = new DeflatingZstdEntityProducer(plain);
66-
*
67-
* SimpleHttpRequest req = SimpleRequestBuilder.post("http://localhost/echo")
68-
* .setHeader(HttpHeaders.CONTENT_ENCODING, "zstd") // inform the server
69-
* .build();
70-
*
71-
* client.execute(
72-
* new BasicRequestProducer(req, zstd),
73-
* new BasicResponseConsumer<>(new StringAsyncEntityConsumer()),
74-
* null);
75-
* }</pre>
76-
*
77-
* <h3>Behavior</h3>
62+
* <p><strong>Behavior</strong></p>
7863
* <ul>
79-
* <li><b>Streaming & back-pressure:</b> compressed output is staged in direct
64+
* <li><b>Streaming &amp; back-pressure:</b> compressed output is staged in direct
8065
* {@link java.nio.ByteBuffer}s and written only when the channel accepts bytes.
8166
* When {@code DataStreamChannel.write(...)} returns {@code 0}, the producer pauses and
8267
* requests another output turn.</li>
@@ -88,16 +73,16 @@
8873
* <li><b>Resources:</b> invoke {@link #releaseResources()} to free native compressor resources.</li>
8974
* </ul>
9075
*
91-
* <h3>Constructors</h3>
76+
* <p><strong>Constructors</strong></p>
9277
* <ul>
9378
* <li>{@code DeflatingZstdEntityProducer(delegate)} – uses a default compression level.</li>
9479
* <li>{@code DeflatingZstdEntityProducer(delegate, level)} – explicitly sets the zstd level.</li>
9580
* </ul>
9681
*
97-
* <h3>Thread-safety</h3>
82+
* <p><strong>Thread-safety</strong></p>
9883
* <p>Not thread-safe; one instance per message exchange.</p>
9984
*
100-
* <h3>Runtime dependency</h3>
85+
* <p><strong>Runtime dependency</strong></p>
10186
* <p>Requires {@code com.github.luben:zstd-jni} on the classpath.</p>
10287
*
10388
* @see org.apache.hc.client5.http.async.methods.InflatingZstdDataConsumer

httpclient5/src/main/java/org/apache/hc/client5/http/async/methods/InflatingBrotliDataConsumer.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
* downstream consumer (which may retain them).
4949
* </p>
5050
*
51-
* <h4>Implementation notes</h4>
51+
* <p><strong>Implementation notes</strong></p>
5252
* Uses Brotli4j’s {@code DecoderJNI.Wrapper}. Native resources are released in
5353
* {@link #releaseResources()}. Throws an {@link java.io.IOException} if the stream is
5454
* truncated or corrupted.
@@ -57,13 +57,6 @@
5757
* called once at startup; this class also invokes it in a static initializer as a safeguard.
5858
* </p>
5959
*
60-
* <h4>Usage</h4>
61-
* <pre>{@code
62-
* AsyncDataConsumer textConsumer = new StringAsyncEntityConsumer();
63-
* AsyncDataConsumer brInflating = new InflatingBrotliDataConsumer(textConsumer);
64-
* client.execute(producer, new BasicResponseConsumer<>(brInflating), null);
65-
* }</pre>
66-
*
6760
* @see org.apache.hc.core5.http.nio.AsyncDataConsumer
6861
* @see org.apache.hc.core5.http.nio.CapacityChannel
6962
* @see com.aayushatharva.brotli4j.decoder.DecoderJNI

httpclient5/src/main/java/org/apache/hc/client5/http/async/methods/InflatingZstdDataConsumer.java

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
* normally do not instantiate it directly—enable content compression (default) and let
4848
* {@code ContentCompressionAsyncExec} wire it automatically.</p>
4949
*
50-
* <h3>Behavior</h3>
50+
* <p><strong>Behavior</strong></p>
5151
* <ul>
5252
* <li>Streams decompression as data arrives; does not require the full message in memory.</li>
5353
* <li>Updates the downstream with plain bytes; the client removes the original
@@ -56,20 +56,6 @@
5656
* <li>{@link #releaseResources()} must be called to free native resources.</li>
5757
* </ul>
5858
*
59-
* <h3>Typical wiring (automatic)</h3>
60-
* <pre>{@code
61-
* // Enabled by default; when the response has Content-Encoding: zstd
62-
* // the execution chain wraps the application consumer:
63-
* client = HttpAsyncClients.createDefault();
64-
* }</pre>
65-
*
66-
* <h3>Direct use (advanced)</h3>
67-
* <pre>{@code
68-
* AsyncDataConsumer app = ...; // where you want plain bytes
69-
* AsyncDataConsumer zstd = new InflatingZstdDataConsumer(app);
70-
* // feed zstd.consume(ByteBuffer) with compressed bytes
71-
* }</pre>
72-
*
7359
* @since 5.6
7460
*/
7561

httpclient5/src/main/java/org/apache/hc/client5/http/entity/GZIPInputStreamFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
/**
3838
* {@link InputStreamFactory} for handling GZIPContent Coded responses.
3939
* @deprecated – the public extension point has moved to
40-
* {@link org.apache.hc.client5.http.entity.compress.Decoder}.
40+
* {@link org.apache.hc.client5.http.entity.compress.DecompressingEntity}.
4141
* For built-in gzip support use
42-
* {@code ContentCodecRegistry.decoder(ContentCoding.GZIP)} or
42+
* {@link org.apache.hc.client5.http.entity.compress.ContentCodecRegistry} or
4343
* wrap a stream directly with
4444
* @since 5.0
4545
*/

httpclient5/src/main/java/org/apache/hc/client5/http/protocol/RequestValidateTrace.java

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -43,34 +43,7 @@
4343
import org.apache.hc.core5.util.Args;
4444

4545
/**
46-
* <h1>RequestTraceInterceptor</h1>
47-
*
48-
* <p>This class serves as an interceptor for HTTP TRACE requests, ensuring they adhere to specific security and protocol guidelines.</p>
49-
*
50-
* <p><strong>Responsibilities:</strong></p>
51-
* <ul>
52-
* <li>Validates TRACE requests by checking for sensitive headers such as {@code Authorization} and {@code Cookie}.</li>
53-
* <li>Ensures that TRACE requests do not contain a request body, throwing a {@link ProtocolException} if a body is present.</li>
54-
* </ul>
55-
*
56-
* <p><strong>Thread Safety:</strong> This class is stateless and therefore thread-safe, as indicated by its {@code ThreadingBehavior.STATELESS} annotation.</p>
57-
*
58-
* <p><strong>Interceptor Behavior:</strong></p>
59-
* <ul>
60-
* <li>If the HTTP method is TRACE, the interceptor throws a {@link ProtocolException} if any {@code Authorization} or {@code Cookie} headers are present to prevent sensitive data leakage.</li>
61-
* <li>If a TRACE request contains a body, a {@link ProtocolException} is thrown.</li>
62-
* </ul>
63-
*
64-
* @version 5.4
65-
* @see HttpRequestInterceptor
66-
* @see HttpException
67-
* @see IOException
68-
* @see ProtocolException
69-
* @see Method#TRACE
70-
* @see HttpHeaders#AUTHORIZATION
71-
* @see HttpHeaders#COOKIE
72-
*//**
73-
* <h1>RequestTraceInterceptor</h1>
46+
* <strong>RequestTraceInterceptor</strong>
7447
*
7548
* <p>This class serves as an interceptor for HTTP TRACE requests, ensuring they adhere to specific security and protocol guidelines.</p>
7649
*

httpclient5/src/test/java/org/apache/hc/client5/http/examples/AsyncClientServerZstdExample.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,14 @@
7979
* deterministic zstd payloads for demonstration and tests; the client side does not depend
8080
* on it and relies solely on HttpComponents.</p>
8181
*
82-
* <h3>What this demonstrates</h3>
82+
* <p><strong>What this demonstrates</strong></p>
8383
* <ul>
8484
* <li>How to validate transparent zstd decoding without hitting external endpoints.</li>
8585
* <li>That the async client strips {@code Content-Encoding} on success.</li>
8686
* <li>No special client wiring is required beyond enabling content compression (on by default).</li>
8787
* </ul>
8888
*
89-
* <h3>Expected output</h3>
89+
* <p><strong>Expected output</strong></p>
9090
* <pre>{@code
9191
* status=200
9292
* content-encoding=(stripped by client)

0 commit comments

Comments
 (0)