From f010daac188f322ec375427dd386dcd9be51646a Mon Sep 17 00:00:00 2001 From: Gabriele Cardosi Date: Thu, 18 Jul 2024 11:37:15 +0200 Subject: [PATCH] [incubator-kie-issues#1373] Define removeApplicationProperty (#6008) Co-authored-by: Gabriele-Cardosi --- .../common/DroolsModelApplicationPropertyProvider.java | 7 +++++++ .../org/drools/codegen/common/DroolsModelBuildContext.java | 2 ++ .../common/context/AbstractDroolsModelBuildContext.java | 5 +++++ 3 files changed, 14 insertions(+) diff --git a/drools-model/drools-codegen-common/src/main/java/org/drools/codegen/common/DroolsModelApplicationPropertyProvider.java b/drools-model/drools-codegen-common/src/main/java/org/drools/codegen/common/DroolsModelApplicationPropertyProvider.java index dfc6e8893b5..9b079f2634b 100644 --- a/drools-model/drools-codegen-common/src/main/java/org/drools/codegen/common/DroolsModelApplicationPropertyProvider.java +++ b/drools-model/drools-codegen-common/src/main/java/org/drools/codegen/common/DroolsModelApplicationPropertyProvider.java @@ -40,6 +40,11 @@ public Collection getApplicationProperties() { public void setApplicationProperty(String key, String value) { properties.put(key, value); } + + @Override + public void removeApplicationProperty(String key) { + properties.remove(key); + } }; } @@ -48,4 +53,6 @@ public void setApplicationProperty(String key, String value) { Collection getApplicationProperties(); void setApplicationProperty(String key, String value); + + void removeApplicationProperty(String key); } diff --git a/drools-model/drools-codegen-common/src/main/java/org/drools/codegen/common/DroolsModelBuildContext.java b/drools-model/drools-codegen-common/src/main/java/org/drools/codegen/common/DroolsModelBuildContext.java index a5194eca9ca..f7537ca464a 100644 --- a/drools-model/drools-codegen-common/src/main/java/org/drools/codegen/common/DroolsModelBuildContext.java +++ b/drools-model/drools-codegen-common/src/main/java/org/drools/codegen/common/DroolsModelBuildContext.java @@ -40,6 +40,8 @@ public interface DroolsModelBuildContext { void setApplicationProperty(String key, String value); + void removeApplicationProperty(String key); + String getPackageName(); ClassLoader getClassLoader(); diff --git a/drools-model/drools-codegen-common/src/main/java/org/drools/codegen/common/context/AbstractDroolsModelBuildContext.java b/drools-model/drools-codegen-common/src/main/java/org/drools/codegen/common/context/AbstractDroolsModelBuildContext.java index 584430d4095..c38f2391973 100644 --- a/drools-model/drools-codegen-common/src/main/java/org/drools/codegen/common/context/AbstractDroolsModelBuildContext.java +++ b/drools-model/drools-codegen-common/src/main/java/org/drools/codegen/common/context/AbstractDroolsModelBuildContext.java @@ -105,6 +105,11 @@ public void setApplicationProperty(String key, String value) { applicationProperties.setApplicationProperty(key, value); } + @Override + public void removeApplicationProperty(String key) { + applicationProperties.removeApplicationProperty(key); + } + @Override public String getPackageName() { return packageName;