Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Commit

Permalink
inline string constant
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Norberg committed May 10, 2017
1 parent aa1ba6d commit 2fc3f22
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions styx-common/src/main/java/com/spotify/styx/util/GcpUtil.java
Expand Up @@ -26,8 +26,6 @@

public class GcpUtil {

public static final String PERMISSION_DENIED = "PERMISSION_DENIED";

public static boolean isPermissionDenied(GoogleJsonResponseException e) {
return e.getStatusCode() == 403 && Optional.ofNullable(e.getDetails())
.map(GcpUtil::isPermissionDenied)
Expand All @@ -36,7 +34,7 @@ public static boolean isPermissionDenied(GoogleJsonResponseException e) {

public static boolean isPermissionDenied(GoogleJsonError error) {
return Optional.ofNullable(error.get("status"))
.map(PERMISSION_DENIED::equals)
.map("PERMISSION_DENIED"::equals)
.orElse(false);
}
}

0 comments on commit 2fc3f22

Please sign in to comment.