Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
KuechA committed Oct 24, 2024
1 parent 761c244 commit b70c63b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import org.neo4j.ogm.annotation.Relationship
*
* Some languages provide a way to have multiple variables, iterables and predicates. For this
* reason, we represent the `variable, iterable and predicate in its own class
* [CollectionComprehension.ComprehensionExpression].
* [ComprehensionExpression].
*/
class CollectionComprehension : Expression(), ArgumentHolder {

Expand Down Expand Up @@ -82,7 +82,7 @@ class CollectionComprehension : Expression(), ArgumentHolder {
override fun hashCode() = Objects.hash(super.hashCode(), statement, comprehensionExpressions)

override fun addArgument(expression: Expression) {
if (this.statement == null) {
if (this.statement == null || this.statement is ProblemExpression) {
this.statement = expression
} else if (expression is ComprehensionExpression) {
this.comprehensionExpressions += expression
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ class ComprehensionExpression : Expression(), ArgumentHolder {
override fun hashCode() = Objects.hash(super.hashCode(), variable, iterable, predicate)

override fun addArgument(expression: Expression) {
if (this.variable == null) {
if (this.variable is ProblemExpression) {
this.variable = expression
} else if (this.iterable == null) {
} else if (this.iterable is ProblemExpression) {
this.iterable = expression
} else {
this.predicate = expression
Expand Down

0 comments on commit b70c63b

Please sign in to comment.