Uploaded image for project: 'Nutch'
  1. Nutch
  2. NUTCH-263

MapWritable.equals() doesn't work properly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.8
    • None
    • None
    • None

    Description

      MapWritable.equals() is sensitive to the order in which map entries have been created. E.g. this fails but it should succeed:

      MapWritable map1 = new MapWritable();
      MapWritable map2 = new MapWritable();
      map1.put(new UTF8("key1"), new UTF8("val1"));
      map1.put(new UTF8("key2"), new UTF8("val2"));
      map2.put(new UTF8("key2"), new UTF8("val2"));
      map2.put(new UTF8("key1"), new UTF8("val1"));
      assertTrue(map1.equals(map2));

      Users expect that this should not be the case, i.e. this class should follow the same rules as Map.equals() ("Returns true if the given object is also a map and the two Maps represent the same mappings").

      Attachments

        1. patch1.txt
          2 kB
          Andrzej Bialecki

        Activity

          People

            Unassigned Unassigned
            ab Andrzej Bialecki
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: