[jOOQ/jOOQ#10635] AbstractQueryPart::equals might not work when one QueryPart has a different Configuration than the other
This commit is contained in:
parent
df5f0cdd14
commit
07c0b55561
@ -156,17 +156,19 @@ abstract class AbstractQueryPart implements QueryPartInternal {
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (this == that) {
|
||||
if (this == that)
|
||||
return true;
|
||||
}
|
||||
|
||||
// This is a working default implementation. It should be overridden by
|
||||
// concrete subclasses, to improve performance
|
||||
if (that instanceof QueryPart) {
|
||||
DSLContext dsl = configuration().dsl();
|
||||
|
||||
String sql1 = dsl.renderInlined(this);
|
||||
String sql2 = dsl.renderInlined((QueryPart) that);
|
||||
// [#10635] The two QueryParts may have different Settings attached.
|
||||
DSLContext dsl1 = configuration().dsl();
|
||||
DSLContext dsl2 = that instanceof AbstractQueryPart ? ((AbstractQueryPart) that).configuration().dsl() : dsl1;
|
||||
|
||||
String sql1 = dsl1.renderInlined(this);
|
||||
String sql2 = dsl2.renderInlined((QueryPart) that);
|
||||
|
||||
return sql1.equals(sql2);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user