9 Replies Latest reply: Aug 12, 2010 5:03 AM by Kayaman RSS

    Vector generics with Lotus Notes View

    843789
      Hello,

      I have a problem with this code:
      /**
        * db = lotus.domino.Database
        * View is from lotus.domino.View
        * /
      List <View> allviews = new ArrayList<View>();//1
      Vector <View> views = new Vector<View>(); //2
      views = db.getViews();//3
      for (Enumeration <View> e = views.elements();e.hasMoreElements();){//4
             allviews.add(e.nextElement());//5
      }//6
      At line 3 I get the well-known warning: "Type safety: the expression of type Vector needs unchecked conversion to conform to Vector<View>". I read about generics, but or i dont understand or ist not possible in this case without warning. Does anybody know how i put the Vector that returns from db.getViews() into the Vector<View> views?

      Chris

      Edited by: chris211789 on Aug 12, 2010 1:22 AM
      db is not a Document but a Database

      Edited by: chris211789 on Aug 12, 2010 1:23 AM