Skip to content

Commit

Permalink
Renamed substring constants. (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
OGKevin committed Dec 21, 2017
1 parent 0d91203 commit cbf66ac
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/com/bunq/sdk/security/SecurityUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ public final class SecurityUtils {
/**
* Substring constants.
*/
private static final int SUBSTRING_BEGIN_INDEX = 0;
private static final int SUBSTRING_END_INDEX = 1;
private static final int SUBSTRING_BEGIN_INDEX_FIRST_CHAR = 0;
private static final int SUBSTRING_END_INDEX_LAST_CHAR = 1;

/**
*/
Expand Down Expand Up @@ -523,8 +523,8 @@ private static byte[] getResponseBytes(int responseCode, byte[] responseBodyByte

private static String getHeaderNameCorrectlyCased(String headerName) {
headerName = headerName.toLowerCase();
headerName = headerName.substring(SUBSTRING_BEGIN_INDEX, SUBSTRING_END_INDEX).toUpperCase()
+ headerName.substring(SUBSTRING_END_INDEX);
headerName = headerName.substring(SUBSTRING_BEGIN_INDEX_FIRST_CHAR, SUBSTRING_END_INDEX_LAST_CHAR).toUpperCase()
+ headerName.substring(SUBSTRING_END_INDEX_LAST_CHAR);
Pattern pattern = Pattern.compile(REGEX_FOR_LOWERCASE_HEADERS);
Matcher matcher = pattern.matcher(headerName);

Expand Down

0 comments on commit cbf66ac

Please sign in to comment.