src/share/classes/com/sun/tools/javac/util/List.java

changeset 184
905e151a185a
parent 1
9a66ca7c79fa
child 554
9d9f26857129
     1.1 --- a/src/share/classes/com/sun/tools/javac/util/List.java	Thu Jan 08 16:34:58 2009 -0800
     1.2 +++ b/src/share/classes/com/sun/tools/javac/util/List.java	Tue Jan 13 13:27:14 2009 +0000
     1.3 @@ -71,9 +71,10 @@
     1.4       */
     1.5      @SuppressWarnings("unchecked")
     1.6      public static <A> List<A> nil() {
     1.7 -        return EMPTY_LIST;
     1.8 +        return (List<A>)EMPTY_LIST;
     1.9      }
    1.10 -    private static List EMPTY_LIST = new List<Object>(null,null) {
    1.11 +
    1.12 +    private static List<?> EMPTY_LIST = new List<Object>(null,null) {
    1.13          public List<Object> setTail(List<Object> tail) {
    1.14              throw new UnsupportedOperationException();
    1.15          }
    1.16 @@ -318,7 +319,7 @@
    1.17  
    1.18      /** Are the two lists the same?
    1.19       */
    1.20 -    public static boolean equals(List xs, List ys) {
    1.21 +    public static boolean equals(List<?> xs, List<?> ys) {
    1.22          while (xs.tail != null && ys.tail != null) {
    1.23              if (xs.head == null) {
    1.24                  if (ys.head != null) return false;
    1.25 @@ -368,7 +369,7 @@
    1.26          return (List<T>)list;
    1.27      }
    1.28  
    1.29 -    private static Iterator EMPTYITERATOR = new Iterator() {
    1.30 +    private static Iterator<?> EMPTYITERATOR = new Iterator<Object>() {
    1.31              public boolean hasNext() {
    1.32                  return false;
    1.33              }
    1.34 @@ -382,7 +383,7 @@
    1.35  
    1.36      @SuppressWarnings("unchecked")
    1.37      private static <A> Iterator<A> emptyIterator() {
    1.38 -        return EMPTYITERATOR;
    1.39 +        return (Iterator<A>)EMPTYITERATOR;
    1.40      }
    1.41  
    1.42      @Override

mercurial