diff --git a/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/component/config/PortalConfig.java b/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/component/config/PortalConfig.java index 9011dbffe5f..a6a4ab82358 100644 --- a/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/component/config/PortalConfig.java +++ b/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/component/config/PortalConfig.java @@ -180,7 +180,7 @@ public String portalAddress() { } public boolean isEmergencyPublishAllowed(Env env) { - String targetEnv = env.name(); + String targetEnv = env.getName(); String[] emergencyPublishSupportedEnvs = getArrayProperty("emergencyPublish.supported.envs", new String[0]); diff --git a/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/ItemController.java b/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/ItemController.java index cea43470be3..73ab100e355 100644 --- a/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/ItemController.java +++ b/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/ItemController.java @@ -183,7 +183,7 @@ public List diff(@RequestBody NamespaceSyncModel model) { } if (permissionValidator - .shouldHideConfigToCurrentUser(namespace.getAppId(), namespace.getEnv().name(), namespace.getNamespaceName())) { + .shouldHideConfigToCurrentUser(namespace.getAppId(), namespace.getEnv().getName(), namespace.getNamespaceName())) { diff.setDiffs(new ItemChangeSets()); diff.setExtInfo("You are not this project's administrator, nor you have edit or release permission for the namespace in environment: " + namespace.getEnv()); } diff --git a/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/environment/Env.java b/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/environment/Env.java index 977c5fd460f..4b9c5707b7b 100644 --- a/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/environment/Env.java +++ b/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/environment/Env.java @@ -227,16 +227,6 @@ public String toString() { return name; } - /** - * Backward compatibility with enum's name method - * - * @Deprecated please use {@link #getName()} instead of - */ - @Deprecated - public String name() { - return name; - } - public String getName() { return name; } diff --git a/apollo-portal/src/test/java/com/ctrip/framework/apollo/portal/environment/EnvTest.java b/apollo-portal/src/test/java/com/ctrip/framework/apollo/portal/environment/EnvTest.java index e95778d438a..bf672a61926 100644 --- a/apollo-portal/src/test/java/com/ctrip/framework/apollo/portal/environment/EnvTest.java +++ b/apollo-portal/src/test/java/com/ctrip/framework/apollo/portal/environment/EnvTest.java @@ -91,7 +91,7 @@ public void testToString() { @Test public void name() { - assertEquals("DEV", Env.DEV.name()); + assertEquals("DEV", Env.DEV.getName()); } @Test