ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/jtreg/util/IdentityHashMap/ToArray.java
(Generate patch)

Comparing jsr166/src/test/jtreg/util/IdentityHashMap/ToArray.java (file contents):
Revision 1.2 by jsr166, Sun Sep 5 21:32:19 2010 UTC vs.
Revision 1.3 by jsr166, Wed Jan 4 04:46:19 2017 UTC

# Line 36 | Line 36 | public class ToArray {
36          // new ArrayList(IdentityHashMap.entrySet())
37          // used to return bogus entries.
38          //----------------------------------------------------------------
39 <        Map<String,String> mm = new IdentityHashMap<String,String>();
39 >        Map<String,String> mm = new IdentityHashMap<>();
40          mm.put("foo", "bar");
41          mm.put("baz", "quux");
42 <        List<Map.Entry<String,String>> lm
43 <            = new ArrayList<Map.Entry<String,String>>(mm.entrySet());
42 >        List<Map.Entry<String,String>> lm = new ArrayList<>(mm.entrySet());
43          String s = lm.toString();
44          if (! (s.equals("[foo=bar, baz=quux]") ||
45                 s.equals("[baz=quux, foo=bar]")))
# Line 65 | Line 64 | public class ToArray {
64          // IdentityHashMap.entrySet().toArray(T[] a) used to simply
65          // return toArray() !
66          //----------------------------------------------------------------
67 <        IdentityHashMap<Integer,Integer> map
69 <            = new IdentityHashMap<Integer,Integer>();
67 >        IdentityHashMap<Integer,Integer> map = new IdentityHashMap<>();
68          Set<Map.Entry<Integer,Integer>> es = map.entrySet();
69          if (es.toArray().length != 0)
70              throw new Error("non-empty");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines