ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/ConcurrentSkipListMap.java
(Generate patch)

Comparing jsr166/src/main/java/util/concurrent/ConcurrentSkipListMap.java (file contents):
Revision 1.115 by jsr166, Tue Apr 16 05:53:51 2013 UTC vs.
Revision 1.116 by dl, Thu Apr 18 00:01:10 2013 UTC

# Line 3814 | Line 3814 | public class ConcurrentSkipListMap<K,V>
3814  
3815          @SuppressWarnings("unchecked")
3816          public Spliterator<K> trySplit() {
3817 <            Node<K,V> e;
3817 >            Node<K,V> e; K ek;
3818              Comparator<? super K> cmp = comparator;
3819              K f = fence;
3820 <            if ((e = current) != null) {
3820 >            if ((e = current) != null && (ek = e.key) != null) {
3821                  for (Index<K,V> q = row; q != null; q = row = q.down) {
3822                      Index<K,V> s; Node<K,V> n; K sk;
3823                      if ((s = q.right) != null) {
# Line 3828 | Line 3828 | public class ConcurrentSkipListMap<K,V>
3828                              n.helpDelete(b, n.next);
3829                          }
3830                          if (n != null && (sk = n.key) != null &&
3831 +                            (cmp != null ?
3832 +                             (cmp.compare(sk, ek) > 0) :
3833 +                             ((Comparable<? super K>)sk).compareTo(ek) > 0) &&
3834                              (f == null ||
3835 <                             (cmp != null ? (cmp.compare(f, sk) > 0) :
3836 <                              (((Comparable<? super K>)f).compareTo(sk) > 0)))) {
3835 >                             (cmp != null ?
3836 >                              (cmp.compare(sk, f) < 0) :
3837 >                              ((Comparable<? super K>)sk).compareTo(f) < 0))) {
3838                              current = n;
3839                              Index<K,V> r = q.down;
3840                              row = (s.right != null) ? s : s.down;
# Line 3903 | Line 3907 | public class ConcurrentSkipListMap<K,V>
3907  
3908          @SuppressWarnings("unchecked")
3909          public Spliterator<V> trySplit() {
3910 <            Node<K,V> e;
3910 >            Node<K,V> e; K ek;
3911              Comparator<? super K> cmp = comparator;
3912              K f = fence;
3913 <            if ((e = current) != null) {
3913 >            if ((e = current) != null && (ek = e.key) != null) {
3914                  for (Index<K,V> q = row; q != null; q = row = q.down) {
3915                      Index<K,V> s; Node<K,V> n; K sk;
3916                      if ((s = q.right) != null) {
# Line 3917 | Line 3921 | public class ConcurrentSkipListMap<K,V>
3921                              n.helpDelete(b, n.next);
3922                          }
3923                          if (n != null && (sk = n.key) != null &&
3924 +                            (cmp != null ?
3925 +                             (cmp.compare(sk, ek) > 0) :
3926 +                             ((Comparable<? super K>)sk).compareTo(ek) > 0) &&
3927                              (f == null ||
3928 <                             (cmp != null ? (cmp.compare(f, sk) > 0) :
3929 <                              (((Comparable<? super K>)f).compareTo(sk) > 0)))) {
3928 >                             (cmp != null ?
3929 >                              (cmp.compare(sk, f) < 0) :
3930 >                              ((Comparable<? super K>)sk).compareTo(f) < 0))) {
3931                              current = n;
3932                              Index<K,V> r = q.down;
3933                              row = (s.right != null) ? s : s.down;
# Line 3990 | Line 3998 | public class ConcurrentSkipListMap<K,V>
3998  
3999          @SuppressWarnings("unchecked")
4000          public Spliterator<Map.Entry<K,V>> trySplit() {
4001 <            Node<K,V> e;
4001 >            Node<K,V> e; K ek;
4002              Comparator<? super K> cmp = comparator;
4003              K f = fence;
4004 <            if ((e = current) != null) {
4004 >            if ((e = current) != null && (ek = e.key) != null) {
4005                  for (Index<K,V> q = row; q != null; q = row = q.down) {
4006                      Index<K,V> s; Node<K,V> n; K sk;
4007                      if ((s = q.right) != null) {
# Line 4004 | Line 4012 | public class ConcurrentSkipListMap<K,V>
4012                              n.helpDelete(b, n.next);
4013                          }
4014                          if (n != null && (sk = n.key) != null &&
4015 +                            (cmp != null ?
4016 +                             (cmp.compare(sk, ek) > 0) :
4017 +                             ((Comparable<? super K>)sk).compareTo(ek) > 0) &&
4018                              (f == null ||
4019 <                             (cmp != null ?
4020 <                              (cmp.compare(f, sk) > 0) :
4021 <                              (((Comparable<? super K>)f).compareTo(sk) > 0)))) {
4019 >                             (cmp != null ?
4020 >                              (cmp.compare(sk, f) < 0) :
4021 >                              ((Comparable<? super K>)sk).compareTo(f) < 0))) {
4022                              current = n;
4023                              Index<K,V> r = q.down;
4024                              row = (s.right != null) ? s : s.down;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines