Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 396139
Collapse All | Expand All

(-)a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java (-134 / +71 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2012 IBM Corporation and others.
2
 * Copyright (c) 2000, 2013 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 82-236 Link Here
82
	static final String ITERABLE_IMPL_JRE8;
82
	static final String ITERABLE_IMPL_JRE8;
83
	static final String ITERABLE_RAW_IMPL_JRE8;
83
	static final String ITERABLE_RAW_IMPL_JRE8;
84
	static final String ITERABLE_RAW_WITHOUT_IS_EMPTY_IMPL_JRE8;
84
	static final String ITERABLE_RAW_WITHOUT_IS_EMPTY_IMPL_JRE8;
85
	static final String ITERATOR_IMPL_JRE8;
86
	static final String ITERATOR_RAW_IMPL_JRE8;
85
	static final String MAP_IMPL_JRE8;
87
	static final String MAP_IMPL_JRE8;
86
	static final String MAP_RAW_IMPL_JRE8;
88
	static final String MAP_RAW_IMPL_JRE8;
87
	static final String MAP_STREAM_IMPL_JRE8;
89
	static final String STREAM_OVERRIDE_IMPL_JRE8;
88
	static final String MAP_STREAM_RAW_IMPL_JRE8;
90
	static final String STREAM_OVERRIDE_RAW_IMPL_JRE8;
91
	static final String STREAM_OVERRIDE_DECL_JRE8;
89
			
92
			
90
	static {
93
	static {
91
		String javaVersion = System.getProperty("java.specification.version");
94
		String javaVersion = System.getProperty("java.specification.version");
92
		IS_JRE_8 = "1.8".equals(javaVersion);
95
		IS_JRE_8 = "1.8".equals(javaVersion);
93
		if (IS_JRE_8) { // TODO(stephan) accommodate future versions ...
96
		if (IS_JRE_8) { // TODO(stephan) accommodate future versions ...
94
			COMPARATOR_IMPL_JRE8 =
97
			COMPARATOR_IMPL_JRE8 = // replace '*' with T, '%' with U
95
				"	public java.util.Comparator<*> compose(java.util.Comparator<? super *> other) { return null; }\n" +
98
				"	public java.util.Comparator<*> reverseOrder() { return null;}\n" +
96
				"	public java.util.Comparator<*> reverse() { return null; }\n";
99
				"	public java.util.Comparator<*> thenComparing(java.util.Comparator<? super *> other) { return null;}\n" +
100
				"	public <% extends java.lang.Comparable<? super %>> java.util.Comparator<*> thenComparing(java.util.function.Function<? super *, ? extends %> keyExtractor) { return null;}\n" +
101
				"	public java.util.Comparator<*> thenComparing(java.util.function.IntFunction<? super *> keyExtractor) { return null;}\n" +
102
				"	public java.util.Comparator<*> thenComparing(java.util.function.LongFunction<? super *> keyExtractor) { return null;}\n" +
103
				"	public java.util.Comparator<*> thenComparing(java.util.function.DoubleFunction<? super *> keyExtractor) { return null;}\n";
97
			COMPARATOR_RAW_IMPL_JRE8 =
104
			COMPARATOR_RAW_IMPL_JRE8 =
98
				"	public java.util.Comparator compose(java.util.Comparator other) { return null; }\n" +
105
				"	public java.util.Comparator reverseOrder() { return null;}\n" +
99
				"	public java.util.Comparator reverse() { return null; }\n";
106
				"	public java.util.Comparator thenComparing(java.util.Comparator other) { return null;}\n" +
107
				"	public java.util.Comparator thenComparing(java.util.function.Function keyExtractor) { return null;}\n" +
108
				"	public java.util.Comparator thenComparing(java.util.function.IntFunction keyExtractor) { return null;}\n" +
109
				"	public java.util.Comparator thenComparing(java.util.function.LongFunction keyExtractor) { return null;}\n" +
110
				"	public java.util.Comparator thenComparing(java.util.function.DoubleFunction keyExtractor) { return null;}\n";
100
			COLLECTION_IMPL_JRE8 = 
111
			COLLECTION_IMPL_JRE8 = 
101
				"	public boolean retainAll(java.util.functions.Predicate<? super *> filter) { return false; }\n" +
112
				"	public  boolean removeAll(java.util.function.Predicate<? super *> filter) { return false;}\n" +
102
				"	public boolean removeAll(java.util.functions.Predicate<? super *> filter) { return false; }\n" +
113
				"	public java.util.stream.Stream<*> stream() { return null;}\n" +
103
				"	public void addAll(Iterable<? extends *> source) { }\n";
114
				"	public java.util.stream.Stream<*> parallelStream() { return null;}\n";		
104
			COLLECTION_RAW_IMPL_JRE8 = 
115
			COLLECTION_RAW_IMPL_JRE8 = 
105
				"	public @SuppressWarnings(\"rawtypes\") boolean retainAll(java.util.functions.Predicate filter) { return false; }\n" +
116
				"	public @SuppressWarnings(\"rawtypes\") boolean removeAll(java.util.function.Predicate filter) { return false;}\n" +
106
				"	public @SuppressWarnings(\"rawtypes\") boolean removeAll(java.util.functions.Predicate filter) { return false; }\n" +
117
				"	public @SuppressWarnings(\"rawtypes\") java.util.stream.Stream stream() { return null;}\n" +
107
				"	public @SuppressWarnings(\"rawtypes\") void addAll(Iterable source) { }\n";
118
				"	public @SuppressWarnings(\"rawtypes\") java.util.stream.Stream parallelStream() { return null;}\n";			
108
			LIST_IMPL_JRE8 =// replace '*' with your concrete type argument
119
			LIST_IMPL_JRE8 =// replace '*' with your concrete type argument
109
				"	public void sort(java.util.Comparator<? super *> comparator) {}\n" +
120
				"	public void sort(java.util.Comparator<? super *> comparator) {}\n" +
110
				"	public void parallelSort(java.util.Comparator<? super *> comparator) {}\n";	
121
				"	public void parallelSort(java.util.Comparator<? super *> comparator) {}\n" +
122
				"	public void replaceAll(java.util.function.UnaryOperator<*> operator) {}\n";	
111
			LIST_RAW_IMPL_JRE8 =
123
			LIST_RAW_IMPL_JRE8 =
112
				"	public @SuppressWarnings(\"rawtypes\") void sort(java.util.Comparator comparator) {}\n" +
124
				"	public @SuppressWarnings(\"rawtypes\") void sort(java.util.Comparator comparator) {}\n" +
113
				"	public @SuppressWarnings(\"rawtypes\") void parallelSort(java.util.Comparator comparator) {}\n";	
125
				"	public @SuppressWarnings(\"rawtypes\") void parallelSort(java.util.Comparator comparator) {}\n" +
126
				"	public @SuppressWarnings(\"rawtypes\") void replaceAll(java.util.function.UnaryOperator operator) {}\n";	
114
			ITERABLE_IMPL_JRE8 = // replace '*' with your concrete type argument
127
			ITERABLE_IMPL_JRE8 = // replace '*' with your concrete type argument
115
				"	public boolean isEmpty() { return false; }\n" +
128
				"	public void forEach(java.util.function.Block<? super *> block){}\n";
116
				"	public long count() { return 0L; }\n" +
117
				"	public * getOnly() { return null; }\n" +
118
				"	public * getFirst() { return null; }\n" +
119
				"	public * getAny() { return null; }\n" +
120
				"	public * reduce(* base, java.util.functions.BinaryOperator<*> reducer) { return null; }\n" +
121
				"	public <A extends java.util.Fillable<? super *>> A  into(A target) { return null; }\n" +
122
				"	public void forEach(java.util.functions.Block<? super *> block) {}\n" +
123
				"	public Iterable<*> sorted(java.util.Comparator<? super *> comparator) { return null; }\n" +
124
				"	public boolean anyMatch(java.util.functions.Predicate<? super *> filter) { return false; }\n" +
125
				"	public boolean allMatch(java.util.functions.Predicate<? super *> filter) { return false; }\n" +
126
				"	public boolean noneMatch(java.util.functions.Predicate<? super *> filter) { return false; }\n" +
127
				"	public Iterable<*> cumulate(java.util.functions.BinaryOperator<*> op) { return null; }\n" +
128
				"	public <U> MapStream<*,U> mapped(java.util.functions.Mapper<? super *, ? extends U> mapper) { return null; }\n" +
129
				"	public Iterable<*> filter(java.util.functions.Predicate<? super *> predicate) { return null; }\n" +
130
				"	public <U> Iterable<U> map(java.util.functions.Mapper<? super *, ? extends U> mapper) { return null; }\n" +
131
				"	public double mapReduce(java.util.functions.DoubleMapper<? super *> mapper, double base, java.util.functions.DoubleBinaryOperator reducer) { return 0; }\n" +
132
				"	public long mapReduce(java.util.functions.LongMapper<? super *> mapper, long base, java.util.functions.LongBinaryOperator reducer) { return 0; }\n" +
133
				"	public int mapReduce(java.util.functions.IntMapper<? super *> mapper, int base, java.util.functions.IntBinaryOperator reducer) { return 0; }\n" +
134
				"	public <U> U mapReduce(java.util.functions.Mapper<? super *, ? extends U> mapper, U base, java.util.functions.BinaryOperator<U> reducer) { return null; }\n" +
135
				"	public <U> Iterable<U> flatMap(java.util.functions.Mapper<? super *, ? extends Iterable<U>> mapper) { return null; }\n" +
136
				"	public <U> MapStream<U, Iterable<*>> groupBy(java.util.functions.Mapper<? super *, ? extends U> mapper) { return null; }\n" +
137
				"	public <U> MapStream<U, Iterable<*>> groupByMulti(java.util.functions.Mapper<? super *, ? extends Iterable<U>> mapper) { return null; }\n" +
138
				"	public Iterable<*> uniqueElements() { return null; }\n";
139
			ITERABLE_RAW_IMPL_JRE8 =
129
			ITERABLE_RAW_IMPL_JRE8 =
140
				"	public boolean isEmpty() { return false; }\n" +
130
				"	public @SuppressWarnings(\"rawtypes\") void forEach(java.util.function.Block block) {}\n";
141
				"	public long count() { return 0L; }\n" +
142
				"	public @SuppressWarnings(\"rawtypes\") Object getOnly() { return null; }\n" +
143
				"	public @SuppressWarnings(\"rawtypes\") Object getFirst() { return null; }\n" +
144
				"	public @SuppressWarnings(\"rawtypes\") Object getAny() { return null; }\n" +
145
				"	public @SuppressWarnings(\"rawtypes\") Object reduce(Object base, java.util.functions.BinaryOperator reducer) { return null; }\n" +
146
				"	public @SuppressWarnings(\"rawtypes\") java.util.Fillable into(java.util.Fillable target) { return null; }\n" +
147
				"	public @SuppressWarnings(\"rawtypes\") void forEach(java.util.functions.Block block) {}\n" +
148
				"	public @SuppressWarnings(\"rawtypes\") Iterable sorted(java.util.Comparator comparator) { return null; }\n" +
149
				"	public @SuppressWarnings(\"rawtypes\") boolean anyMatch(java.util.functions.Predicate filter) { return false; }\n" +
150
				"	public @SuppressWarnings(\"rawtypes\") boolean allMatch(java.util.functions.Predicate filter) { return false; }\n" +
151
				"	public @SuppressWarnings(\"rawtypes\") boolean noneMatch(java.util.functions.Predicate filter) { return false; }\n" +
152
				"	public @SuppressWarnings(\"rawtypes\") Iterable cumulate(java.util.functions.BinaryOperator op) { return null; }\n" +
153
				"	public @SuppressWarnings(\"rawtypes\") MapStream mapped(java.util.functions.Mapper mapper) { return null; }\n" +
154
				"	public @SuppressWarnings(\"rawtypes\") Iterable filter(java.util.functions.Predicate predicate) { return null; }\n" +
155
				"	public @SuppressWarnings(\"rawtypes\") Iterable map(java.util.functions.Mapper mapper) { return null; }\n" +
156
				"	public @SuppressWarnings(\"rawtypes\") double mapReduce(java.util.functions.DoubleMapper mapper, double base, java.util.functions.DoubleBinaryOperator reducer) { return 0; }\n" +
157
				"	public @SuppressWarnings(\"rawtypes\") long mapReduce(java.util.functions.LongMapper mapper, long base, java.util.functions.LongBinaryOperator reducer) { return 0; }\n" +
158
				"	public @SuppressWarnings(\"rawtypes\") int mapReduce(java.util.functions.IntMapper mapper, int base, java.util.functions.IntBinaryOperator reducer) { return 0; }\n" +
159
				"	public @SuppressWarnings(\"rawtypes\") Object mapReduce(java.util.functions.Mapper mapper, Object base, java.util.functions.BinaryOperator reducer) { return null; }\n" +
160
				"	public @SuppressWarnings(\"rawtypes\") Iterable flatMap(java.util.functions.Mapper mapper) { return null; }\n" +
161
				"	public @SuppressWarnings(\"rawtypes\") MapStream groupBy(java.util.functions.Mapper mapper) { return null; }\n" +
162
				"	public @SuppressWarnings(\"rawtypes\") MapStream groupByMulti(java.util.functions.Mapper mapper) { return null; }\n" +
163
				"	public @SuppressWarnings(\"rawtypes\") Iterable uniqueElements() { return null; }\n";
164
			ITERABLE_RAW_WITHOUT_IS_EMPTY_IMPL_JRE8 =
131
			ITERABLE_RAW_WITHOUT_IS_EMPTY_IMPL_JRE8 =
165
				"	public long count() { return 0L; }\n" +
132
				"	public @SuppressWarnings(\"rawtypes\") void forEach(java.util.function.Block block) {}\n";
166
				"	public @SuppressWarnings(\"rawtypes\") Object getOnly() { return null; }\n" +
133
			ITERATOR_IMPL_JRE8 = // replace '*' with your concrete type argument
167
				"	public @SuppressWarnings(\"rawtypes\") Object getFirst() { return null; }\n" +
134
				"	public void forEach(java.util.function.Block<? super *> block){}\n";
168
				"	public @SuppressWarnings(\"rawtypes\") Object getAny() { return null; }\n" +
135
			ITERATOR_RAW_IMPL_JRE8 =
169
				"	public @SuppressWarnings(\"rawtypes\") Object reduce(Object base, java.util.functions.BinaryOperator reducer) { return null; }\n" +
136
				"	public void forEach(java.util.function.Block block){}\n";
170
				"	public @SuppressWarnings(\"rawtypes\") java.util.Fillable into(java.util.Fillable target) { return null; }\n" +
137
			MAP_IMPL_JRE8 = // '*' for 'K', '%' for 'V'
171
				"	public @SuppressWarnings(\"rawtypes\") void forEach(java.util.functions.Block block) {}\n" +
138
				"	public boolean remove(Object key, Object value) { return false;}\n" +
172
				"	public @SuppressWarnings(\"rawtypes\") Iterable sorted(java.util.Comparator comparator) { return null; }\n" +
139
				"	public void forEach(java.util.function.BiBlock<? super *, ? super %> block) {}\n" + 
173
				"	public @SuppressWarnings(\"rawtypes\") boolean anyMatch(java.util.functions.Predicate filter) { return false; }\n" +
140
				"	public void replaceAll(java.util.function.BiFunction<*, %, %> function) {}\n" +
174
				"	public @SuppressWarnings(\"rawtypes\") boolean allMatch(java.util.functions.Predicate filter) { return false; }\n" +
141
				"	public % putIfAbsent(* key, % value) { return null;}\n" +
175
				"	public @SuppressWarnings(\"rawtypes\") boolean noneMatch(java.util.functions.Predicate filter) { return false; }\n" +
142
				"	public boolean replace(* key, % oldValue, % newValue) { return false;}\n" +
176
				"	public @SuppressWarnings(\"rawtypes\") Iterable cumulate(java.util.functions.BinaryOperator op) { return null; }\n" +
143
				"	public % replace(* key, % value) { return null;}\n" +
177
				"	public @SuppressWarnings(\"rawtypes\") MapStream mapped(java.util.functions.Mapper mapper) { return null; }\n" +
144
				"	public % computeIfAbsent(* key,	java.util.function.Function<? super *, ? extends %> mappingFunction) {	return null;}\n" +
178
				"	public @SuppressWarnings(\"rawtypes\") Iterable filter(java.util.functions.Predicate predicate) { return null; }\n" +
145
				"	public % computeIfPresent(* key, java.util.function.BiFunction<? super *, ? super %, ? extends %> remappingFunction) {	return null;}\n" +
179
				"	public @SuppressWarnings(\"rawtypes\") Iterable map(java.util.functions.Mapper mapper) { return null; }\n" +
146
				"	public % compute(* key,	java.util.function.BiFunction<? super *, ? super %, ? extends %> remappingFunction) { return null;}\n" +
180
				"	public @SuppressWarnings(\"rawtypes\") double mapReduce(java.util.functions.DoubleMapper mapper, double base, java.util.functions.DoubleBinaryOperator reducer) { return 0; }\n" +
147
				"	public % merge(* key, % value, java.util.function.BiFunction<? super %, ? super %, ? extends %> remappingFunction) { return null;}\n";
181
				"	public @SuppressWarnings(\"rawtypes\") long mapReduce(java.util.functions.LongMapper mapper, long base, java.util.functions.LongBinaryOperator reducer) { return 0; }\n" +
182
				"	public @SuppressWarnings(\"rawtypes\") int mapReduce(java.util.functions.IntMapper mapper, int base, java.util.functions.IntBinaryOperator reducer) { return 0; }\n" +
183
				"	public @SuppressWarnings(\"rawtypes\") Object mapReduce(java.util.functions.Mapper mapper, Object base, java.util.functions.BinaryOperator reducer) { return null; }\n" +
184
				"	public @SuppressWarnings(\"rawtypes\") Iterable flatMap(java.util.functions.Mapper mapper) { return null; }\n" +
185
				"	public @SuppressWarnings(\"rawtypes\") MapStream groupBy(java.util.functions.Mapper mapper) { return null; }\n" +
186
				"	public @SuppressWarnings(\"rawtypes\") MapStream groupByMulti(java.util.functions.Mapper mapper) { return null; }\n" +
187
				"	public @SuppressWarnings(\"rawtypes\") Iterable uniqueElements() { return null; }\n";
188
			MAP_IMPL_JRE8 = // '!' stands for 'K,V', '*' for 'K'
189
				"	public Iterable<BiValue<!>> asIterable() { return null; }\n" +
190
				"	public Iterable<*> inputs() { return null; }\n";
191
			MAP_RAW_IMPL_JRE8 =
148
			MAP_RAW_IMPL_JRE8 =
192
				"	public Iterable asIterable() { return null; }\n" +
149
				"	public boolean remove(Object key, Object value) { return false;}\n" +
193
				"	public Iterable inputs() { return null; }\n";
150
				"	public void forEach(java.util.function.BiBlock block) {}\n" + 
194
			MAP_STREAM_IMPL_JRE8 = // '*' stands for 'K', '%' for 'V'
151
				"	public void replaceAll(java.util.function.BiFunction function) {}\n" +
195
				"	public BiValue<*,%> getOnly() { return null; }\n" +
152
				"	public Object putIfAbsent(Object key, Object value) { return null;}\n" +
196
				"	public <A extends Map<? super *, ? super %>> A  into(A destination) { return null; }\n" +
153
				"	public boolean replace(Object key, Object oldValue, Object newValue) { return false;}\n" +
197
				"	public void forEach(java.util.functions.BiBlock<? super *, ? super %> block) {}\n" +
154
				"	public Object replace(Object key, Object value) { return null;}\n" +
198
				"	public MapStream<*, Iterable<%>> asMultiStream() { return null; }\n" +
155
				"	public Object computeIfAbsent(Object key, java.util.function.Function mappingFunction) { return null;}\n" +
199
				"	public <W> MapStream<*, Iterable<W>> mapValuesMulti(final java.util.functions.BiMapper<? super *, ? super %, Iterable<W>> mapper) { return null; }\n" +
156
				"	public Object computeIfPresent(Object key, java.util.function.BiFunction remappingFunction) { return null;}\n" +
200
				"	public MapStream<*,%> sorted(java.util.Comparator<? super *> comparator) { return null; }\n" +
157
				"	public Object compute(Object key, java.util.function.BiFunction remappingFunction) { return null;}\n" +
201
				"	public boolean anyMatch(java.util.functions.BiPredicate<? super *, ? super %> predicate) { return false; }\n" +
158
				"	public Object merge(Object key, Object value, java.util.function.BiFunction remappingFunction) { return null;}\n";
202
				"	public boolean allMatch(java.util.functions.BiPredicate<? super *, ? super %> predicate) { return false; }\n" +
159
			STREAM_OVERRIDE_IMPL_JRE8 = // replace '*' with your concrete type argument
203
				"	public boolean noneMatch(java.util.functions.BiPredicate<? super *, ? super %> predicate) { return false; }\n" +
160
				"	public java.util.stream.Stream<*> stream() { return null;}\n" +
204
				"	public MapStream<*,%> merge(MapStream<*,%> other) { return null; }\n" +
161
                "	public java.util.stream.Stream<*> parallelStream() { return null;}\n";
205
				"	public MapStream<*,%> filter(final java.util.functions.BiPredicate<? super *, ? super %> predicate) { return null; }\n" +
162
			STREAM_OVERRIDE_RAW_IMPL_JRE8 =
206
				"	public MapStream<%,*> swap() { return null; }\n" +
163
				"	public java.util.stream.Stream stream() { return null;}\n" +
207
				"	public BiValue<*,%> getAny() { return null; }\n" +
164
				"	public java.util.stream.Stream parallelStream() { return null;}\n";
208
				"	public MapStream<*,%> filterKeys(final java.util.functions.Predicate<*> filter) { return null; }\n" +
165
			STREAM_OVERRIDE_DECL_JRE8 = // replace '*' with your concrete type argument
209
				"	public MapStream<*,%> filterValues(final java.util.functions.Predicate<%> filter) { return null; }\n" +
166
					"	public java.util.stream.Stream<*> stream();\n" +
210
				"	public <A extends Map<? super *, C>,C extends Collection<? super %>> A intoMulti(A destination, java.util.functions.Factory<C> factory) { return null; }\n" +
167
	                "	public java.util.stream.Stream<*> parallelStream();\n";
211
				"	public <W> MapStream<*,W> mapValues(final java.util.functions.Mapper<%,W> mapper) { return null; }\n" +
212
				"	public BiValue<*,%> getFirst() { return null; }\n" +
213
				"	public <W> MapStream<*, W> map(final java.util.functions.BiMapper<*, %, W> mapper) { return null; }\n";
214
			MAP_STREAM_RAW_IMPL_JRE8 =
215
				"	public BiValue getOnly() { return null; }\n" +
216
				"	public Map into(Map destination) { return null; }\n" +
217
				"	public void forEach(java.util.functions.BiBlock block) {}\n" +
218
				"	public MapStream asMultiStream() { return null; }\n" +
219
				"	public MapStream mapValuesMulti(final java.util.functions.BiMapper mapper) { return null; }\n" +
220
				"	public MapStream sorted(java.util.Comparator comparator) { return null; }\n" +
221
				"	public boolean anyMatch(java.util.functions.BiPredicate predicate) { return false; }\n" +
222
				"	public boolean allMatch(java.util.functions.BiPredicate predicate) { return false; }\n" +
223
				"	public boolean noneMatch(java.util.functions.BiPredicate predicate) { return false; }\n" +
224
				"	public MapStream merge(MapStream other) { return null; }\n" +
225
				"	public MapStream filter(final java.util.functions.BiPredicate predicate) { return null; }\n" +
226
				"	public MapStream swap() { return null; }\n" +
227
				"	public BiValue getAny() { return null; }\n" +
228
				"	public MapStream filterKeys(final java.util.functions.Predicate filter) { return null; }\n" +
229
				"	public MapStream filterValues(final java.util.functions.Predicate filter) { return null; }\n" +
230
				"	public Map intoMulti(Map destination, java.util.functions.Factory factory) { return null; }\n" +
231
				"	public MapStream mapValues(final java.util.functions.Mapper mapper) { return null; }\n" +
232
				"	public BiValue getFirst() { return null; }\n" +
233
				"	public MapStream map(final java.util.functions.BiMapper mapper) { return null; }\n";
234
		} else {
168
		} else {
235
			COMPARATOR_IMPL_JRE8 = "";			
169
			COMPARATOR_IMPL_JRE8 = "";			
236
			COMPARATOR_RAW_IMPL_JRE8 = "";
170
			COMPARATOR_RAW_IMPL_JRE8 = "";
Lines 241-250 Link Here
241
			ITERABLE_IMPL_JRE8 = "";
175
			ITERABLE_IMPL_JRE8 = "";
242
			ITERABLE_RAW_IMPL_JRE8 = "";
176
			ITERABLE_RAW_IMPL_JRE8 = "";
243
			ITERABLE_RAW_WITHOUT_IS_EMPTY_IMPL_JRE8 = "";
177
			ITERABLE_RAW_WITHOUT_IS_EMPTY_IMPL_JRE8 = "";
178
			ITERATOR_IMPL_JRE8 = "\n";
179
			ITERATOR_RAW_IMPL_JRE8 = "\n";
244
			MAP_IMPL_JRE8 = "";
180
			MAP_IMPL_JRE8 = "";
245
			MAP_RAW_IMPL_JRE8 = "";
181
			MAP_RAW_IMPL_JRE8 = "";
246
			MAP_STREAM_IMPL_JRE8 = "";
182
			STREAM_OVERRIDE_IMPL_JRE8 = "\n\n";
247
			MAP_STREAM_RAW_IMPL_JRE8 = "";
183
			STREAM_OVERRIDE_RAW_IMPL_JRE8 = "\n\n";
184
			STREAM_OVERRIDE_DECL_JRE8 = "";
248
		}
185
		}
249
	}
186
	}
250
	String getListRawImplJRE8() {
187
	String getListRawImplJRE8() {
(-)a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AmbiguousMethodTest.java (-2 / +6 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2012 IBM Corporation and others.
2
 * Copyright (c) 2000, 2013 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 504-509 Link Here
504
				"T.java",
504
				"T.java",
505
				"import java.util.*;\n" +
505
				"import java.util.*;\n" +
506
				"public class T {\n" +
506
				"public class T {\n" +
507
				" @SuppressWarnings(\"null\")\n" +
507
				"   void test() {\n" +
508
				"   void test() {\n" +
508
				"   	OrderedSet<String> os = null;\n" +
509
				"   	OrderedSet<String> os = null;\n" +
509
				"   	os.add(\"hello\");\n" +
510
				"   	os.add(\"hello\");\n" +
Lines 511-517 Link Here
511
				"   	os2.add(1);\n" +
512
				"   	os2.add(1);\n" +
512
				"   }\n" +
513
				"   }\n" +
513
				"}" +
514
				"}" +
514
				"interface OrderedSet<E> extends List<E>, Set<E> { boolean add(E o); }\n"
515
				"interface OrderedSet<E> extends List<E>, Set<E> {\n " +
516
				"	boolean add(E o);\n" +
517
				STREAM_OVERRIDE_DECL_JRE8.replaceAll("\\*", "E") +
518
				" }\n"
515
			},
519
			},
516
			""
520
			""
517
		);
521
		);
