On Jul 1, 2008, at 3:58 PM, David Blevins wrote:

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()) {

       }
   }
}

Eventually got it to work like this, note the added "<?>":


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()) {

       }
   }
}



Reply via email to