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

Comparing jsr166/src/test/jtreg/util/PriorityQueue/NoNulls.java (file contents):
Revision 1.1 by jsr166, Sun May 9 07:41:12 2010 UTC vs.
Revision 1.4 by jsr166, Mon May 30 17:56:20 2011 UTC

# Line 1 | Line 1
1   /*
2   * Written by Martin Buchholz with assistance from members of JCP JSR-166
3   * Expert Group and released to the public domain, as explained at
4 < * http://creativecommons.org/licenses/publicdomain
4 > * http://creativecommons.org/publicdomain/zero/1.0/
5   */
6  
7   /*
# Line 26 | Line 26 | import java.util.concurrent.PriorityBloc
26   public class NoNulls {
27      void test(String[] args) throws Throwable {
28          final Comparator<String> nullTolerantComparator
29 <            = new Comparator<>() {
29 >            = new Comparator<String>() {
30              public int compare(String x, String y) {
31                  return (x == null ? -1 :
32                          y == null ? 1 :
# Line 34 | Line 34 | public class NoNulls {
34              }};
35  
36          final SortedSet<String> nullSortedSet
37 <            = new TreeSet<>(nullTolerantComparator);
37 >            = new TreeSet<String>(nullTolerantComparator);
38          nullSortedSet.add(null);
39  
40          final PriorityQueue<String> nullPriorityQueue
41 <            = new PriorityQueue<>() {
41 >            = new PriorityQueue<String>() {
42              public Object[] toArray() { return new Object[] { null };}};
43  
44 <        final Collection<String> nullCollection = new ArrayList<>();
44 >        final Collection<String> nullCollection = new ArrayList<String>();
45          nullCollection.add(null);
46  
47          THROWS(NullPointerException.class,

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines