int start=0;
if (superdesc!=null)
start=numberMethods(superdesc);
+ if(state.MGC) {
+ // TODO add version for normal Java later
+ // check the inherited interfaces
+ Iterator it_sifs = cd.getSuperInterfaces();
+ while(it_sifs.hasNext()) {
+ ClassDescriptor superif = (ClassDescriptor)it_sifs.next();
+ start += numberMethods(superif); // TODO Can there be duplicated methods from multiple ancestors?
+ }
+ }
for(Iterator it=cd.getMethods(); it.hasNext();) {
MethodDescriptor md=(MethodDescriptor)it.next();
if (md.isStatic()||md.getReturnType()==null)
break;
}
}
+ if(state.MGC) {
+ // TODO add version for normal Java later
+ if(!foundmatch) {
+ // check if there is a matched method in inherited interfaces
+ Iterator it_sifs = cd.getSuperInterfaces();
+ while(it_sifs.hasNext() && !foundmatch) {
+ ClassDescriptor superif = (ClassDescriptor)it_sifs.next();
+ Set possiblematches_if=superif.getMethodTable().getSet(md.getSymbol());
+ for(Iterator matchit=possiblematches_if.iterator(); matchit.hasNext();) {
+ MethodDescriptor matchmd=(MethodDescriptor)matchit.next();
+ if (md.matches(matchmd)) {
+ int num=((Integer)methodnumber.get(matchmd)).intValue();
+ methodnumber.put(md, new Integer(num));
+ foundmatch=true;
+ break;
+ }
+ }
+ }
+ }
+ }
if (!foundmatch)
methodnumber.put(md, new Integer(start++));
} else {