From eae5dec1178ee2cb989cb625f021e699646a53b3 Mon Sep 17 00:00:00 2001 From: Gaurab Dasgupta Date: Wed, 19 Aug 2020 04:17:59 +0530 Subject: [PATCH] Issue #54(metadata-gen): fix default values --- .../plugins/checkstyle/metadata/CheckstyleMetadata.java | 3 +-- .../plugins/checkstyle/metadata/CheckstyleMetadataTest.java | 5 ----- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/main/java/org/sonar/plugins/checkstyle/metadata/CheckstyleMetadata.java b/src/main/java/org/sonar/plugins/checkstyle/metadata/CheckstyleMetadata.java index 1af8403a..8caab751 100644 --- a/src/main/java/org/sonar/plugins/checkstyle/metadata/CheckstyleMetadata.java +++ b/src/main/java/org/sonar/plugins/checkstyle/metadata/CheckstyleMetadata.java @@ -184,8 +184,7 @@ private List getEnumValues(String enumName) { */ private void constructParams(String checkName, RulesDefinition.NewParam param, ModulePropertyDetails modulePropertyDetails) { - param.setDescription(modulePropertyDetails.getDescription()) - .setDefaultValue(modulePropertyDetails.getDefaultValue()); + param.setDescription(modulePropertyDetails.getDescription()); final String paramType = modulePropertyDetails.getType(); if (modulePropertyDetails.getValidationType() != null && "tokenSet".equals(modulePropertyDetails.getValidationType())) { diff --git a/src/test/java/org/sonar/plugins/checkstyle/metadata/CheckstyleMetadataTest.java b/src/test/java/org/sonar/plugins/checkstyle/metadata/CheckstyleMetadataTest.java index 79cf5583..9deed321 100644 --- a/src/test/java/org/sonar/plugins/checkstyle/metadata/CheckstyleMetadataTest.java +++ b/src/test/java/org/sonar/plugins/checkstyle/metadata/CheckstyleMetadataTest.java @@ -83,9 +83,6 @@ public void testUpdate() { assertEquals("Description doesn't match for param: " + key, modulePropertyDetails.getDescription(), param.description()); - assertEquals("Default value doesn't match for param: " + key, - modulePropertyDetails.getDefaultValue(), - param.defaultValue()); } }); }); @@ -113,8 +110,6 @@ public void testCreate() { final RulesDefinition.Param modParam = modRule.param(paramKey); assertEquals("Description doesn't match for param: " + paramKey, origParam.description(), modParam.description()); - assertEquals("Default value doesn't match for param: " + paramKey, - origParam.defaultValue(), modParam.defaultValue()); assertEquals("Type doesn't match for param: " + paramKey, origParam.type(), modParam.type()); }