michael-o commented on a change in pull request #428: URL: https://github.com/apache/tomcat/pull/428#discussion_r655175314
########## File path: java/org/apache/catalina/realm/DataSourceRealm.java ########## @@ -572,6 +801,21 @@ protected void startInternal() throws LifecycleException { temp.append(" = ?"); preparedCredentials = temp.toString(); + // Create the user attributes PreparedStatement string (only its tail w/o SELECT + // clause) + temp = new StringBuilder(" FROM "); + temp.append(userTable); + temp.append(" WHERE "); + temp.append(userNameCol); + temp.append(" = ?"); + preparedAttributesTail = temp.toString(); + + // Create the available user attributes PreparedStatement string + temp = new StringBuilder("SELECT * FROM "); + temp.append(userTable); + temp.append(" WHERE FALSE"); Review comment: BTW, such a "static" string builder gives you zero benefit compared over `+=`. You can also use `+=` and the compliler will transform to string builder automatically. String builders make sense when you have dynamic data like loops. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org