From b5e0aab960ffa34d1a706e495c75659669be5ff0 Mon Sep 17 00:00:00 2001 From: Kostis Sagonas Date: Wed, 5 Nov 2025 14:12:34 +0100 Subject: [PATCH] Add explicit constructors to satisfy Javadoc By testing the code base using Java 21 (the default version on the most recent Debian), it was revealed that its Javadoc version generates many warnings. Most were due to classes "using a default constructor which does not provide a comment"; this was addressed by adding an explicit contructor with a trivial comment (perhaps a better one can be added, for some of them). A couple of few other missing comments were added. Since this set of changes is orthogonal to using Java 17 vs 21, it's submitted as a separate PR to be merged. --- .../learner/config/DurationConverter.java | 5 +++++ .../learner/config/LearnerConfigStandard.java | 5 +++++ .../learner/factory/LearningSetupFactory.java | 5 +++++ .../statistics/HypothesisStatistics.java | 5 +++++ .../sul/core/SulWrapperStandard.java | 5 +++++ .../config/InputResponseTimeoutConverter.java | 5 +++++ .../core/config/SulAdapterConfigStandard.java | 3 ++- .../mapper/abstractsymbols/OutputBuilder.java | 5 +++++ .../mapper/config/MapperConfigStandard.java | 5 +++++ .../core/config/BasicConverterFactory.java | 20 +++++++++++++++++++ .../testrunner/core/TestParser.java | 5 +++++ .../testrunner/core/TestRunnerResult.java | 3 +++ .../core/config/TestRunnerConfigStandard.java | 5 +++++ .../timingprobe/TimingProbeStandard.java | 2 +- .../config/TimingProbeConfigStandard.java | 5 +++++ .../utils/AutomatonUtils.java | 15 ++++++++++++-- .../protocolstatefuzzer/utils/DFAUtils.java | 5 +++++ .../utils/DotProcessor.java | 5 +++++ .../utils/ExportableResult.java | 5 +++++ .../utils/MealyDotParser.java | 5 +++++ .../protocolstatefuzzer/utils/MealyUtils.java | 7 ++++++- .../utils/ModelFactory.java | 5 +++++ 22 files changed, 125 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/components/learner/config/DurationConverter.java b/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/components/learner/config/DurationConverter.java index 5c48e837..58f40263 100644 --- a/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/components/learner/config/DurationConverter.java +++ b/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/components/learner/config/DurationConverter.java @@ -10,6 +10,11 @@ */ public class DurationConverter implements IStringConverter { + /** + * Constructor + */ + public DurationConverter() { } + /** * Converts a String to Duration and uses {@link PropertyResolver#resolve(String)}. * diff --git a/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/components/learner/config/LearnerConfigStandard.java b/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/components/learner/config/LearnerConfigStandard.java index 0075fdaf..ef691cca 100644 --- a/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/components/learner/config/LearnerConfigStandard.java +++ b/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/components/learner/config/LearnerConfigStandard.java @@ -288,6 +288,11 @@ public class LearnerConfigStandard implements LearnerConfig { @Parameter(names = {"-equivalenceThreadCount", "-eqvThreads"}, description = "The number of threads to parallel RandomWpMethodEQOracle (we only support this method right now)") protected Integer equivalenceThreadCount = 1; + /** + * Constructor + */ + public LearnerConfigStandard() { } + @Override public String getAlphabetFilename() { return alphabetFilename; diff --git a/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/components/learner/factory/LearningSetupFactory.java b/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/components/learner/factory/LearningSetupFactory.java index 9e180f0e..b8ce526f 100644 --- a/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/components/learner/factory/LearningSetupFactory.java +++ b/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/components/learner/factory/LearningSetupFactory.java @@ -56,6 +56,11 @@ */ public class LearningSetupFactory { + /** + * Constructor + */ + public LearningSetupFactory() { } + /** * Create a new MealyLearner from the given parameters. * diff --git a/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/components/learner/statistics/HypothesisStatistics.java b/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/components/learner/statistics/HypothesisStatistics.java index d65c186a..6b59d7c2 100644 --- a/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/components/learner/statistics/HypothesisStatistics.java +++ b/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/components/learner/statistics/HypothesisStatistics.java @@ -25,6 +25,11 @@ public class HypothesisStatistics { protected StatisticsSnapshot counterexampleSnapshot; + /** + * Constructor + */ + public HypothesisStatistics() { } + /** * Returns the stored {@link #hypothesis}. * diff --git a/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/components/sul/core/SulWrapperStandard.java b/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/components/sul/core/SulWrapperStandard.java index c6360c64..340ba57b 100644 --- a/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/components/sul/core/SulWrapperStandard.java +++ b/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/components/sul/core/SulWrapperStandard.java @@ -43,6 +43,11 @@ public class SulWrapperStandard implements SulWrapper { /** The test limit to be set only once using {@link #setTestLimit(Long)}. */ protected Long testLimit; + /** + * Constructor + */ + public SulWrapperStandard() { } + @Override public SulWrapper wrap(AbstractSul abstractSul) { wrappedSul = abstractSul; diff --git a/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/components/sul/core/config/InputResponseTimeoutConverter.java b/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/components/sul/core/config/InputResponseTimeoutConverter.java index b905ba84..0b09ab67 100644 --- a/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/components/sul/core/config/InputResponseTimeoutConverter.java +++ b/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/components/sul/core/config/InputResponseTimeoutConverter.java @@ -12,6 +12,11 @@ */ public class InputResponseTimeoutConverter implements IStringConverter> { + /** + * Constructor + */ + public InputResponseTimeoutConverter() { } + /** * Converts a String to {@code Map} and uses {@link PropertyResolver#resolve(String)}. * diff --git a/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/components/sul/core/config/SulAdapterConfigStandard.java b/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/components/sul/core/config/SulAdapterConfigStandard.java index 17f98bd5..55aa28d6 100644 --- a/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/components/sul/core/config/SulAdapterConfigStandard.java +++ b/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/components/sul/core/config/SulAdapterConfigStandard.java @@ -39,6 +39,7 @@ public String getAdapterAddress() { } /** + * Constructs a new instance from the given parameters. * * @param adapterPort the adapterPort to set * @param adapterAddress the adapterAddress to set @@ -51,5 +52,5 @@ public SulAdapterConfigStandard(int adapterPort, String adapterAddress) { /** * Constructor */ - public SulAdapterConfigStandard() { } + public SulAdapterConfigStandard() { } } diff --git a/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/components/sul/mapper/abstractsymbols/OutputBuilder.java b/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/components/sul/mapper/abstractsymbols/OutputBuilder.java index 554d9827..1d1b7d15 100644 --- a/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/components/sul/mapper/abstractsymbols/OutputBuilder.java +++ b/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/components/sul/mapper/abstractsymbols/OutputBuilder.java @@ -24,6 +24,11 @@ public abstract class OutputBuilder { /** Stores the map containing user specific replacements of symbols. */ protected Map userSpecificMap = new LinkedHashMap<>(); + /** + * Constructor + */ + public OutputBuilder() { } + /** * Builds the exact output symbol corresponding to the provided name. * diff --git a/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/components/sul/mapper/config/MapperConfigStandard.java b/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/components/sul/mapper/config/MapperConfigStandard.java index bccfdf36..5ab30aec 100644 --- a/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/components/sul/mapper/config/MapperConfigStandard.java +++ b/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/components/sul/mapper/config/MapperConfigStandard.java @@ -82,6 +82,11 @@ public class MapperConfigStandard implements MapperConfig { + "into a single output with '" + MapperOutput.REPEATING_INDICATOR + "' appended") protected boolean dontMergeRepeating = false; + /** + * Constructor + */ + public MapperConfigStandard() { } + @Override public String getMapperConnectionConfig() { return mapperConnectionConfig; diff --git a/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/statefuzzer/core/config/BasicConverterFactory.java b/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/statefuzzer/core/config/BasicConverterFactory.java index e836304d..9590a345 100644 --- a/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/statefuzzer/core/config/BasicConverterFactory.java +++ b/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/statefuzzer/core/config/BasicConverterFactory.java @@ -47,6 +47,11 @@ public Class> getConverter(Class forType) { */ protected static class StringConverter implements IStringConverter { + /** + * Constructor + */ + public StringConverter() { } + /** * Converts a String to String and uses {@link PropertyResolver#resolve(String)}. * @@ -64,6 +69,11 @@ public String convert(String value) { */ protected static class IntegerConverter implements IStringConverter { + /** + * Constructor + */ + public IntegerConverter() { } + /** * Converts a String to Integer and uses {@link PropertyResolver#resolve(String)}. * @@ -81,6 +91,11 @@ public Integer convert(String value) { */ protected static class LongConverter implements IStringConverter { + /** + * Constructor + */ + public LongConverter() { } + /** * Converts a String to Long and uses {@link PropertyResolver#resolve(String)}. * @@ -98,6 +113,11 @@ public Long convert(String value) { */ protected static class DoubleConverter implements IStringConverter { + /** + * Constructor + */ + public DoubleConverter() { } + /** * Converts a String to Double and uses {@link PropertyResolver#resolve(String)}. * diff --git a/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/statefuzzer/testrunner/core/TestParser.java b/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/statefuzzer/testrunner/core/TestParser.java index 6b4e544e..9cbd6b6f 100644 --- a/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/statefuzzer/testrunner/core/TestParser.java +++ b/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/statefuzzer/testrunner/core/TestParser.java @@ -27,6 +27,11 @@ */ public class TestParser { + /** + * Constructor + */ + public TestParser() { } + /** * Writes test to file given the filename. * diff --git a/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/statefuzzer/testrunner/core/TestRunnerResult.java b/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/statefuzzer/testrunner/core/TestRunnerResult.java index 25e9eccf..ac056189 100644 --- a/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/statefuzzer/testrunner/core/TestRunnerResult.java +++ b/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/statefuzzer/testrunner/core/TestRunnerResult.java @@ -4,6 +4,9 @@ /** * Represents the result of a single test run. + * + * @param the type of inputs + * @param the type of outputs */ public class TestRunnerResult { diff --git a/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/statefuzzer/testrunner/core/config/TestRunnerConfigStandard.java b/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/statefuzzer/testrunner/core/config/TestRunnerConfigStandard.java index 9e63dc2c..c0d1f7ea 100644 --- a/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/statefuzzer/testrunner/core/config/TestRunnerConfigStandard.java +++ b/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/statefuzzer/testrunner/core/config/TestRunnerConfigStandard.java @@ -54,6 +54,11 @@ public class TestRunnerConfigStandard implements TestRunnerConfig { + "nicer form.") protected boolean showTransitionSequence = false; + /** + * Constructor + */ + public TestRunnerConfigStandard() { } + /** * Returns the value of {@link #test}. * diff --git a/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/statefuzzer/testrunner/timingprobe/TimingProbeStandard.java b/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/statefuzzer/testrunner/timingprobe/TimingProbeStandard.java index 4357e2e2..6b9a7262 100644 --- a/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/statefuzzer/testrunner/timingprobe/TimingProbeStandard.java +++ b/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/statefuzzer/testrunner/timingprobe/TimingProbeStandard.java @@ -53,7 +53,7 @@ public TimingProbeStandard( this.timingProbeConfig = timingProbeEnabler.getTimingProbeConfig(); this.alphabetBuilder = alphabetBuilder; - if(isActive()) { + if (isActive()) { this.probeTestRunner = new ProbeTestRunner<>( timingProbeEnabler, alphabetBuilder, sulBuilder ); diff --git a/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/statefuzzer/testrunner/timingprobe/config/TimingProbeConfigStandard.java b/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/statefuzzer/testrunner/timingprobe/config/TimingProbeConfigStandard.java index 6d017786..e3a50f49 100644 --- a/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/statefuzzer/testrunner/timingprobe/config/TimingProbeConfigStandard.java +++ b/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/statefuzzer/testrunner/timingprobe/config/TimingProbeConfigStandard.java @@ -60,6 +60,11 @@ public class TimingProbeConfigStandard implements TimingProbeConfig { @Parameter(names = "-probeExport", description = "The output file to store the modified alphabet") protected String probeExport = null; + /** + * Constructor + */ + public TimingProbeConfigStandard() { } + /** * Returns the value of {@link #probeCmd}. * diff --git a/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/utils/AutomatonUtils.java b/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/utils/AutomatonUtils.java index 034f0203..deafd129 100644 --- a/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/utils/AutomatonUtils.java +++ b/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/utils/AutomatonUtils.java @@ -17,6 +17,11 @@ */ public class AutomatonUtils { + /** + * Constructor + */ + public AutomatonUtils() { } + /** * Provides all the reachable states from the initial state of the * automaton. @@ -259,11 +264,17 @@ public Set getVisited() { * @param the type of states * @param the type of inputs */ - public static class PredMap extends LinkedHashMap>>{ + public static class PredMap extends LinkedHashMap>> { @Serial private static final long serialVersionUID = 1L; + + /** + * Constructor + */ + public PredMap() { } } + /** * Holds information about a predecessor state of a specified state and * the input that leads from the predecessor state to the specified state. @@ -274,7 +285,7 @@ public static class PredMap extends LinkedHashMap the type of states * @param the type of inputs */ - public static class PredStruct { + public static class PredStruct { /** Stores the constructor parameter. */ protected S state; diff --git a/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/utils/DFAUtils.java b/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/utils/DFAUtils.java index 045870f9..84b98bde 100644 --- a/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/utils/DFAUtils.java +++ b/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/utils/DFAUtils.java @@ -27,6 +27,11 @@ */ public class DFAUtils extends AutomatonUtils { + /** + * Constructor + */ + public DFAUtils() { } + /** * Converts a deterministic Mealy Machine to an equivalent DFA. *

