From 01ef924c47b4d905441e05045cbd8e4f492e5322 Mon Sep 17 00:00:00 2001 From: jan-vcapgemini Date: Mon, 3 Apr 2023 16:42:06 +0200 Subject: [PATCH] implemented requested changes changed default of vaidate allowMonolothicConfiguration to false changed TemplateSetConfigurationReader validate to non monolithic removed catch of NotYetSupportedException from ContextConfigurationReader validate process --- .../impl/config/reader/ContextConfigurationReader.java | 7 +------ .../impl/config/reader/TemplateSetConfigurationReader.java | 2 +- .../cobigen/impl/config/versioning/VersionValidator.java | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/cobigen/cobigen-core/src/main/java/com/devonfw/cobigen/impl/config/reader/ContextConfigurationReader.java b/cobigen/cobigen-core/src/main/java/com/devonfw/cobigen/impl/config/reader/ContextConfigurationReader.java index a192838dea..60b51f9321 100644 --- a/cobigen/cobigen-core/src/main/java/com/devonfw/cobigen/impl/config/reader/ContextConfigurationReader.java +++ b/cobigen/cobigen-core/src/main/java/com/devonfw/cobigen/impl/config/reader/ContextConfigurationReader.java @@ -26,7 +26,6 @@ import com.devonfw.cobigen.api.constants.ConfigurationConstants; import com.devonfw.cobigen.api.exception.ConfigurationConflictException; import com.devonfw.cobigen.api.exception.InvalidConfigurationException; -import com.devonfw.cobigen.api.exception.NotYetSupportedException; import com.devonfw.cobigen.api.util.ExceptionUtil; import com.devonfw.cobigen.api.util.JvmUtil; import com.devonfw.cobigen.impl.config.constant.ContextConfigurationVersion; @@ -216,11 +215,7 @@ private void readConfiguration() { "The required 'version' attribute of node \"contextConfiguration\" has not been set"); } else { VersionValidator validator = new VersionValidator(Type.CONTEXT_CONFIGURATION, MavenMetadata.VERSION); - try { - validator.validate(configVersion.floatValue()); - } catch (NotYetSupportedException e) { - // TODO - } + validator.validate(configVersion.floatValue()); } } else { throw new InvalidConfigurationException(contextFile, diff --git a/cobigen/cobigen-core/src/main/java/com/devonfw/cobigen/impl/config/reader/TemplateSetConfigurationReader.java b/cobigen/cobigen-core/src/main/java/com/devonfw/cobigen/impl/config/reader/TemplateSetConfigurationReader.java index 17e30168dd..529ada64e4 100644 --- a/cobigen/cobigen-core/src/main/java/com/devonfw/cobigen/impl/config/reader/TemplateSetConfigurationReader.java +++ b/cobigen/cobigen-core/src/main/java/com/devonfw/cobigen/impl/config/reader/TemplateSetConfigurationReader.java @@ -203,7 +203,7 @@ public void readConfiguration(Path templateSetFile) { "The required 'version' attribute of node \"templateSetConfiguration\" has not been set"); } else { VersionValidator validator = new VersionValidator(Type.TEMPLATE_SET_CONFIGURATION, MavenMetadata.VERSION); - validator.validate(configVersion.floatValue()); + validator.validate(configVersion.floatValue(), false); } } else { throw new InvalidConfigurationException(this.templateSetFile, diff --git a/cobigen/cobigen-core/src/main/java/com/devonfw/cobigen/impl/config/versioning/VersionValidator.java b/cobigen/cobigen-core/src/main/java/com/devonfw/cobigen/impl/config/versioning/VersionValidator.java index c478016f02..cb87a2a57f 100644 --- a/cobigen/cobigen-core/src/main/java/com/devonfw/cobigen/impl/config/versioning/VersionValidator.java +++ b/cobigen/cobigen-core/src/main/java/com/devonfw/cobigen/impl/config/versioning/VersionValidator.java @@ -78,7 +78,7 @@ public VersionValidator(Type validatorType, String cobiGenVersion) { */ public void validate(float configVersion) { - validate(configVersion, true); + validate(configVersion, false); } /**