(-)a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ForeachStatementTest.java (-3 / +9 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2012 IBM Corporation and others.
2
 * Copyright (c) 2000, 2013 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 1630-1635 Link Here
1630
			"	}\n" +
1630
			"	}\n" +
1631
			"	public void remove() {\n" +
1631
			"	public void remove() {\n" +
1632
			"	}\n" +
1632
			"	}\n" +
1633
			ITERATOR_IMPL_JRE8.replaceAll("\\*", "T") +
1633
			"}\n" +
1634
			"}\n" +
1634
			"class Bar implements Iterable<String> {\n" +
1635
			"class Bar implements Iterable<String> {\n" +
1635
			"	public Iterator<String> iterator() {\n" +
1636
			"	public Iterator<String> iterator() {\n" +
Lines 1724-1729 Link Here
1724
			"	}\n" +
1725
			"	}\n" +
1725
			"	public void remove() {\n" +
1726
			"	public void remove() {\n" +
1726
			"	}\n" +
1727
			"	}\n" +
1728
			ITERATOR_IMPL_JRE8.replaceAll("\\*", "T") +
1727
			"}\n" +
1729
			"}\n" +
1728
			"interface IFoo extends Iterable<String> {\n" +
1730
			"interface IFoo extends Iterable<String> {\n" +
1729
			"}\n" +
1731
			"}\n" +
Lines 2021-2036 Link Here
2021
			"				System.out.println(\"remove\");\n" +
2023
			"				System.out.println(\"remove\");\n" +
2022
			"				this.iterator.remove();\n" +
2024
			"				this.iterator.remove();\n" +
2023
			"			}\n" +
2025
			"			}\n" +
2026
			ITERATOR_IMPL_JRE8.replaceAll("\\*", "T") +
2024
			"		}\n" +
2027
			"		}\n" +
2025
			"		\n" +
2028
			"		\n" +
2026
			"        static Set<Object> initForEach()        {\n" +
2029
			"        static Set<Object> initForEach()        {\n" +
2027
			"                System.out.println(\"initForEach\");\n" +
2030
			"                System.out.println(\"initForEach\");\n" +
2028
			"                HashSet<Object> set = new HashSet<Object>() {\n" +
2031
			"                HashSet<Object> set = new HashSet<Object>() {\n" +
2029
			"                	private static final long serialVersionUID = 1L;\n" +
2032
			"                	private static final long serialVersionUID = 1L;\n" +
2030
			"                	public Iterator<Object> iterator() {\n" +
2033
			"                	@Override public Iterator<Object> iterator() {\n" +
2031
			"                		System.out.println(\"iterator\");\n" +
2034
			"                		System.out.println(\"iterator\");\n" +
2032
			"                		return new MyIterator<Object>(super.iterator());\n" +
2035
			"                		return new MyIterator<Object>(super.iterator());\n" +
2033
			"                	}\n" +
2036
			"                	}\n" +
2037
			STREAM_OVERRIDE_IMPL_JRE8.replaceAll("\\*", "Object") +
2034
			"                };\n" +
2038
			"                };\n" +
2035
			"                for (int i = 0; i < 3; i++) set.add(i);\n" +
2039
			"                for (int i = 0; i < 3; i++) set.add(i);\n" +
2036
			"                return set;\n" +
2040
			"                return set;\n" +
Lines 2117-2132 Link Here
2117
			"				System.out.println(\"remove\");\n" +
2121
			"				System.out.println(\"remove\");\n" +
2118
			"				this.iterator.remove();\n" +
2122
			"				this.iterator.remove();\n" +
2119
			"			}\n" +
2123
			"			}\n" +
2124
			ITERATOR_IMPL_JRE8.replaceAll("\\*", "T") +
2120
			"		}\n" +
2125
			"		}\n" +
2121
			"		\n" +
2126
			"		\n" +
2122
			"        static Set<Object> initForEach()        {\n" +
2127
			"        static Set<Object> initForEach()        {\n" +
2123
			"                System.out.println(\"initForEach\");\n" +
2128
			"                System.out.println(\"initForEach\");\n" +
2124
			"                HashSet<Object> set = new HashSet<Object>() {\n" +
2129
			"                HashSet<Object> set = new HashSet<Object>() {\n" +
2125
			"                	private static final long serialVersionUID = 1L;\n" +
2130
			"                	private static final long serialVersionUID = 1L;\n" +
2126
			"                	public Iterator<Object> iterator() {\n" +
2131
			"                	@Override public Iterator<Object> iterator() {\n" +
2127
			"                		System.out.println(\"iterator\");\n" +
2132
			"                		System.out.println(\"iterator\");\n" +
2128
			"                		return new MyIterator<Object>(super.iterator());\n" +
2133
			"                		return new MyIterator<Object>(super.iterator());\n" +
2129
			"                	}\n" +
2134
			"                	}\n" +
2135
			STREAM_OVERRIDE_IMPL_JRE8.replaceAll("\\*", "Object") +
2130
			"                };\n" +
2136
			"                };\n" +
2131
			"                for (int i = 0; i < 3; i++) set.add(i);\n" +
2137
			"                for (int i = 0; i < 3; i++) set.add(i);\n" +
2132
			"                return set;\n" +
2138
			"                return set;\n" +
(-)a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java (-27 / +43 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2012 IBM Corporation and others.
2
 * Copyright (c) 2000, 2013 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 7805-7811 Link Here
7805
			new String[] {
7805
			new String[] {
7806
				"X.java",
7806
				"X.java",
7807
				"public class X<T> {\n" +
7807
				"public class X<T> {\n" +
7808
				"    public abstract class M extends java.util.AbstractList<T> {}\n" +
7808
				"    public abstract class M extends java.util.AbstractList<T> {\n" +
7809
				STREAM_OVERRIDE_IMPL_JRE8.replaceAll("\\*", "T") +
7810
				"	 }\n" +
7809
				"}\n" +
7811
				"}\n" +
7810
				"class Y<T> extends T {}\n" +
7812
				"class Y<T> extends T {}\n" +
7811
				"class Z<T> {\n" +
7813
				"class Z<T> {\n" +
Lines 7813-7824 Link Here
7813
				"}\n"
7815
				"}\n"
7814
			},
7816
			},
7815
			"----------\n" +
7817
			"----------\n" +
7816
			"1. ERROR in X.java (at line 4)\n" +
7818
			"1. ERROR in X.java (at line 7)\n" +
7817
			"	class Y<T> extends T {}\n" +
7819
			"	class Y<T> extends T {}\n" +
7818
			"	                   ^\n" +
7820
			"	                   ^\n" +
7819
			"Cannot refer to the type parameter T as a supertype\n" +
7821
			"Cannot refer to the type parameter T as a supertype\n" +
7820
			"----------\n" +
7822
			"----------\n" +
7821
			"2. ERROR in X.java (at line 6)\n" +
7823
			"2. ERROR in X.java (at line 9)\n" +
7822
			"	class M extends T {}\n" +
7824
			"	class M extends T {}\n" +
7823
			"	                ^\n" +
7825
			"	                ^\n" +
7824
			"Cannot refer to the type parameter T as a supertype\n" +
7826
			"Cannot refer to the type parameter T as a supertype\n" +
Lines 8849-8856 Link Here
8849
				"   public Set<Map.Entry<String, V>> entrySet() {\n" +
8851
				"   public Set<Map.Entry<String, V>> entrySet() {\n" +
8850
				"      return this.backingMap.entrySet();\n" +
8852
				"      return this.backingMap.entrySet();\n" +
8851
				"   }\n" +
8853
				"   }\n" +
8852
				MAP_STREAM_IMPL_JRE8.replaceAll("\\*", "String").replace('%', 'V') +
8854
				//MAP_STREAM_IMPL_JRE8.replaceAll("\\*", "String").replace('%', 'V') +
8853
				MAP_IMPL_JRE8.replaceAll("!", "String,V").replaceAll("\\*", "String")+
8855
				MAP_IMPL_JRE8.replaceAll("\\*", "String").replace('%', 'V') +
8854
				"}\n",
8856
				"}\n",
8855
			},
8857
			},
8856
			"----------\n" +
8858
			"----------\n" +
Lines 9321-9327 Link Here
9321
				"		xe.element().add(this);\n" +
9323
				"		xe.element().add(this);\n" +
9322
				"		xe.element().run();\n" +
9324
				"		xe.element().run();\n" +
9323
				"	}\n" +
9325
				"	}\n" +
9324
				"	abstract class XM implements List, Runnable {}\n" +
9326
				"	abstract class XM implements List, Runnable {\n" +
9327
				STREAM_OVERRIDE_IMPL_JRE8.replaceAll("\\*", "Object") +
9328
				"	}\n" +
9325
				"  Zork z;\n" +
9329
				"  Zork z;\n" +
9326
				"}\n"
9330
				"}\n"
9327
			},
9331
			},
Lines 9347-9357 Link Here
9347
			"Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
9351
			"Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
9348
			"----------\n" +
9352
			"----------\n" +
9349
			"5. WARNING in X.java (at line 19)\n" +
9353
			"5. WARNING in X.java (at line 19)\n" +
9350
			"	abstract class XM implements List, Runnable {}\n" +
9354
			"	abstract class XM implements List, Runnable {\n" +
9351
			"	                             ^^^^\n" +
9355
			"	                             ^^^^\n" +
9352
			"List is a raw type. References to generic type List<E> should be parameterized\n" +
