Community
Participate
Working Groups
package xy; import java.util.Collection; import java.util.List; public class Try { void foo(Object[] array, List list, Collection<Object> coll) { for (String string : array) { } for (String string : list) { } for (String string : coll) { } } } For each "Type mismatch: cannot convert from element type Object to String" error, there should be a quick fix (with high relevance): - Change type of 'string' to 'Object' If applicable, also offer this quick fix: - Change type of 'array/list/coll' to 'String[]/List<String>/Collection<String>' The first two cases should also offer: - Add cast to 'String[]'/'List<String>'
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.
(In reply to Markus Keller from comment #0) > For each "Type mismatch: cannot convert from element type Object to String" > error, there should be a quick fix (with high relevance): > - Change type of 'string' to 'Object' This one now exists. Still missing: > If applicable, also offer this quick fix: > - Change type of 'array/list/coll' to > 'String[]/List<String>/Collection<String>' > > The first two cases should also offer: > - Add cast to 'String[]'/'List<String>'