diff --git a/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/utils/DotProcessor.java b/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/utils/DotProcessor.java index 00c95bf3..8871d50c 100644 --- a/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/utils/DotProcessor.java +++ b/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/utils/DotProcessor.java @@ -13,6 +13,11 @@ public class DotProcessor { private static final Logger LOGGER = LogManager.getLogger(); + /** + * Constructor + */ + public DotProcessor() { } + /** * Exports the provided DOT file to PDF using the {@code dot} utility in * the system's PATH. diff --git a/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/utils/ExportableResult.java b/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/utils/ExportableResult.java index 222966e8..7c708916 100644 --- a/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/utils/ExportableResult.java +++ b/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/utils/ExportableResult.java @@ -16,6 +16,11 @@ public abstract class ExportableResult { /** Delimiter that surrounds the results' title. */ protected static final String TITLE_DELIM = "=".repeat(80); + /** + * Constructor + */ + public ExportableResult() { } + /** * Uses the {@link #doExport(PrintWriter)} method and closes the writer * afterwards. diff --git a/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/utils/MealyDotParser.java b/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/utils/MealyDotParser.java index d66adc80..172c733c 100644 --- a/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/utils/MealyDotParser.java +++ b/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/utils/MealyDotParser.java @@ -16,6 +16,11 @@ */ public class MealyDotParser { + /** + * Constructor + */ + public MealyDotParser() { } + /** * Parses the contents of a Mealy Machine DOT file. * diff --git a/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/utils/MealyUtils.java b/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/utils/MealyUtils.java index 23fcbf74..314b8626 100644 --- a/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/utils/MealyUtils.java +++ b/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/utils/MealyUtils.java @@ -12,7 +12,12 @@ /** * Collection of Mealy Machine automata related methods. */ -public class MealyUtils extends AutomatonUtils{ +public class MealyUtils extends AutomatonUtils { + + /** + * Constructor + */ + public MealyUtils() { } /** * Provides all the outputs a Mealy Machine automaton can generate in diff --git a/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/utils/ModelFactory.java b/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/utils/ModelFactory.java index ddd61681..a29886d2 100644 --- a/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/utils/ModelFactory.java +++ b/src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/utils/ModelFactory.java @@ -14,6 +14,11 @@ */ public class ModelFactory { + /** + * Constructor + */ + public ModelFactory() { } + /** * Builds a Mealy Machine from an alphabet and a DOT file. *