WriteConcern equals uses == instead of equals() for _w object and no hashcode() impl

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Minor - P4
    • 2.8.0
    • Affects Version/s: 2.7
    • Component/s: API
    • None
    • Environment:
      Windows 7
    • None
    • Minor Change
    • None
    • None
    • None
    • None
    • None
    • None

      This test will fail since WriteConcern's equals methods uses == and not equals() for the _w field. I noticed this when testing the new API to pass a string into the WriteConcern constructor. Here is a failing test case

      	public void testWriteConcernEquality() {
      		String s1 =  new String("rack1");
      		String s2 =  new String("rack1");
      		WriteConcern wc1 = new WriteConcern(s1);
      		WriteConcern wc2 = new WriteConcern(s2);
      		assertThat(wc1, equalTo(wc2));
      	}
      	
      

            Assignee:
            Jeffrey Yemin
            Reporter:
            Mark Pollack
            None
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: