File: SortingCollection.java

package info (click to toggle)
checker-framework-java 3.2.0%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 23,104 kB
  • sloc: java: 145,916; xml: 839; sh: 518; makefile: 404; perl: 26
file content (23 lines) | stat: -rw-r--r-- 732 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import java.util.TreeSet;

// @skip-test Crashes the Checker Framework, but skipped to avoid breaking the build
//
// It looks like we are relying on name equality at some point when resolving
// a type parameter.  If you replace T by E, changing the code to:
//    static class PollableTreeSet<E> extends TreeSet<E> {
//    }
// then the assertion failure goes away.  Evidently this is because
// the annotated TreeSet.java file uses the type variable E.

public class SortingCollection<T> {

    class MergingIterator {
        private final PollableTreeSet<String> queue = null;

        public boolean hasNext() {
            return !queue.isEmpty();
        }
    }

    static class PollableTreeSet<T> extends TreeSet<T> {}
}