Announcement Announcement Module
Collapse
No announcement yet.
Bug in Query.class Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bug in Query.class

    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?

  • #2
    Yes, you might wanna file a ticket against the 1.2.x branch. Note, that this is actually already resolved in the 1.3.0 snapshots as we removed the deprecated methods in there.

    Comment

    Working...
    X