Anyone know why this works:

public class Test {

    public interface AttributeBinding {

        public Object getAttribute();

        public List<Method> getMethod();

    }

    public static void main(String[] args) throws Exception {
        AttributeBinding binding = null;
        for (Method method : binding.getMethod()) {

        }
    }
}


But this seems to somehow change the List<Method> to plain List and generates a compile error:

public class Test {

    public interface AttributeBinding<A> {

        public A getAttribute();

        public List<Method> getMethod();

    }

    public static void main(String[] args) throws Exception {
        AttributeBinding binding = null;
        for (Method method : binding.getMethod()) {

        }
    }
}


Would love to know what the issue is.

-David

Reply via email to