summaryrefslogtreecommitdiff
blob: eca230e147fb8720125f1e3dd4c9dde486e6c5bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
--- plugins/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/expression/CompoundIterator.java~	2010-02-19 12:12:49.000000000 +0000
+++ plugins/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/expression/CompoundIterator.java	2010-08-09 23:16:39.201246659 +0000
@@ -25,7 +25,7 @@
 	private final Iterator<? extends Object> iteratorIterator;
 	private Iterator<T> currentIterator;
 
-	private T nextObject = noElement();
+	private Object nextObject = NO_ELEMENT;
 
 	/**
 	 * Creates a compound iterator that will iterated over the elements
@@ -47,8 +47,9 @@
 		if (!positionNext())
 			throw new NoSuchElementException();
 
-		T nxt = nextObject;
-		nextObject = noElement();
+		@SuppressWarnings("unchecked")
+		T nxt = (T) nextObject;
+		nextObject = NO_ELEMENT;
 		return nxt;
 	}
 
@@ -76,9 +77,4 @@
 		nextObject = currentIterator.next();
 		return true;
 	}
-
-	@SuppressWarnings("unchecked")
-	private static <T> T noElement() {
-		return (T) NO_ELEMENT;
-	}
-}
\ No newline at end of file
+}
--- plugins/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/expression/MatchIteratorFilter.java~	2010-02-19 12:12:48.000000000 +0000
+++ plugins/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/expression/MatchIteratorFilter.java	2010-08-09 23:20:33.572246380 +0000
@@ -21,7 +21,7 @@
 
 	private final Iterator<? extends T> innerIterator;
 
-	private T nextObject = noElement();
+	private Object nextObject = NO_ELEMENT;
 
 	public MatchIteratorFilter(Iterator<? extends T> iterator) {
 		this.innerIterator = iterator;
@@ -35,8 +35,9 @@
 		if (!positionNext())
 			throw new NoSuchElementException();
 
-		T nxt = nextObject;
-		nextObject = noElement();
+		@SuppressWarnings("unchecked")
+		T nxt = (T) nextObject;
+		nextObject = NO_ELEMENT;
 		return nxt;
 	}
 
@@ -63,9 +64,4 @@
 		}
 		return false;
 	}
-
-	@SuppressWarnings("unchecked")
-	private static <T> T noElement() {
-		return (T) NO_ELEMENT;
-	}
-}
\ No newline at end of file
+}