9356
			"List is a raw type. References to generic type List<E> should be parameterized\n" +
9353
			"----------\n" +
9357
			"----------\n" +
9354
			"6. ERROR in X.java (at line 20)\n" +
9358
			"6. ERROR in X.java (at line 23)\n" +
9355
			"	Zork z;\n" +
9359
			"	Zork z;\n" +
9356
			"	^^^^\n" +
9360
			"	^^^^\n" +
9357
			"Zork cannot be resolved to a type\n" +
9361
			"Zork cannot be resolved to a type\n" +
Lines 10755-10761 Link Here
10755
				"X.java",
10759
				"X.java",
10756
				"import java.util.*;\n" +
10760
				"import java.util.*;\n" +
10757
					"public class X {\n" +
10761
					"public class X {\n" +
10758
					"    class List1<E> extends LinkedList<E> {};\n" +
10762
					"    class List1<E> extends LinkedList<E> {\n" +
10763
					STREAM_OVERRIDE_IMPL_JRE8.replaceAll("\\*", "E") +
10764
					"};\n" +
10759
					"    public static void main (String[] args) {\n" +
10765
					"    public static void main (String[] args) {\n" +
10760
					"        Map<String, List<Integer>> x = new HashMap<String, List<Integer>>();\n" +
10766
					"        Map<String, List<Integer>> x = new HashMap<String, List<Integer>>();\n" +
