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

Comparing jsr166/src/test/jtreg/util/TreeMap/HeadTailTypeError.java (file contents):
Revision 1.2 by jsr166, Sun Sep 5 21:32:20 2010 UTC vs.
Revision 1.3 by jsr166, Sat Oct 16 16:00:28 2010 UTC

# Line 32 | Line 32 | import java.util.*;
32  
33   public class HeadTailTypeError {
34      public static void main(String argv[]) throws Exception {
35 <        try{
35 >        try {
36              SortedMap m = new TreeMap();
37              m.headMap(new Object());
38              throw new Exception("headMap, natural ordering");
39          } catch (ClassCastException e) {
40          }
41  
42 <        try{
42 >        try {
43              SortedMap m = new TreeMap();
44              m.tailMap(new Object());
45              throw new Exception("tailMap, natural ordering");
# Line 47 | Line 47 | public class HeadTailTypeError {
47          }
48  
49  
50 <        try{
50 >        try {
51              SortedMap m = new TreeMap(String.CASE_INSENSITIVE_ORDER);
52              m.headMap(new Integer(0));
53              throw new Exception("headMap, explicit comparator");
54          } catch (ClassCastException e) {
55          }
56  
57 <        try{
57 >        try {
58              SortedMap m = new TreeMap(String.CASE_INSENSITIVE_ORDER);
59              m.tailMap(new Integer(0));
60              throw new Exception("tailMap, explicit comparator");
61          } catch (ClassCastException e) {
62          }
63  
64 <        try{
64 >        try {
65              SortedSet m = new TreeSet();
66              m.headSet(new Object());
67              throw new Exception("headSet, natural ordering");
68          } catch (ClassCastException e) {
69          }
70  
71 <        try{
71 >        try {
72              SortedSet m = new TreeSet();
73              m.tailSet(new Object());
74              throw new Exception("tailSet, natural ordering");
75          } catch (ClassCastException e) {
76          }
77  
78 <        try{
78 >        try {
79              SortedSet m = new TreeSet(String.CASE_INSENSITIVE_ORDER);
80              m.headSet(new Integer(0));
81              throw new Exception("headSet, explicit comparator");
82          } catch (ClassCastException e) {
83          }
84  
85 <        try{
85 >        try {
86              SortedSet m = new TreeSet(String.CASE_INSENSITIVE_ORDER);
87              m.tailSet(new Integer(0));
88              throw new Exception("tailSet, explicit comparator");
89          } catch (ClassCastException e) {
90          }
91  
92 <        try{
92 >        try {
93              SortedMap m = new TreeMap();
94              m.headMap(null);
95              throw new Exception("(null endpoint)headMap, natural ordering");
96          } catch (NullPointerException e) {
97          }
98  
99 <        try{
99 >        try {
100              SortedMap m = new TreeMap();
101              m.tailMap(null);
102              throw new Exception("(null endpoint)tailMap, natural ordering");
# Line 104 | Line 104 | public class HeadTailTypeError {
104          }
105  
106  
107 <        try{
107 >        try {
108              SortedMap m = new TreeMap(String.CASE_INSENSITIVE_ORDER);
109              m.headMap(null);
110              throw new Exception("(null endpoint)headMap, explicit comparator");
111          } catch (NullPointerException e) {
112          }
113  
114 <        try{
114 >        try {
115              SortedMap m = new TreeMap(String.CASE_INSENSITIVE_ORDER);
116              m.tailMap(null);
117              throw new Exception("(null endpoint)tailMap, explicit comparator");
118          } catch (NullPointerException e) {
119          }
120  
121 <        try{
121 >        try {
122              SortedSet m = new TreeSet();
123              m.headSet(null);
124              throw new Exception("(null endpoint)headSet, natural ordering");
125          } catch (NullPointerException e) {
126          }
127  
128 <        try{
128 >        try {
129              SortedSet m = new TreeSet();
130              m.tailSet(null);
131              throw new Exception("(null endpoint)tailSet, natural ordering");
132          } catch (NullPointerException e) {
133          }
134  
135 <        try{
135 >        try {
136              SortedSet m = new TreeSet(String.CASE_INSENSITIVE_ORDER);
137              m.headSet(null);
138              throw new Exception("(null endpoint)headSet, explicit comparator");
139          } catch (NullPointerException e) {
140          }
141  
142 <        try{
142 >        try {
143              SortedSet m = new TreeSet(String.CASE_INSENSITIVE_ORDER);
144              m.tailSet(null);
145              throw new Exception("(null endpoint)tailSet, explicit comparator");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines