Esempio n. 1
0
  private static boolean cullMethods(boolean found) {
    for (ByteCodeClass bc : classes) {
      bc.unmark();
      if (bc.isIsInterface() || bc.getBaseClass() == null) {
        continue;
      }
      for (BytecodeMethod mtd : bc.getMethods()) {
        if (mtd.isEliminated()
            || mtd.isUsedByNative()
            || mtd.isMain()
            || mtd.getMethodName().equals("__CLINIT__")
            || mtd.getMethodName().equals("finalize")
            || mtd.isNative()) {
          continue;
        }

        if (!isMethodUsed(mtd)) {
          if (isMethodUsedByBaseClassOrInterface(mtd, bc)) {
            continue;
          }
          found = true;
          mtd.setEliminated(true);
          /*if(ByteCodeTranslator.verbose) {
          System.out.println("Eliminating method: " + mtd.getClsName() + "." + mtd.getMethodName());
          }*/
        }
      }
    }
    return found;
  }