hi,someone plz tell if thr is any syntax error in the following code-
Code:public LinkedList findOrdersForProduct(Product p, boolean debug) { ArrayList l = new ArrayList(); ArrayList list = getAllOrders(); for (int i=0; i<list.size(); i++) { Order order = (Order) list.get(0); boolean found = false; if (order.getProducts().size() > 0) { for (int j=0; j<=order.getProducts().size(); j++) { Product p2 = order.getProducts().get(j); found = (p2 == p); } if (found && order != null) l.add(order); } } return new LinkedList(l); }


Reply With Quote


Bookmarks