build: Add default constructor and javadoc for metrics, nat, pki, plugins, services, testutil, util (#7071)

Signed-off-by: Usman Saleem <usman@usmans.info>
This commit is contained in:
Usman Saleem
2024-05-08 14:39:10 +10:00
committed by GitHub
parent 5b16cef571
commit 42e9139265
18 changed files with 54 additions and 0 deletions

View File

@@ -25,6 +25,9 @@ public class MetricCategoryRegistryImpl implements MetricCategoryRegistry {
private final List<MetricCategory> metricCategories = new ArrayList<>();
/** Default constructor */
public MetricCategoryRegistryImpl() {}
/**
* Gets metric categories.
*

View File

@@ -24,6 +24,9 @@ import dagger.Provides;
/** Dagger module for providing the {@link MetricsConfiguration} instance. */
@Module
public class MetricsConfigurationModule {
/** Default constructor */
public MetricsConfigurationModule() {}
@Provides
@Singleton
MetricsConfiguration provideMetricsConfiguration() {

View File

@@ -28,6 +28,8 @@ import dagger.Provides;
*/
@Module
public class MetricsSystemModule {
/** Default constructor */
public MetricsSystemModule() {}
@Provides
@Singleton

View File

@@ -73,6 +73,9 @@ public class NoOpMetricsSystem implements ObservableMetricsSystem {
public static final LabelledGauge NO_OP_LABELLED_3_GAUGE =
new LabelledGaugeNoOpMetric(3, NO_OP_GAUGE);
/** Default constructor */
public NoOpMetricsSystem() {}
@Override
public LabelledMetric<Counter> createLabelledCounter(
final MetricCategory category,

View File

@@ -24,6 +24,9 @@ import java.util.function.DoubleSupplier;
public class NoOpValueCollector implements LabelledGauge {
private final List<String> labelValuesCreated = new ArrayList<>();
/** Default constructor */
public NoOpValueCollector() {}
@Override
public synchronized void labels(final DoubleSupplier valueSupplier, final String... labelValues) {
final String labelValuesString = String.join(",", labelValues);

View File

@@ -164,6 +164,9 @@ public class RocksDBStats {
HistogramType.READ_NUM_MERGE_OPERANDS,
};
/** Default constructor */
private RocksDBStats() {}
/**
* Register rocks db metrics.
*

View File

@@ -25,6 +25,8 @@ import java.util.stream.Stream;
/** The Docker detector. */
public class DockerDetector implements NatMethodDetector {
/** Default constructor */
public DockerDetector() {}
@Override
public Optional<NatMethod> detect() {

View File

@@ -25,6 +25,9 @@ public class HostBasedIpDetector implements IpDetector {
private static final String HOSTNAME = "HOST_IP";
/** Default constructor */
public HostBasedIpDetector() {}
@Override
@SuppressWarnings("AddressSelection")
public Optional<String> detectAdvertisedIp() {

View File

@@ -32,6 +32,9 @@ public class KubernetesDetector implements NatMethodDetector {
Optional.ofNullable(System.getenv("KUBERNETES_SERVICE_HOST"));
private static final Path KUBERNETES_WATERMARK_FILE = Paths.get("var/run/secrets/kubernetes.io");
/** Default constructor */
public KubernetesDetector() {}
@Override
public Optional<NatMethod> detect() {
return KUBERNETES_SERVICE_HOST

View File

@@ -27,6 +27,8 @@ import java.util.stream.Collectors;
/** The CRL util. */
public class CRLUtil {
/** Default constructor */
private CRLUtil() {}
/**
* Load CRLs cert store.

View File

@@ -31,6 +31,9 @@ public class RocksDBConfigurationBuilder {
private int backgroundThreadCount = DEFAULT_BACKGROUND_THREAD_COUNT;
private boolean isHighSpec = DEFAULT_IS_HIGH_SPEC;
/** Instantiates a new Rocks db configuration builder. */
public RocksDBConfigurationBuilder() {}
/**
* Database dir.
*

View File

@@ -40,6 +40,9 @@ public class InMemoryStoragePlugin implements BesuPlugin {
private InMemoryKeyValueStorageFactory factory;
private InMemoryKeyValueStorageFactory privacyFactory;
/** Default constructor */
public InMemoryStoragePlugin() {}
@Override
public void register(final BesuContext context) {
LOG.debug("Registering plugin");

View File

@@ -290,6 +290,9 @@ public class SegmentedInMemoryKeyValueStorage
/** protected access to deletedValues set for the transaction. */
protected Map<SegmentIdentifier, Set<Bytes>> removedKeys = new HashMap<>();
/** Default constructor */
public SegmentedInMemoryTransaction() {}
@Override
public void put(
final SegmentIdentifier segmentIdentifier, final byte[] key, final byte[] value) {

View File

@@ -40,6 +40,8 @@ import org.junit.jupiter.api.Test;
/** The Abstract key value storage test. */
@Disabled
public abstract class AbstractKeyValueStorageTest {
/** Default Constructor */
protected AbstractKeyValueStorageTest() {}
/**
* Create store key value storage.

View File

@@ -36,6 +36,14 @@ public class MockExecutorService implements ExecutorService {
private final List<ExecutorTask<?>> tasks = new ArrayList<>();
/** Default constructor */
public MockExecutorService() {}
/**
* Gets tasks.
*
* @return the tasks
*/
/**
* Gets futures.
*

View File

@@ -25,6 +25,8 @@ import java.util.concurrent.TimeoutException;
/** The mock scheduled executor */
public class MockScheduledExecutor extends MockExecutorService implements ScheduledExecutorService {
/** Default constructor */
public MockScheduledExecutor() {}
@Override
public ScheduledFuture<?> schedule(

View File

@@ -34,6 +34,9 @@ import org.slf4j.LoggerFactory;
public class EnclaveKeyUtils {
private static final Logger LOG = LoggerFactory.getLogger(EnclaveKeyUtils.class);
/** Default constructor */
private EnclaveKeyUtils() {}
/**
* Utility method to load the enclave public key. Possible input values are the names of the *.pub
* files in the resources folder.

View File

@@ -30,6 +30,9 @@ import org.testcontainers.containers.Network;
public class TesseraTestHarnessFactory {
private static final String storage = "memory";
/** Default constructor */
private TesseraTestHarnessFactory() {}
/**
* Create tessera test harness.
*