if (bestmd==null)
throw new Error("No method found for :"+min.printNode(0));
min.setMethod(bestmd);
+
+ if ((td!=null)&&(min.getType()!=null)&&!typeutil.isSuperorType(td, min.getType()))
+ throw new Error(min.getType()+ " is not equal to or a subclass of "+td);
/* Check whether we need to set this parameter to implied this */
if (!bestmd.isStatic()) {
if (min.getExpression()==null) {
if (map.containsKey(name) == false) {
map.put(name, newitem);
} else {
- ItemInfo i = map.get(name);
+ ItemInfo i = (ItemInfo) map.get(name);
i.quantity += quantity;
i.price = price;
map.put(name, i);
System.printString("Error - Item does not exist");
return -1;
} else {
- ItemInfo i = map.get(name);
+ ItemInfo i = (ItemInfo) map.get(name);
if (i.quantity == 0) {
System.printString("Error - Item unavailable");
return -1;
while (i.hasNext() == true) {
Object o = i.next();
String name = o.toString();
- ItemInfo oo = j.next();
+ ItemInfo oo = (ItemInfo) j.next();
sb.append(name);
sb.append(" ");
Integer q = new Integer(oo.quantity);