This is an automated email from the ASF dual-hosted git repository.
He-Pin pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pekko-connectors.git
The following commit(s) were added to refs/heads/main by this push:
new 9106b6991 fix: fix javadoc warnings in file connector Java sources
(#1744)
9106b6991 is described below
commit 9106b69913c868d35274e7e15a9ae6a70a6eef56
Author: He-Pin(kerr) <[email protected]>
AuthorDate: Sun Jul 5 17:51:00 2026 +0800
fix: fix javadoc warnings in file connector Java sources (#1744)
* fix: fix javadoc warnings in Java sources across pekko-connectors modules
Motivation:
Running `sbt doc` produces javadoc warnings in Java source files:
Scala-style `[[...]]` links, multi-line `{@link}` tags, and public
classes/methods missing javadoc across file, spring-web, csv,
discovery, and other modules.
Modification:
- Replace `[[...]]` links with `{@code}` or `{@link}` in FileTailSource,
CsvToMap, DiscoverySupport, PravegaTable, ParseEventMarker
- Fix multi-line `{@link}` tags in FileTailSource.java
- Add javadoc to public classes and methods in spring-web module
(PekkoStreamsRegistrar, SpringWebPekkoStreamsConfiguration,
SpringWebPekkoStreamsProperties)
- Apply javafmt to all modified Java files
Result:
All javadoc warnings in Java sources are eliminated.
Tests:
Manually verified via `sbt doc` and grep pattern search
References:
Follow-up to #1173
* fix: address CR feedback on DiscoverySupport.java javadoc
Motivation:
The PR #1744 replaced the Scala-style [[...]] link in DiscoverySupport.java
with a raw HTML <a href> tag. The reviewer suggested using a cleaner
reference
to Apache Pekko Discovery, as the connector docs already have a proper
@extref
link to the discovery documentation.
Modification:
Replace the HTML <a href="...">Pekko Discovery</a> link with a plain text
reference "Apache Pekko Discovery" in the class javadoc. The connector docs
(docs/src/main/paradox/couchbase.md) already explain the discovery
integration
in detail with a proper @extref link.
Result:
Cleaner javadoc without raw HTML links, addressing the reviewer's feedback.
Tests:
sbt "couchbase / Compile / doc" - no warnings
References:
Addresses review comment in PR #1744
* fix: apply javafmt to DiscoverySupport.java
Motivation:
CI checkCodeStyle job fails with (couchbase / Compile / javafmtCheck)
1 file must be formatted.
Modification:
Run javafmt on DiscoverySupport.java to collapse the single-line
javadoc onto one line as required by the formatter.
Result:
checkCodeStyle passes for all modules.
Tests:
sbt checkCodeStyle → success
References:
Follow-up to #1744
---
.../couchbase/javadsl/DiscoverySupport.java | 5 +----
.../stream/connectors/csv/javadsl/CsvToMap.java | 4 ++--
.../connectors/pravega/javadsl/PravegaTable.java | 4 ++--
.../spring/web/PekkoStreamsRegistrar.java | 15 +++++++++++++
.../web/SpringWebPekkoStreamsConfiguration.java | 25 ++++++++++++++++++++++
.../web/SpringWebPekkoStreamsProperties.java | 15 +++++++++++++
.../stream/connectors/xml/ParseEventMarker.java | 2 +-
7 files changed, 61 insertions(+), 9 deletions(-)
diff --git
a/couchbase/src/main/java/org/apache/pekko/stream/connectors/couchbase/javadsl/DiscoverySupport.java
b/couchbase/src/main/java/org/apache/pekko/stream/connectors/couchbase/javadsl/DiscoverySupport.java
index 1e59053f7..d6c93aae8 100644
---
a/couchbase/src/main/java/org/apache/pekko/stream/connectors/couchbase/javadsl/DiscoverySupport.java
+++
b/couchbase/src/main/java/org/apache/pekko/stream/connectors/couchbase/javadsl/DiscoverySupport.java
@@ -19,10 +19,7 @@ import org.apache.pekko.actor.ActorSystem;
import org.apache.pekko.actor.ClassicActorSystemProvider;
import org.apache.pekko.stream.connectors.couchbase.CouchbaseSessionSettings;
-/**
- * Utility to delegate Couchbase node address lookup to
- * [[https://pekko.apache.org/docs/pekko/current/discovery/index.html Pekko
Discovery]].
- */
+/** Utility to delegate Couchbase node address lookup to Apache Pekko
Discovery. */
public final class DiscoverySupport {
private static final
org.apache.pekko.stream.connectors.couchbase.scaladsl.DiscoverySupport
diff --git
a/csv/src/main/java/org/apache/pekko/stream/connectors/csv/javadsl/CsvToMap.java
b/csv/src/main/java/org/apache/pekko/stream/connectors/csv/javadsl/CsvToMap.java
index f592ea51b..b4e2038d3 100644
---
a/csv/src/main/java/org/apache/pekko/stream/connectors/csv/javadsl/CsvToMap.java
+++
b/csv/src/main/java/org/apache/pekko/stream/connectors/csv/javadsl/CsvToMap.java
@@ -28,8 +28,8 @@ public class CsvToMap {
/**
* A flow translating incoming {@link Collection<ByteString>} to a {@link
Map<String, ByteString>}
- * using the stream's first element's values as keys. The charset to decode
[[ByteString]] to
- * [[String]] defaults to UTF-8.
+ * using the stream's first element's values as keys. The charset to decode
{@code ByteString} to
+ * {@code String} defaults to UTF-8.
*/
public static Flow<Collection<ByteString>, Map<String, ByteString>, ?>
toMap() {
return toMap(StandardCharsets.UTF_8);
diff --git
a/pravega/src/main/java/org/apache/pekko/stream/connectors/pravega/javadsl/PravegaTable.java
b/pravega/src/main/java/org/apache/pekko/stream/connectors/pravega/javadsl/PravegaTable.java
index c146124f7..5af2ecfcb 100644
---
a/pravega/src/main/java/org/apache/pekko/stream/connectors/pravega/javadsl/PravegaTable.java
+++
b/pravega/src/main/java/org/apache/pekko/stream/connectors/pravega/javadsl/PravegaTable.java
@@ -53,8 +53,8 @@ public class PravegaTable {
/**
* Messages are read from a Pravega table.
*
- * <p>Materialized value is a [[Future]] which completes to [[Done]] as soon
as the Pravega reader
- * is open.
+ * <p>Materialized value is a {@code Future} which completes to {@code Done}
as soon as the
+ * Pravega reader is open.
*/
public static <K, V> Source<TableEntry<V>, CompletionStage<Done>> source(
String scope, String tableName, TableReaderSettings<K, V>
tableReaderSettings) {
diff --git
a/spring-web/src/main/java/org/apache/pekko/stream/connectors/spring/web/PekkoStreamsRegistrar.java
b/spring-web/src/main/java/org/apache/pekko/stream/connectors/spring/web/PekkoStreamsRegistrar.java
index 7e23130dc..fd3d5eecf 100644
---
a/spring-web/src/main/java/org/apache/pekko/stream/connectors/spring/web/PekkoStreamsRegistrar.java
+++
b/spring-web/src/main/java/org/apache/pekko/stream/connectors/spring/web/PekkoStreamsRegistrar.java
@@ -22,14 +22,29 @@ import org.apache.pekko.stream.javadsl.AsPublisher;
import org.springframework.core.ReactiveAdapterRegistry;
import org.springframework.util.Assert;
+/**
+ * Registers Pekko Streams reactive type adapters (both Java and Scala DSL
{@code Source} types)
+ * with Spring's {@link ReactiveAdapterRegistry}, enabling Spring Web to
handle Pekko Streams
+ * sources as reactive return types in controller methods.
+ */
public class PekkoStreamsRegistrar {
private final ActorSystem system;
+ /**
+ * Creates a new registrar backed by the given actor system.
+ *
+ * @param system the actor system provider used to materialize Pekko Streams
sources
+ */
public PekkoStreamsRegistrar(ClassicActorSystemProvider system) {
this.system = system.classicSystem();
}
+ /**
+ * Registers the Java and Scala DSL {@code Source} reactive types with the
given registry.
+ *
+ * @param registry the Spring {@link ReactiveAdapterRegistry} to register
adapters with
+ */
public void registerAdapters(ReactiveAdapterRegistry registry) {
Assert.notNull(registry, "registry must not be null");
registry.registerReactiveType(
diff --git
a/spring-web/src/main/java/org/apache/pekko/stream/connectors/spring/web/SpringWebPekkoStreamsConfiguration.java
b/spring-web/src/main/java/org/apache/pekko/stream/connectors/spring/web/SpringWebPekkoStreamsConfiguration.java
index 0812d4956..c672d55cf 100644
---
a/spring-web/src/main/java/org/apache/pekko/stream/connectors/spring/web/SpringWebPekkoStreamsConfiguration.java
+++
b/spring-web/src/main/java/org/apache/pekko/stream/connectors/spring/web/SpringWebPekkoStreamsConfiguration.java
@@ -26,6 +26,15 @@ import org.springframework.core.ReactiveAdapterRegistry;
import org.apache.pekko.actor.ActorSystem;
+/**
+ * Spring Boot auto-configuration that sets up Pekko Streams integration for
Spring Web.
+ *
+ * <p>This configuration is activated when Pekko Streams ({@code
+ * org.apache.pekko.stream.javadsl.Source}) is on the classpath. It creates an
{@link ActorSystem}
+ * (unless one is already present) and registers Pekko Streams reactive type
adapters with Spring's
+ * {@link ReactiveAdapterRegistry}, allowing Spring Web controllers to return
Pekko Streams sources
+ * directly.
+ */
@Configuration
@ConditionalOnClass(org.apache.pekko.stream.javadsl.Source.class)
@EnableConfigurationProperties(SpringWebPekkoStreamsProperties.class)
@@ -36,6 +45,12 @@ public class SpringWebPekkoStreamsConfiguration {
private final ActorSystem system;
private final SpringWebPekkoStreamsProperties properties;
+ /**
+ * Creates the configuration, starts the {@link ActorSystem}, and registers
Pekko Streams reactive
+ * type adapters with the shared {@link ReactiveAdapterRegistry}.
+ *
+ * @param properties the Spring Boot configuration properties for Pekko
Streams integration
+ */
public SpringWebPekkoStreamsConfiguration(final
SpringWebPekkoStreamsProperties properties) {
this.properties = properties;
final ReactiveAdapterRegistry registry =
ReactiveAdapterRegistry.getSharedInstance();
@@ -44,12 +59,22 @@ public class SpringWebPekkoStreamsConfiguration {
new PekkoStreamsRegistrar(system).registerAdapters(registry);
}
+ /**
+ * Returns the {@link ActorSystem} managed by this configuration.
+ *
+ * @return the actor system instance created during initialization
+ */
@Bean
@ConditionalOnMissingBean(ActorSystem.class)
public ActorSystem getActorSystem() {
return system;
}
+ /**
+ * Returns the configuration properties used by this configuration.
+ *
+ * @return the Pekko Streams Spring Web properties
+ */
public SpringWebPekkoStreamsProperties getProperties() {
return properties;
}
diff --git
a/spring-web/src/main/java/org/apache/pekko/stream/connectors/spring/web/SpringWebPekkoStreamsProperties.java
b/spring-web/src/main/java/org/apache/pekko/stream/connectors/spring/web/SpringWebPekkoStreamsProperties.java
index 3039d8102..571dcdb13 100644
---
a/spring-web/src/main/java/org/apache/pekko/stream/connectors/spring/web/SpringWebPekkoStreamsProperties.java
+++
b/spring-web/src/main/java/org/apache/pekko/stream/connectors/spring/web/SpringWebPekkoStreamsProperties.java
@@ -15,15 +15,30 @@ package org.apache.pekko.stream.connectors.spring.web;
import org.springframework.boot.context.properties.ConfigurationProperties;
+/**
+ * Spring Boot configuration properties for Pekko Streams Spring Web
integration.
+ *
+ * <p>Properties are bound under the {@code
pekko.stream.connectors.spring.web} prefix.
+ */
@ConfigurationProperties(prefix = "pekko.stream.connectors.spring.web")
public class SpringWebPekkoStreamsProperties {
private String actorSystemName;
+ /**
+ * Returns the name of the actor system to create. If not set, a default
name is used.
+ *
+ * @return the actor system name, or {@code null} if not configured
+ */
public String getActorSystemName() {
return actorSystemName;
}
+ /**
+ * Sets the name of the actor system to create.
+ *
+ * @param actorSystemName the actor system name
+ */
public void setActorSystemName(String actorSystemName) {
this.actorSystemName = actorSystemName;
}
diff --git
a/xml/src/main/java/org/apache/pekko/stream/connectors/xml/ParseEventMarker.java
b/xml/src/main/java/org/apache/pekko/stream/connectors/xml/ParseEventMarker.java
index 9b3abe406..5515f6708 100644
---
a/xml/src/main/java/org/apache/pekko/stream/connectors/xml/ParseEventMarker.java
+++
b/xml/src/main/java/org/apache/pekko/stream/connectors/xml/ParseEventMarker.java
@@ -14,7 +14,7 @@
package org.apache.pekko.stream.connectors.xml;
/**
- * Mirrors the sub-classes of [[ParseEvent]] to allow use with Java switch
statements instead of
+ * Mirrors the sub-classes of {@link ParseEvent} to allow use with Java switch
statements instead of
* chained `instanceOf` tests.
*/
public enum ParseEventMarker {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]