Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-4605

SortedMap is not returned when another unrelated method exists in the interface

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.7
    • 2.7.1
    • Aegis Databinding
    • None
    • Debian unstable / tomcat7 / opennjdk7

    • Unknown

    Description

      During testing of bug 4534 I stumbled upon the following behavior. Subsets of tests were passing when run standalone but failing when run in the full test suite.

      So I have narrowed it down to one method that fails when another is uncommented in the interface.

      Interface:
      // uncomment this for the next method to fail
      // public Map<String, Map<Integer, Integer>> testDirectComplexMapResult();

      // fail – puts data into a hashmap instead of a SortedMap if the above is uncommented
      public Map<String, SortedMap<Integer, Integer>> testDirectComplexTreeMapResult();

      Implementation:
      //@Override
      public Map<String, Map<Integer, Integer>> testDirectComplexMapResult()

      { final Map<String, Map<Integer, Integer>> result = new HashMap<String, Map<Integer, Integer>>(); final TreeMap<Integer, Integer> map1 = new TreeMap<Integer, Integer>(); map1.put(1, 3); result.put("key1", map1); return result; }

      @Override
      public Map<String, SortedMap<Integer, Integer>> testDirectComplexTreeMapResult()

      { final Map<String, SortedMap<Integer, Integer>> result = new HashMap<String, SortedMap<Integer, Integer>>(); final TreeMap<Integer, Integer> map1 = new TreeMap<Integer, Integer>(); map1.put(1, 3); map1.put(0, 2); result.put("key1", map1); return result; }

      Client:
      @Test
      public void testDirectComplexTreeMapResult() {
      final Map map = TestServiceFactory.getService()
      .testDirectComplexTreeMapResult();
      log.info(map);
      for (final Object vmap : map.values())

      { Assert.assertTrue(vmap instanceof SortedMap); }

      }

      Attachments

        1. ws-test-issue-4605.tgz
          9 kB
          Vassilis Virvilis
        2. ws-test-issue-4605.tgz
          9 kB
          Vassilis Virvilis

        Activity

          People

            dkulp Daniel Kulp
            vasvir Vassilis Virvilis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: