Skip to content

Add JavaDoc with Example Usage to classes and non-private methods#92

Merged
mercyblitz merged 7 commits intomainfrom
copilot/add-javadoc-to-classes-methods
Mar 22, 2026
Merged

Add JavaDoc with Example Usage to classes and non-private methods#92
mercyblitz merged 7 commits intomainfrom
copilot/add-javadoc-to-classes-methods

Conversation

Copy link
Contributor

Copilot AI commented Mar 21, 2026

Adds JavaDoc documentation with Example Usage code blocks to all non-private methods and constructors missing JavaDoc across both modules. Examples are derived from existing test cases.

Scope (44 files, ~2350 lines)

  • Discovery module: ReactiveDiscoveryClientAdapter, UnionDiscoveryClient, auto-configuration classes
  • Service registry: SimpleServiceRegistry, MultipleServiceRegistry, MultipleRegistration, RegistrationMetaData, InMemoryServiceRegistry, endpoints, aspects, auto-configurations
  • Events: RegistrationEvent and all subclasses
  • Fault tolerance: WeightedRoundRobin, TomcatDynamicConfigurationListener
  • OpenFeign: AutoRefreshCapability, FeignComponentRegistry, all Decorated* components, CompositedRequestInterceptor
  • Utilities: ServiceInstanceUtils.attachMetadata

Format

/**
 * Registers the given {@link DefaultRegistration} by adding it to the instances list.
 *
 * <p>Example Usage:
 * <pre>{@code
 * SimpleServiceRegistry registry = new SimpleServiceRegistry(properties);
 * DefaultRegistration registration = new DefaultRegistration();
 * registration.setServiceId("test-service");
 * registry.register(registration);
 * }</pre>
 *
 * @param registration the {@link DefaultRegistration} to register
 */

Existing JavaDoc is untouched. @Override methods from well-known interfaces use {@inheritDoc} with a brief delegation note.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • repo.maven.apache.org
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.13/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.13/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.13 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.13/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/microsphere-spring-cloud/microsphere-spring-cloud org.codehaus.plexus.classworlds.launcher.Launcher compile -q (dns block)
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.13/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.13/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.13 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.13/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/microsphere-spring-cloud/microsphere-spring-cloud org.codehaus.plexus.classworlds.launcher.Launcher compile -pl microsphere-spring-cloud-commons -q --get-regexp e/spring/cloud/openfeign/autorefresh/FeignComponentRegistry.java it (dns block)
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.13/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.13/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.13 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.13/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/microsphere-spring-cloud/microsphere-spring-cloud org.codehaus.plexus.classworlds.launcher.Launcher compile -pl microsphere-spring-cloud-commons conf�� get e/spring/cloud/openfeign/components/DecoratedErrorDecoder.java p/bin/git credential.userngit (dns block)
  • scanning-api.github.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 6 commits March 21, 2026 13:50
…classes

Add JavaDoc to non-private methods missing documentation in:
- ReactiveDiscoveryClientAdapter: constructor, description(), getInstances(),
  getServices(), probe(), getOrder()
- UnionDiscoveryClient: description(), getInstances(), getServices(),
  getDiscoveryClients(), getOrder(), afterSingletonsInstantiated(),
  destroy(), setApplicationContext()
- DiscoveryClientAutoConfiguration: unionDiscoveryClient() bean method
- ReactiveDiscoveryClientAutoConfiguration: reactiveDiscoveryClientAdapter()
  bean method

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add comprehensive JavaDoc documentation to non-private methods that were
missing it in the service registry package:

- InMemoryServiceRegistry: all @OverRide methods and getMetadata()
- MultipleAutoServiceRegistration: constructor and all @OverRide methods
- MultipleRegistration: constructor, all @OverRide methods, getDefaultRegistration(), special()
- MultipleServiceRegistry: constructor, all @OverRide methods, getRegistrationClass()
- RegistrationMetaData: constructor and all Map @OverRide methods
- SimpleAutoServiceRegistration: constructor and all @OverRide methods
- SimpleServiceRegistry: all constructors, @OverRide methods, and package-private getInstances()

Each JavaDoc includes:
- Brief description with {@link} cross-references
- Example Usage section with <pre>{@code ...}</pre> blocks
- @param, @return tags where applicable

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add comprehensive JavaDoc comments with Example Usage sections using
<pre>{@code ...}</pre> blocks to all non-private methods that were
missing documentation across 10 service registry related files.

Methods documented include @bean factory methods, AOP advices,
lifecycle callbacks, actuator endpoint operations, and protected
template methods.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…g documentation

Add JavaDoc comments to constructors, getters, setters, and other
non-private methods across 7 files in the registry event and fault
tolerance packages. Each JavaDoc follows the project style with brief
descriptions, {@link} cross-references, Example Usage sections using
<pre>{@code}</pre> blocks, and @param/@return tags where applicable.

Files updated:
- RegistrationDeregisteredEvent.java
- RegistrationPreDeregisteredEvent.java
- RegistrationPreRegisteredEvent.java
- RegistrationRegisteredEvent.java
- WeightedRoundRobin.java
- TomcatFaultToleranceAutoConfiguration.java
- TomcatDynamicConfigurationListener.java

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…nfeign module

Add comprehensive JavaDoc comments including brief descriptions, @link
cross-references, Example Usage sections with <pre>{@code ...}</pre>
blocks, and @param/@return tags to all non-private methods that were
missing documentation across 14 files in the openfeign module.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sonarqubecloud
Copy link

Copilot AI changed the title [WIP] Add JavaDoc comments to classes and methods Add JavaDoc with Example Usage to classes and non-private methods Mar 21, 2026
Copilot AI requested a review from mercyblitz March 21, 2026 14:15
@mercyblitz mercyblitz marked this pull request as ready for review March 22, 2026 06:27
@mercyblitz mercyblitz merged commit ab55e7f into main Mar 22, 2026
13 checks passed
@codecov
Copy link

codecov bot commented Mar 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ Complexity Δ
...ient/discovery/ReactiveDiscoveryClientAdapter.java 100.00% <ø> (ø) 9.00 <0.00> (ø)
...g/cloud/client/discovery/UnionDiscoveryClient.java 100.00% <ø> (ø) 17.00 <0.00> (ø)
...utoconfigure/DiscoveryClientAutoConfiguration.java 100.00% <ø> (ø) 1.00 <0.00> (ø)
...gure/ReactiveDiscoveryClientAutoConfiguration.java 100.00% <ø> (ø) 1.00 <0.00> (ø)
...ient/service/registry/InMemoryServiceRegistry.java 100.00% <ø> (ø) 10.00 <0.00> (ø)
...vice/registry/MultipleAutoServiceRegistration.java 100.00% <ø> (ø) 5.00 <0.00> (ø)
.../client/service/registry/MultipleRegistration.java 100.00% <ø> (ø) 16.00 <0.00> (ø)
...ient/service/registry/MultipleServiceRegistry.java 100.00% <ø> (ø) 14.00 <0.00> (ø)
.../client/service/registry/RegistrationMetaData.java 96.15% <ø> (-3.85%) 23.00 <0.00> (-1.00)
...ervice/registry/SimpleAutoServiceRegistration.java 100.00% <ø> (ø) 5.00 <0.00> (ø)
... and 34 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants