Skip to content

Commit

Permalink
Replaced additional occurrences using String.format and {}
Browse files Browse the repository at this point in the history
Signed-off-by: Arjan Tijms <arjan.tijms@omnifish.ee>
  • Loading branch information
arjantijms committed Oct 12, 2023
1 parent 0b59903 commit 548286d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Expand Up @@ -146,26 +146,26 @@ public synchronized void init(Properties props) throws BadRealmException, NoSuch
getDefaultHabitat().getBestDescriptor(BuilderHelper.createContractFilter(ConnectorRuntime.class.getName()));

if (jaasCtx == null) {
throw new BadRealmException(String.format(MISSING_PROPERTY, JAAS_CONTEXT_PARAM, "JDBCRealm"));
throw new BadRealmException(MessageFormat.format(MISSING_PROPERTY, JAAS_CONTEXT_PARAM, "JDBCRealm"));
}

if (dsJndi == null) {
throw new BadRealmException(String.format(MISSING_PROPERTY, PARAM_DATASOURCE_JNDI, "JDBCRealm"));
throw new BadRealmException(MessageFormat.format(MISSING_PROPERTY, PARAM_DATASOURCE_JNDI, "JDBCRealm"));
}
if (userTable == null) {
throw new BadRealmException(String.format(MISSING_PROPERTY, PARAM_USER_TABLE, "JDBCRealm"));
throw new BadRealmException(MessageFormat.format(MISSING_PROPERTY, PARAM_USER_TABLE, "JDBCRealm"));
}
if (groupTable == null) {
throw new BadRealmException(String.format(MISSING_PROPERTY, PARAM_GROUP_TABLE, "JDBCRealm"));
throw new BadRealmException(MessageFormat.format(MISSING_PROPERTY, PARAM_GROUP_TABLE, "JDBCRealm"));
}
if (userNameColumn == null) {
throw new BadRealmException(String.format(MISSING_PROPERTY, PARAM_USER_NAME_COLUMN, "JDBCRealm"));
throw new BadRealmException(MessageFormat.format(MISSING_PROPERTY, PARAM_USER_NAME_COLUMN, "JDBCRealm"));
}
if (passwordColumn == null) {
throw new BadRealmException(String.format(MISSING_PROPERTY, PARAM_PASSWORD_COLUMN, "JDBCRealm"));
throw new BadRealmException(MessageFormat.format(MISSING_PROPERTY, PARAM_PASSWORD_COLUMN, "JDBCRealm"));
}
if (groupNameColumn == null) {
throw new BadRealmException(String.format(MISSING_PROPERTY, PARAM_GROUP_NAME_COLUMN, "JDBCRealm"));
throw new BadRealmException(MessageFormat.format(MISSING_PROPERTY, PARAM_GROUP_NAME_COLUMN, "JDBCRealm"));
}

passwordQuery = "SELECT " + passwordColumn + " FROM " + userTable + " WHERE " + userNameColumn + " = ?";
Expand Down
Expand Up @@ -190,7 +190,7 @@ public synchronized void init(Properties props) throws BadRealmException, NoSuch
String jaasCtx = props.getProperty(JAAS_CONTEXT_PARAM);

if (isAnyNull(url, dn, jaasCtx)) {
throw new BadRealmException(String.format(
throw new BadRealmException(MessageFormat.format(
"Incomplete configuration of ldap realm: url: {0} baseDN: {1} login module: {2}", url, dn, jaasCtx));
}

Expand Down

0 comments on commit 548286d

Please sign in to comment.