Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.TimeZone;
import java.util.UUID;
Expand Down Expand Up @@ -1293,7 +1294,8 @@ protected void addJoins(StringBuilder str, Collection<JoinBuilder<SearchCriteria
fromIndex += onClause.length();
}

str.delete(str.length() - 4, str.length());
int diff = str.toString().trim().toLowerCase(Locale.ROOT).endsWith("where") ? 6 : 4;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Pearl1594 I'd leave out the trim() it is not clear why the 6 or 4 like this (or add a comment, but I prefer the code to explain itself)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, add comment if code is not self-explanatory.

str.delete(str.length() - diff, str.length());

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Pearl1594 is there any unit test to check/cover this, could this cause a regression? Maybe explore a more localised fix that's limited to ssh-key based DaoImpl?


for (JoinBuilder<SearchCriteria<?>> join : joins) {
if (join.getT().getJoins() != null) {
Expand Down