From 2be6ef0a57182e17ed4658f9d4cd2289d8cf2256 Mon Sep 17 00:00:00 2001 From: rishi-aga <61517466+rishi-aga@users.noreply.github.com> Date: Mon, 29 Mar 2021 10:45:24 -0400 Subject: [PATCH] Fix elide-model-config javadoc warnings (#1972) Co-authored-by: Aaron Klish --- .../elide/modelconfig/DynamicConfigHelpers.java | 12 ++++++------ .../modelconfig/DynamicConfigSchemaValidator.java | 10 +++++----- .../com/yahoo/elide/modelconfig/model/Dimension.java | 2 +- .../com/yahoo/elide/modelconfig/model/Measure.java | 2 +- .../com/yahoo/elide/modelconfig/model/Table.java | 12 ++++++------ .../validator/DynamicConfigValidator.java | 6 +++--- .../modelconfig/verify/DynamicConfigVerifier.java | 11 ++++++----- 7 files changed, 28 insertions(+), 27 deletions(-) diff --git a/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/DynamicConfigHelpers.java b/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/DynamicConfigHelpers.java index bedc7c9828..58707fc404 100644 --- a/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/DynamicConfigHelpers.java +++ b/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/DynamicConfigHelpers.java @@ -53,10 +53,10 @@ public static String formatFilePath(String basePath) { /** * converts variables hjson string to map of variables. - * @param config + * @param config HJSON file content. * @param schemaValidator JSON schema validator. * @return Map of Variables - * @throws IOException + * @throws IOException If an I/O error or a processing error occurs. */ @SuppressWarnings("unchecked") public static Map stringToVariablesPojo(String fileName, String config, @@ -80,7 +80,7 @@ public static Map stringToVariablesPojo(String fileName, String * @param variables : variables to resolve. * @param schemaValidator JSON schema validator. * @return ElideTableConfig Pojo - * @throws IOException + * @throws IOException If an I/O error or a processing error occurs. */ public static ElideTableConfig stringToElideTablePojo(String fileName, String content, Map variables, DynamicConfigSchemaValidator schemaValidator) throws IOException { @@ -103,7 +103,7 @@ public static ElideTableConfig stringToElideTablePojo(String fileName, String co * @param variables : variables to resolve. * @param schemaValidator JSON schema validator. * @return ElideDBConfig Pojo - * @throws IOException + * @throws IOException If an I/O error or a processing error occurs. */ public static ElideDBConfig stringToElideDBConfigPojo(String fileName, String content, Map variables, DynamicConfigSchemaValidator schemaValidator) throws IOException { @@ -126,7 +126,7 @@ public static ElideDBConfig stringToElideDBConfigPojo(String fileName, String co * @param variables : variables to resolve. * @param schemaValidator JSON schema validator. * @return ElideSecurityConfig Pojo - * @throws IOException + * @throws IOException If an I/O error or a processing error occurs. */ public static ElideSecurityConfig stringToElideSecurityPojo(String fileName, String content, Map variables, DynamicConfigSchemaValidator schemaValidator) throws IOException { @@ -147,7 +147,7 @@ public static ElideSecurityConfig stringToElideSecurityPojo(String fileName, Str * @param jsonConfig of table or security * @param variables map from config * @return json string with resolved variables - * @throws IOException + * @throws IOException If an I/O error or a processing error occurs. */ public static String resolveVariables(String jsonConfig, Map variables) throws IOException { HandlebarsHydrator hydrator = new HandlebarsHydrator(); diff --git a/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/DynamicConfigSchemaValidator.java b/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/DynamicConfigSchemaValidator.java index e66903472d..0d69993206 100644 --- a/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/DynamicConfigSchemaValidator.java +++ b/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/DynamicConfigSchemaValidator.java @@ -60,12 +60,12 @@ public DynamicConfigSchemaValidator() { /** * Verify config against schema. - * @param configType - * @param jsonConfig - * @param fileName + * @param configType {@link Config} type. + * @param jsonConfig HJSON file content as JSON string. + * @param fileName Name of HJSON file. * @return whether config is valid - * @throws IOException - * @throws ProcessingException + * @throws IOException If an I/O error occurs. + * @throws ProcessingException If a processing error occurred during validation. */ public boolean verifySchema(Config configType, String jsonConfig, String fileName) throws IOException, ProcessingException { diff --git a/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/model/Dimension.java b/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/model/Dimension.java index 3e6260073a..cd0cb91f3a 100644 --- a/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/model/Dimension.java +++ b/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/model/Dimension.java @@ -106,7 +106,7 @@ public String getDescription() { /** * Checks if this dimension has provided argument. - * @param argName + * @param argName Name of the {@link Argument} to check for. * @return true if this dimension has provided argument. */ public boolean hasArgument(String argName) { diff --git a/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/model/Measure.java b/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/model/Measure.java index 950d5bc690..df3ea865fc 100644 --- a/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/model/Measure.java +++ b/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/model/Measure.java @@ -91,7 +91,7 @@ public String getDescription() { /** * Checks if this measure has provided argument. - * @param argName + * @param argName Name of the {@link Argument} to check for. * @return true if this measure has provided argument. */ public boolean hasArgument(String argName) { diff --git a/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/model/Table.java b/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/model/Table.java index 6acc362b36..dd18724980 100644 --- a/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/model/Table.java +++ b/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/model/Table.java @@ -128,7 +128,7 @@ public String getDescription() { /** * Checks if this model has provided field. - * @param fieldName + * @param fieldName Name of the {@link Dimension} or {@link Measure} to check for. * @return true if this model has provided field. */ public boolean hasField(String fieldName) { @@ -137,7 +137,7 @@ public boolean hasField(String fieldName) { /** * Provides the Field details for provided field name. - * @param fieldName + * @param fieldName Name of {@link Dimension} or {@link Measure} to retrieve. * @return Field for provided field name. */ public Named getField(String fieldName) { @@ -149,7 +149,7 @@ public Named getField(String fieldName) { /** * Checks if this model has provided argument. - * @param argName + * @param argName Name of the {@link Argument} to check for. * @return true if this model has provided argument. */ public boolean hasArgument(String argName) { @@ -158,7 +158,7 @@ public boolean hasArgument(String argName) { /** * Checks if this model has provided join field. - * @param joinName + * @param joinName Name of the {@link Join} to check for. * @return true if this model has provided join field. */ public boolean hasJoinField(String joinName) { @@ -167,7 +167,7 @@ public boolean hasJoinField(String joinName) { /** * Provides the Join details for provided join name. - * @param joinName + * @param joinName Name of the {@link Join} to retrieve. * @return Join for provided join name. */ public Join getJoin(String joinName) { @@ -187,7 +187,7 @@ public boolean hasParent() { /** * Provides the parent model for this model. - * @param elideTableConfig + * @param elideTableConfig {@link ElideTableConfig} * @return Parent model for this model */ public Table getParent(ElideTableConfig elideTableConfig) { diff --git a/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/validator/DynamicConfigValidator.java b/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/validator/DynamicConfigValidator.java index 5a2d093ebe..512fd9305f 100644 --- a/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/validator/DynamicConfigValidator.java +++ b/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/validator/DynamicConfigValidator.java @@ -756,9 +756,9 @@ private static void printHelp(Options options) { } /** - * Remove src/.../resources/ from filepath. - * @param filePath - * @return Path to model dir + * Remove src/.../resources/ from class path for configs directory. + * @param filePath class path for configs directory. + * @return formatted class path for configs directory. */ public static String formatClassPath(String filePath) { if (filePath.indexOf(RESOURCES + "/") > -1) { diff --git a/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/verify/DynamicConfigVerifier.java b/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/verify/DynamicConfigVerifier.java index 049e2ff41d..66b4b25f7f 100644 --- a/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/verify/DynamicConfigVerifier.java +++ b/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/verify/DynamicConfigVerifier.java @@ -81,9 +81,10 @@ public static void main(String[] args) { * @param signature : file containing signature * @param publicKey : public key name * @return whether the file can be verified by given key and signature - * @throws NoSuchAlgorithmException - * @throws InvalidKeyException - * @throws SignatureException + * @throws NoSuchAlgorithmException If no Provider supports a Signature implementation for the SHA256withRSA + * algorithm. + * @throws InvalidKeyException If the {@code publicKey} is invalid. + * @throws SignatureException If Signature object is not initialized properly. */ public static boolean verify(String fileContent, String signature, PublicKey publicKey) throws NoSuchAlgorithmException, InvalidKeyException, SignatureException { @@ -101,8 +102,8 @@ public static boolean verify(String fileContent, String signature, PublicKey pub * Read Content of all files. * @param archiveFile : tar.gz file path * @return appended content of all files in tar - * @throws FileNotFoundException - * @throws IOException + * @throws FileNotFoundException If {@code archiveFile} does not exist. + * @throws IOException If an I/O error occurs. */ public static String readTarContents(String archiveFile) throws FileNotFoundException, IOException { StringBuffer sb = new StringBuffer();