10761
					"        Map<String, List1<Integer>> m = new HashMap<String, List1<Integer>>();\n" +
10767
					"        Map<String, List1<Integer>> m = new HashMap<String, List1<Integer>>();\n" +
Lines 10805-10819 Link Here
10805
					"import java.util.Iterator;\n" +
10811
					"import java.util.Iterator;\n" +
10806
					"import java.util.Map.Entry;\n" +
10812
					"import java.util.Map.Entry;\n" +
10807
					"public class Test extends AbstractSet<Entry<String,Integer>> {\n" +
10813
					"public class Test extends AbstractSet<Entry<String,Integer>> {\n" +
10808
					"	public Iterator<Entry<String, Integer>> iterator() {\n" +
10814
					"	@Override public Iterator<Entry<String, Integer>> iterator() {\n" +
10809
					"		return new Iterator<Entry<String,Integer>>() {\n" +
10815
					"		return new Iterator<Entry<String,Integer>>() {\n" +
10810
					"			public boolean hasNext() {return false;}\n" +
10816
					"			public boolean hasNext() {return false;}\n" +
10811
					"			public Entry<String, Integer> next() {return null;}\n" +
10817
					"			public Entry<String, Integer> next() {return null;}\n" +
10812
					"			public void remove() {}	\n" +
