Skip to content

Commit

Permalink
removed second parameter from OAuthRealm constructor. Changed `this…
Browse files Browse the repository at this point in the history
…::newOAuthRealm` to `OAuthRealm::new` and removed `newOAuthRealm` method.
  • Loading branch information
dknoma committed Jun 10, 2019
1 parent eb07cf9 commit 5a18aaf
Showing 1 changed file with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public long resolve(
long authorization = NO_AUTHORIZATION;
if(nextRealmBit < MAX_REALMS)
{
final OAuthRealm realm = realmsIdsByName.computeIfAbsent(realmName, this::newOAuthRealm);
final OAuthRealm realm = realmsIdsByName.computeIfAbsent(realmName, OAuthRealm::new);
authorization = realm.resolve(scopeNames);
}
return authorization;
Expand Down Expand Up @@ -129,13 +129,6 @@ public JsonWebKey supplyKey(
return keysByKid.get(kid);
}

private OAuthRealm newOAuthRealm(
String realmName)
{
assert nextRealmBit < MAX_REALMS;
return new OAuthRealm(realmName, nextRealmBit++);
}

private static Map<String, JsonWebKey> parseKeyMap(
Path keyFile)
{
Expand Down Expand Up @@ -208,11 +201,11 @@ private final class OAuthRealm
private long nextScopeBit;

private OAuthRealm(
String realmName,
long realmBitShift)
String realmName)
{
assert nextRealmBit < MAX_REALMS;
this.realmName = realmName;
this.realmId = 1L << realmBitShift << MAX_SCOPES;
this.realmId = 1L << nextRealmBit++ << MAX_SCOPES;
}

private long resolve(
Expand Down

0 comments on commit 5a18aaf

Please sign in to comment.