Skip to content

Commit

Permalink
Remove the usage of Env.name() using Env.getName()
Browse files Browse the repository at this point in the history
  • Loading branch information
shoothzj authored and nobodyiam committed Mar 28, 2023
1 parent 8344788 commit 66e06ef
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public List<ItemDiffs> 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());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public void testToString() {

@Test
public void name() {
assertEquals("DEV", Env.DEV.name());
assertEquals("DEV", Env.DEV.getName());
}

@Test
Expand Down

0 comments on commit 66e06ef

Please sign in to comment.