10818
					"			public void remove() {}	\n" +
10819
					ITERABLE_IMPL_JRE8.replaceAll("\\*", "Entry<String,Integer>") +
10813
					"		};\n" +
10820
					"		};\n" +
10814
					"	}\n" +
10821
					"	}\n" +
10815
					"	public int size() {return 0;}\n" +
10822
					"	@Override public int size() {return 0;}\n" +
10816
					COLLECTION_RAW_IMPL_JRE8 +
10823
					COLLECTION_IMPL_JRE8.replaceAll("\\*", "Entry<String,Integer>") +
10817
					ITERABLE_IMPL_JRE8.replaceAll("\\*", "Entry<String,Integer>") +
10824
					ITERABLE_IMPL_JRE8.replaceAll("\\*", "Entry<String,Integer>") +
10818
					"}"
10825
					"}"
10819
			}
10826
			}
Lines 13567-13572 Link Here
13567
				"    public boolean hasNext() { return false; }\n" +
13574
				"    public boolean hasNext() { return false; }\n" +
13568
				"    public String next() { return null; }\n" +
13575
				"    public String next() { return null; }\n" +
13569
				"    public void remove() {}\n" +
13576
				"    public void remove() {}\n" +
13577
				ITERATOR_IMPL_JRE8.replaceAll("\\*", "String") +
13570
				"}\n",
13578
				"}\n",
13571
			},
13579
			},
13572
			"");
13580
			"");
Lines 17206-17211 Link Here
17206
			new String[] {
17214
			new String[] {
17207
				"X.java",
17215
				"X.java",
17208
				"class StringList extends java.util.LinkedList<String> {\n" +
17216
				"class StringList extends java.util.LinkedList<String> {\n" +
17217
				STREAM_OVERRIDE_IMPL_JRE8.replaceAll("\\*", "String") +
17209
				"}\n" +
17218
				"}\n" +
17210
				"\n" +
17219
				"\n" +
17211
				"public class X {\n" +
17220
				"public class X {\n" +
Lines 17222-17228 Link Here
17222
			"	      ^^^^^^^^^^\n" +
17231
			"	      ^^^^^^^^^^\n" +
17223
			"The serializable class StringList does not declare a static final serialVersionUID field of type long\n" +
17232
			"The serializable class StringList does not declare a static final serialVersionUID field of type long\n" +
17224
			"----------\n" +
17233
			"----------\n" +
17225
			"2. ERROR in X.java (at line 9)\n" +
17234
			"2. ERROR in X.java (at line 11)\n" +
17226
			"	Zork z;\n" +
17235
			"	Zork z;\n" +
17227
			"	^^^^\n" +
17236
			"	^^^^\n" +
17228
			"Zork cannot be resolved to a type\n" +
17237
			"Zork cannot be resolved to a type\n" +
Lines 19904-19909 Link Here
19904
				"			}\n" +
19913
				"			}\n" +
19905
				"			public void remove() {\n" +
19914
				"			public void remove() {\n" +
19906
				"			}\n" +
19915
				"			}\n" +
19916
				ITERATOR_IMPL_JRE8.replaceAll("\\*", "U") +
19907
				"		}\n" +
19917
				"		}\n" +
19908
				"	}\n" +
19918
				"	}\n" +
19909
				"}\n",
19919
				"}\n",
Lines 24928-24934 Link Here
24928
		},
24938
		},
24929
		"SUCCESS");
24939
		"SUCCESS");
24930
24940
24931
	String constantPoolIdx = IS_JRE_8 ? "149" : "36"; // depends on whether or not stubs for JRE8 default methods are included
24941
	String constantPoolIdx = IS_JRE_8 ? "67" : "36"; // depends on whether or not stubs for JRE8 default methods are included
24932
	String expectedOutput =
24942
	String expectedOutput =
24933
		"  // Method descriptor #31 (I)Ljava/lang/Object;\n" +
24943
		"  // Method descriptor #31 (I)Ljava/lang/Object;\n" +
24934
		"  // Stack: 2, Locals: 2\n" +
24944
		"  // Stack: 2, Locals: 2\n" +
Lines 25882-25887 Link Here
25882
			"	}\n" +
25892
			"	}\n" +
25883
			"	public void remove() {\n" +
25893
			"	public void remove() {\n" +
25884
			"	}\n" +
25894
			"	}\n" +
25895
			ITERATOR_IMPL_JRE8.replaceAll("\\*", "N") +
25885
			"}\n" +
25896
			"}\n" +
25886
			"interface Set3<N extends Node> extends Iterable<N> {\n" +
25897
			"interface Set3<N extends Node> extends Iterable<N> {\n" +
