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

changeset 1442
fcf89720ae71
parent 1362
c46e0c9940d6
child 1550
1df20330f6bd
equal deleted inserted replaced
1441:c78acf6c2f3e 1442:fcf89720ae71
72 @SuppressWarnings("unchecked") 72 @SuppressWarnings("unchecked")
73 public static <A> List<A> nil() { 73 public static <A> List<A> nil() {
74 return (List<A>)EMPTY_LIST; 74 return (List<A>)EMPTY_LIST;
75 } 75 }
76 76
77 private static List<?> EMPTY_LIST = new List<Object>(null,null) { 77 private static final List<?> EMPTY_LIST = new List<Object>(null,null) {
78 public List<Object> setTail(List<Object> tail) { 78 public List<Object> setTail(List<Object> tail) {
79 throw new UnsupportedOperationException(); 79 throw new UnsupportedOperationException();
80 } 80 }
81 public boolean isEmpty() { 81 public boolean isEmpty() {
82 return true; 82 return true;
389 for (Object o : list) 389 for (Object o : list)
390 klass.cast(o); 390 klass.cast(o);
391 return (List<T>)list; 391 return (List<T>)list;
392 } 392 }
393 393
394 private static Iterator<?> EMPTYITERATOR = new Iterator<Object>() { 394 private static final Iterator<?> EMPTYITERATOR = new Iterator<Object>() {
395 public boolean hasNext() { 395 public boolean hasNext() {
396 return false; 396 return false;
397 } 397 }
398 public Object next() { 398 public Object next() {
399 throw new java.util.NoSuchElementException(); 399 throw new java.util.NoSuchElementException();

mercurial