Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-2452

Bug in CaseInsensitiveMap

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 5.4, 5.3.8
    • 5.4
    • tapestry-ioc
    • None

    Description

      /**
       *
       * @author AlexLumpov
       */
      public class CaseInsensitiveMapTest extends Assert {
      
      	@Test
      	public void testRetainAllKeys() {
      
      		Map<String, String> map = new CaseInsensitiveMap<String>();
      		map.put("1", "1");
      		map.put("2", "2");
      		map.put("3", "3");
      
      		Collection<String> keysToRetain = Arrays.asList("3", "4", "5");
      		HashSet<String> expected = new HashSet<String>(Arrays.asList("3"));
      
      		boolean modified = map.keySet().retainAll(keysToRetain);
      
      		assertEquals(true, modified);
      		assertEquals(expected, map.keySet());
      	}
      }
      

      Result:

      java.lang.AssertionError: expected:<[3]> but was:<[2, 3]>
      

      Attachments

        1. mycaseinsetivemap.zip
          6 kB
          Alex Lumpov

        Activity

          People

            Unassigned Unassigned
             alexlumpov Alex Lumpov
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: