From 152aa35e6f2bc70826976f3a7d7ae1976bef40d6 Mon Sep 17 00:00:00 2001 From: Haotian Zhang <928016560@qq.com> Date: Mon, 13 May 2024 22:32:14 +0800 Subject: [PATCH] feat:add zero protection. --- .../config/PolarisContractProperties.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/spring-cloud-starter-tencent-polaris-contract/src/main/java/com/tencent/cloud/polaris/contract/config/PolarisContractProperties.java b/spring-cloud-starter-tencent-polaris-contract/src/main/java/com/tencent/cloud/polaris/contract/config/PolarisContractProperties.java index 2be391352..0fdc0a1d4 100644 --- a/spring-cloud-starter-tencent-polaris-contract/src/main/java/com/tencent/cloud/polaris/contract/config/PolarisContractProperties.java +++ b/spring-cloud-starter-tencent-polaris-contract/src/main/java/com/tencent/cloud/polaris/contract/config/PolarisContractProperties.java @@ -73,6 +73,9 @@ public boolean isEnabled() { @Override public void setEnabled(boolean enabled) { + if (Objects.nonNull(extendContractProperties)) { + extendContractProperties.setEnabled(enabled); + } this.enabled = enabled; } @@ -86,6 +89,9 @@ public String getBasePackage() { @Override public void setBasePackage(String basePackage) { + if (Objects.nonNull(extendContractProperties)) { + extendContractProperties.setBasePackage(basePackage); + } this.basePackage = basePackage; } @@ -99,6 +105,9 @@ public String getExcludePath() { @Override public void setExcludePath(String excludePath) { + if (Objects.nonNull(extendContractProperties)) { + extendContractProperties.setExcludePath(excludePath); + } this.excludePath = excludePath; } @@ -112,6 +121,9 @@ public String getGroup() { @Override public void setGroup(String group) { + if (Objects.nonNull(extendContractProperties)) { + extendContractProperties.setGroup(group); + } this.group = group; } @@ -125,6 +137,9 @@ public String getBasePath() { @Override public void setBasePath(String basePath) { + if (Objects.nonNull(extendContractProperties)) { + extendContractProperties.setBasePath(basePath); + } this.basePath = basePath; } @@ -138,6 +153,9 @@ public boolean isExposure() { @Override public void setExposure(boolean exposure) { + if (Objects.nonNull(extendContractProperties)) { + extendContractProperties.setExposure(exposure); + } this.exposure = exposure; } @@ -151,6 +169,9 @@ public boolean isReportEnabled() { @Override public void setReportEnabled(boolean reportEnabled) { + if (Objects.nonNull(extendContractProperties)) { + extendContractProperties.setReportEnabled(reportEnabled); + } this.reportEnabled = reportEnabled; } @@ -163,6 +184,9 @@ public String getName() { @Override public void setName(String name) { + if (Objects.nonNull(extendContractProperties)) { + extendContractProperties.setName(name); + } this.name = name; } }