Community
Participate
Working Groups
This applies to 3.1.1 and 3.2 M4. in the example below use quickfix where indicated to create a local variable called "ans" and notice that it creates a List<B> instead of List<Integer>: ------------------------------------------------------ import java.util.List; public abstract class A { abstract List<B> getB(); void m() { for (B b : getB()) { for (Integer i : b.getI()) { ans.add(i); //quickfix here } } } } interface B { List<Integer> getI(); } ---------------------------------------------------------------------
Guessing of the correct variable type is a difficult thing anyways. Our trick is that we look at all existing types available in the current file. Here 'List<Integer>' seems to be around, so it should find that one.