Skip to content

Commit 3ef13f8

Browse files
ZhangJian Henobodyiam
authored andcommitted
Remove the usage of Env.name() using Env.getName()
1 parent 8344788 commit 3ef13f8

File tree

4 files changed

+3
-13
lines changed

4 files changed

+3
-13
lines changed

apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/component/config/PortalConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ public String portalAddress() {
180180
}
181181

182182
public boolean isEmergencyPublishAllowed(Env env) {
183-
String targetEnv = env.name();
183+
String targetEnv = env.getName();
184184

185185
String[] emergencyPublishSupportedEnvs = getArrayProperty("emergencyPublish.supported.envs", new String[0]);
186186

apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/ItemController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ public List<ItemDiffs> diff(@RequestBody NamespaceSyncModel model) {
183183
}
184184

185185
if (permissionValidator
186-
.shouldHideConfigToCurrentUser(namespace.getAppId(), namespace.getEnv().name(), namespace.getNamespaceName())) {
186+
.shouldHideConfigToCurrentUser(namespace.getAppId(), namespace.getEnv().getName(), namespace.getNamespaceName())) {
187187
diff.setDiffs(new ItemChangeSets());
188188
diff.setExtInfo("You are not this project's administrator, nor you have edit or release permission for the namespace in environment: " + namespace.getEnv());
189189
}

apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/environment/Env.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -227,16 +227,6 @@ public String toString() {
227227
return name;
228228
}
229229

230-
/**
231-
* Backward compatibility with enum's name method
232-
*
233-
* @Deprecated please use {@link #getName()} instead of
234-
*/
235-
@Deprecated
236-
public String name() {
237-
return name;
238-
}
239-
240230
public String getName() {
241231
return name;
242232
}

apollo-portal/src/test/java/com/ctrip/framework/apollo/portal/environment/EnvTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public void testToString() {
9191

9292
@Test
9393
public void name() {
94-
assertEquals("DEV", Env.DEV.name());
94+
assertEquals("DEV", Env.DEV.getName());
9595
}
9696

9797
@Test

0 commit comments

Comments
 (0)