Quantcast
Channel: Spring Community Forums - NoSQL
Viewing all articles
Browse latest Browse all 128

Bug in Query.class

$
0
0
Hi,

that could be a Bug:

org.springframework.data.mongodb.core.query.Query has this equals() method:

Code:

        @Override
        public boolean equals(Object obj) {

                if (this == obj) {
                        return true;
                }

                if (obj == null || !getClass().equals(obj.getClass())) {
                        return false;
                }

                Query that = (Query) obj;

                boolean criteriaEqual = this.criteria.equals(that.criteria);
                boolean fieldsEqual = this.fieldSpec == null ? that.fieldSpec == null : this.fieldSpec.equals(that.fieldSpec);
                boolean sortEqual = this.sort == null ? that.sort == null : this.sort.equals(that.sort);
                boolean hintEqual = this.hint == null ? that.hint == null : this.hint.equals(that.hint);
                boolean skipEqual = this.skip == that.skip;
                boolean limitEqual = this.limit == that.limit;

                return criteriaEqual && fieldsEqual && sortEqual && hintEqual && skipEqual && limitEqual;
        }

This class was introduced a new private variable coreSort after sort has been deprecated:
Code:

        private Sort coreSort;
        @SuppressWarnings("deprecation")
        private org.springframework.data.mongodb.core.query.Sort sort;

Now coreSort is missing in the equals method.
Is it a bug?

Viewing all articles
Browse latest Browse all 128

Trending Articles