25887
			"	SetIterator<N> iterator();\n" +
25898
			"	SetIterator<N> iterator();\n" +
Lines 25913-25939 Link Here
25913
			"}\n",
25924
			"}\n",
25914
		},
25925
		},
25915
		"----------\n" +
25926
		"----------\n" +
25916
		"1. WARNING in X.java (at line 21)\n" +
25927
		"1. WARNING in X.java (at line 22)\n" +
25917
		"	void f1(Set1 s) {\n" +
25928
		"	void f1(Set1 s) {\n" +
25918
		"	        ^^^^\n" +
25929
		"	        ^^^^\n" +
25919
		"Set1 is a raw type. References to generic type Set1<N> should be parameterized\n" +
25930
		"Set1 is a raw type. References to generic type Set1<N> should be parameterized\n" +
25920
		"----------\n" +
25931
		"----------\n" +
25921
		"2. ERROR in X.java (at line 22)\n" +
25932
		"2. ERROR in X.java (at line 23)\n" +
25922
		"	Node n_ = s.iterator().next();\n" +
25933
		"	Node n_ = s.iterator().next();\n" +
25923
		"	          ^^^^^^^^^^^^^^^^^^^\n" +
25934
		"	          ^^^^^^^^^^^^^^^^^^^\n" +
25924
		"Type mismatch: cannot convert from Object to Node\n" +
25935
		"Type mismatch: cannot convert from Object to Node\n" +
25925
		"----------\n" +
25936
		"----------\n" +
25926
		"3. ERROR in X.java (at line 25)\n" +
25937
		"3. ERROR in X.java (at line 26)\n" +
25927
		"	for (Node n : s) {\n" +
25938
		"	for (Node n : s) {\n" +
25928
		"	              ^\n" +
25939
		"	              ^\n" +
25929
		"Type mismatch: cannot convert from element type Object to Node\n" +
25940
		"Type mismatch: cannot convert from element type Object to Node\n" +
25930
		"----------\n" +
25941
		"----------\n" +
25931
		"4. WARNING in X.java (at line 35)\n" +
25942
		"4. WARNING in X.java (at line 36)\n" +
25932
		"	void f3(Set3 s) {\n" +
25943
		"	void f3(Set3 s) {\n" +
25933
		"	        ^^^^\n" +
25944
		"	        ^^^^\n" +
25934
		"Set3 is a raw type. References to generic type Set3<N> should be parameterized\n" +
25945
		"Set3 is a raw type. References to generic type Set3<N> should be parameterized\n" +
25935
		"----------\n" +
25946
		"----------\n" +
25936
		"5. ERROR in X.java (at line 38)\n" +
25947
		"5. ERROR in X.java (at line 39)\n" +
25937
		"	for (Node n : s) {\n" +
25948
		"	for (Node n : s) {\n" +
25938
		"	              ^\n" +
25949
		"	              ^\n" +
25939
		"Type mismatch: cannot convert from element type Object to Node\n" +
25950
		"Type mismatch: cannot convert from element type Object to Node\n" +
Lines 28724-28729 Link Here
28724
			"	public int compareTo(Sequence<? extends E> o) {\n" +
28735
			"	public int compareTo(Sequence<? extends E> o) {\n" +
28725
			"		return 0;\n" +
28736
			"		return 0;\n" +
28726
			"	}\n" +
28737
			"	}\n" +
28738
			STREAM_OVERRIDE_IMPL_JRE8.replaceAll("\\*", "E") +
28727
			"}\n" +
28739
			"}\n" +
28728
			"\n" +
28740
			"\n" +
28729
			"class Test<T extends Comparable<? super T>> {\n" +
28741
			"class Test<T extends Comparable<? super T>> {\n" +
Lines 33717-33722 Link Here
33717
			"      super.add(-index-1,e);\n" +
33729
			"      super.add(-index-1,e);\n" +
33718
			"      return true;\n" +
33730
			"      return true;\n" +
33719
			"  }\n" +
33731
			"  }\n" +
33732
			STREAM_OVERRIDE_IMPL_JRE8.replaceAll("\\*", "E") +
33720
			"}", // =================
33733
			"}", // =================
33721
		},
33734
		},
33722
		"----------\n" +
33735
		"----------\n" +
Lines 34421-34427 Link Here
34421
			"public int compare(T obj1, T obj2) {\n" +
34434
			"public int compare(T obj1, T obj2) {\n" +
34422
			"	return obj1.compareTo(obj2);\n" +
34435
			"	return obj1.compareTo(obj2);\n" +
34423
			"}\n" +
34436
			"}\n" +
34424
			COMPARATOR_IMPL_JRE8.replace('*', 'T') +
34437
			COMPARATOR_IMPL_JRE8.replaceAll("\\*", "T").replace('%', 'U') +
34425
			"}\n" +
34438
			"}\n" +
34426
			"\n" +
34439
			"\n" +
34427
			"@SuppressWarnings({\"unchecked\", \"rawtypes\"})\n" +
34440
			"@SuppressWarnings({\"unchecked\", \"rawtypes\"})\n" +
Lines 34472-34478 Link Here
34472
			"public int compare(V obj1, V obj2) {\n" +
34485
			"public int compare(V obj1, V obj2) {\n" +
34473
			"	return 0;\n" +
34486
			"	return 0;\n" +
34474
			"}\n" +
34487
			"}\n" +
34475
			COMPARATOR_IMPL_JRE8.replace('*', 'V') +
34488
			COMPARATOR_IMPL_JRE8.replace('*', 'V').replace('%', 'U') +
34476
			"}", // =================
34489
			"}", // =================
34477
34490
34478
		},
34491
		},
Lines 36904-36909 Link Here
36904
			"\n" +
36917
			"\n" +
36905
			"class SerializableList extends LinkedList<Serializable> {\n" +
36918
			"class SerializableList extends LinkedList<Serializable> {\n" +
36906
			"	private static final long serialVersionUID = 1L; \n" +
36919
			"	private static final long serialVersionUID = 1L; \n" +
36920
			STREAM_OVERRIDE_IMPL_JRE8.replaceAll("\\*", "Serializable") +
36907
			"}\n" +
36921
			"}\n" +
36908
			"public class X {\n" +
36922
			"public class X {\n" +
36909
			"    @SuppressWarnings({\"nls\", \"unused\"})\n" +
36923
			"    @SuppressWarnings({\"nls\", \"unused\"})\n" +
Lines 36921-36942 Link Here
36921
			"}\n", // =================
36935
			"}\n", // =================
36922
		},
36936
		},
36923
		"----------\n" +
36937
		"----------\n" +
36924
		"1. WARNING in X.java (at line 13)\n" +
36938
		"1. WARNING in X.java (at line 15)\n" +
36925
		"	java.util.List<String> b = (LinkedList<String>) a; // unchecked\n" +
36939
		"	java.util.List<String> b = (LinkedList<String>) a; // unchecked\n" +
36926
		"	                           ^^^^^^^^^^^^^^^^^^^^^^\n" +
36940
		"	                           ^^^^^^^^^^^^^^^^^^^^^^\n" +
36927
		"Type safety: Unchecked cast from List<capture#1-of ? extends Serializable> to LinkedList<String>\n" +
36941
		"Type safety: Unchecked cast from List<capture#1-of ? extends Serializable> to LinkedList<String>\n" +
36928
		"----------\n" +
36942
		"----------\n" +
36929
		"2. WARNING in X.java (at line 14)\n" +
