private Vector<ClassDefinition> computeUniqueCatchList(ClassDeclaration[] exceptions){
  Vector<ClassDefinition> uniqueList=new Vector<>();
  uniqueList.addElement(defRuntimeException);
  uniqueList.addElement(defRemoteException);
  nextException:   for (int i=0; i < exceptions.length; i++) {
    ClassDeclaration decl=exceptions[i];
    try {
      if (defException.subClassOf(env,decl)) {
        uniqueList.clear();
        break;
      }
 else       if (!defException.superClassOf(env,decl)) {
        continue;
      }
      for (int j=0; j < uniqueList.size(); ) {
        ClassDefinition def=uniqueList.elementAt(j);
        if (def.superClassOf(env,decl)) {
          continue nextException;
        }
 else         if (def.subClassOf(env,decl)) {
          uniqueList.removeElementAt(j);
        }
 else {
          j++;
        }
      }
      uniqueList.addElement(decl.getClassDefinition(env));
    }
 catch (    ClassNotFound e) {
      env.error(0,"class.not.found",e.name,decl.getName());
    }
  }
  return uniqueList;
}

private Vector < ClassDefinition > computeUniqueCatchList ( ClassDeclaration [ ] exceptions ) { Vector < ClassDefinition > uniqueList = new Vector < > ( ) ; uniqueList . addElement ( defRuntimeException ) ; uniqueList . addElement ( defRemoteException ) ; nextException : for ( int i = 0 ; i < exceptions . length ; i ++ ) { ClassDeclaration decl = exceptions [ i ] ; try { if ( defException . subClassOf ( env , decl ) ) { uniqueList . clear ( ) ; break ; } else if ( ! defException . superClassOf ( env , decl ) ) { continue ; } for ( int j = 0 ; j < uniqueList . size ( ) ; ) { ClassDefinition def = uniqueList . elementAt ( j ) ; if ( def . superClassOf ( env , decl ) ) { continue nextException ; } else if ( def . subClassOf ( env , decl ) ) { uniqueList . removeElementAt ( j ) ; } else { j ++ ; } } uniqueList . addElement ( decl . getClassDefinition ( env ) ) ; } catch ( ClassNotFound e ) { env . error ( 0 , "class.not.found" , e . name , decl . getName ( ) ) ; } } return uniqueList ; }
compute the exceptions which need to be caught and rethrown in a stub method before wrapping exceptions in unexpectedexceptions , given the exceptions declared in the throws clause of the method . returns a vector containing classdefinition objects for each exception to catch . each exception is guaranteed to be unique , i . e . not a subclass of any of the other exceptions in the vector , so the catch blocks for these exceptions may be generated in any order relative to each other . remoteexception and runtimeexception are each automatically placed in the returned vector ( if none of their superclasses are already present ) , since those exceptions should always be directly rethrown by a stub method . the returned vector will be empty if java . lang . exception or one of its superclasses is in the throws clause of the method , indicating that no exceptions need to be caught .
