Skip to content

Commit

Permalink
checkstyle...
Browse files Browse the repository at this point in the history
  • Loading branch information
snazy committed Sep 6, 2024
1 parent bfc895b commit 5a475ad
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,25 +36,25 @@ public <S extends Secret> Optional<S> getSecret(
"urn".equals(scheme) && next != null,
"Invalid secret URI, must be in the form 'urn:nessie-secret:<provider>:<secret-name>'");

int iNessieSecret = next.indexOf(':');
int idxNessieSecret = next.indexOf(':');
checkArgument(
iNessieSecret > 0 && iNessieSecret != next.length() - 1,
idxNessieSecret > 0 && idxNessieSecret != next.length() - 1,
"Invalid secret URI, must be in the form 'urn:nessie-secret:<provider>:<secret-name>'");
scheme = next.substring(0, iNessieSecret);
scheme = next.substring(0, idxNessieSecret);
checkArgument(
"nessie-secret".equals(scheme),
"Invalid secret URI, must be in the form 'urn:nessie-secret:<provider>:<secret-name>'");

int iProvider = next.indexOf(':', iNessieSecret + 1);
int idxProvider = next.indexOf(':', idxNessieSecret + 1);
checkArgument(
iProvider > 0 && iProvider != next.length() - 1,
idxProvider > 0 && idxProvider != next.length() - 1,
"Invalid secret URI, must be in the form 'urn:nessie-secret:<provider>:<secret-name>'");
String provider = next.substring(iNessieSecret + 1, iProvider);
String provider = next.substring(idxNessieSecret + 1, idxProvider);
checkArgument(
!provider.isBlank(),
"Invalid secret URI, must be in the form 'urn:nessie-secret:<provider>:<secret-name>'");

next = next.substring(iProvider + 1);
next = next.substring(idxProvider + 1);
checkArgument(
!next.isBlank() && next.charAt(0) != ':',
"Invalid secret URI, must be in the form 'urn:nessie-secret:<provider>:<secret-name>'");
Expand Down

0 comments on commit 5a475ad

Please sign in to comment.