36943
		"2. WARNING in X.java (at line 16)\n" +
36930
		"	java.util.List<Integer> c = (LinkedList<Integer>) a; // unchecked\n" +
36944
		"	java.util.List<Integer> c = (LinkedList<Integer>) a; // unchecked\n" +
36931
		"	                            ^^^^^^^^^^^^^^^^^^^^^^^\n" +
36945
		"	                            ^^^^^^^^^^^^^^^^^^^^^^^\n" +
36932
		"Type safety: Unchecked cast from List<capture#2-of ? extends Serializable> to LinkedList<Integer>\n" +
36946
		"Type safety: Unchecked cast from List<capture#2-of ? extends Serializable> to LinkedList<Integer>\n" +
36933
		"----------\n" +
36947
		"----------\n" +
36934
		"3. WARNING in X.java (at line 15)\n" +
36948
		"3. WARNING in X.java (at line 17)\n" +
36935
		"	java.util.List<Runtime> d = (LinkedList<Runtime>) a; // inconvertible / unchecked ?\n" +
36949
		"	java.util.List<Runtime> d = (LinkedList<Runtime>) a; // inconvertible / unchecked ?\n" +
36936
		"	                            ^^^^^^^^^^^^^^^^^^^^^^^\n" +
36950
		"	                            ^^^^^^^^^^^^^^^^^^^^^^^\n" +
36937
		"Type safety: Unchecked cast from List<capture#3-of ? extends Serializable> to LinkedList<Runtime>\n" +
36951
		"Type safety: Unchecked cast from List<capture#3-of ? extends Serializable> to LinkedList<Runtime>\n" +
36938
		"----------\n" +
36952
		"----------\n" +
36939
		"4. ERROR in X.java (at line 18)\n" +
36953
		"4. ERROR in X.java (at line 20)\n" +
36940
		"	Zork z;\n" +
36954
		"	Zork z;\n" +
36941
		"	^^^^\n" +
36955
		"	^^^^\n" +
36942
		"Zork cannot be resolved to a type\n" +
36956
		"Zork cannot be resolved to a type\n" +
Lines 46756-46761 Link Here
46756
				"	class Inter {\n" + 
46770
				"	class Inter {\n" + 
46757
				"		private class Private {}\n" + 
46771
				"		private class Private {}\n" + 
46758
				"	}\n" + 
46772
				"	}\n" + 
46773
				STREAM_OVERRIDE_IMPL_JRE8.replaceAll("\\*", "X.Inter.Private") +
46759
				"	Inter.Private field;\n" + 
46774
				"	Inter.Private field;\n" + 
46760
				"}\n", // =================
46775
				"}\n", // =================
46761
			},
46776
			},
Lines 49725-49730 Link Here
49725
				"			public boolean hasNext() {\n" + 
49740
				"			public boolean hasNext() {\n" + 
49726
				"				return false;\n" + 
49741
				"				return false;\n" + 
49727
				"			}\n" + 
49742
				"			}\n" + 
49743
				ITERATOR_RAW_IMPL_JRE8 +
49728
				"		};\n" + 
49744
				"		};\n" + 
49729
				"	}\n" + 
49745
				"	}\n" + 
49730
				"	Zork z;\n" +
49746
				"	Zork z;\n" +
Lines 49756-49762 Link Here
49756
			"	                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
49772
			"	                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
49757
			"Unnecessary cast from Iterator to Iterator<String>\n" + 
49773
			"Unnecessary cast from Iterator to Iterator<String>\n" + 
49758
			"----------\n" + 
49774
			"----------\n" + 
49759
			"6. ERROR in X.java (at line 36)\n" + 
49775
			"6. ERROR in X.java (at line 37)\n" + 
49760
			"	Zork z;\n" + 
49776
			"	Zork z;\n" + 
49761
			"	^^^^\n" + 
49777
			"	^^^^\n" + 
49762
			"Zork cannot be resolved to a type\n" + 
49778
			"Zork cannot be resolved to a type\n" + 
(-)a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java (-2 / +1 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2012 IBM Corporation and others.
2
 * Copyright (c) 2000, 2013 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 1823-1829 Link Here
1823
				"public class X extends java.util.AbstractMap {\n" +
1823
				"public class X extends java.util.AbstractMap {\n" +
1824
				"	public java.util.Set entrySet() { return null; }\n" +
1824
				"	public java.util.Set entrySet() { return null; }\n" +
1825
				MAP_RAW_IMPL_JRE8 +
1825
				MAP_RAW_IMPL_JRE8 +
1826
				MAP_STREAM_RAW_IMPL_JRE8 +
1827
				"}\n"
1826
				"}\n"
1828
			},
1827
			},
1829
			""
1828
			""
(-)a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/VarargsTest.java (-3 / +8 lines)
Lines 1-9 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2005, 2012 IBM Corporation and others.
2
 * Copyright (c) 2005, 2013 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 * 
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
7
 * 
11
 * 
8
 * Contributors:
12
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
13
 *     IBM Corporation - initial API and implementation
Lines 2478-2483 Link Here
2478
					"        public void remove() {\n" +
2482
					"        public void remove() {\n" +
2479
					"            throw new UnsupportedOperationException();\n" +
2483
					"            throw new UnsupportedOperationException();\n" +
2480
					"        }\n" +
2484
					"        }\n" +
2485
					ITERATOR_IMPL_JRE8.replaceAll("\\*", "T") +
2481
					"    }\n" +
2486
					"    }\n" +
2482
					"    public static void main(String[] args) {\n" +
2487
					"    public static void main(String[] args) {\n" +
2483
					"        new IteratorChain<Number>(null, null);\n" +
2488
					"        new IteratorChain<Number>(null, null);\n" +
Lines 2486-2492 Link Here
2486
				},
2491
				},
2487
				this.complianceLevel < ClassFileConstants.JDK1_7 ?
2492
				this.complianceLevel < ClassFileConstants.JDK1_7 ?
2488
				"----------\n" + 
2493
				"----------\n" + 
2489
				"1. WARNING in X.java (at line 18)\n" + 
2494
				"1. WARNING in X.java (at line 19)\n" + 
2490
				"	new IteratorChain<Number>(null, null);\n" + 
2495
				"	new IteratorChain<Number>(null, null);\n" + 
2491
				"	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
2496
				"	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
2492
				"Type safety: A generic array of Collection<? extends Number> is created for a varargs parameter\n" + 
2497
				"Type safety: A generic array of Collection<? extends Number> is created for a varargs parameter\n" + 
Lines 2497-2503 Link Here
2497
				"	                                                                                                       ^^^^^^^^^^^\n" + 
2502
				"	                                                                                                       ^^^^^^^^^^^\n" + 
2498
				"Type safety: Potential heap pollution via varargs parameter collections\n" + 
2503
				"Type safety: Potential heap pollution via varargs parameter collections\n" + 
2499
				"----------\n" + 
2504
				"----------\n" + 
2500
				"2. WARNING in X.java (at line 18)\n" + 
2505
				"2. WARNING in X.java (at line 19)\n" + 
2501
				"	new IteratorChain<Number>(null, null);\n" + 
2506
				"	new IteratorChain<Number>(null, null);\n" + 
2502
				"	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
2507
				"	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
2503
				"Type safety: A generic array of Collection<? extends Number> is created for a varargs parameter\n" + 
2508
				"Type safety: A generic array of Collection<? extends Number> is created for a varargs parameter\n" + 

Return to bug 396139