code: private void checkDuplicates() throws Failure {
          int i;
          Variable v;
          String name;
  
          for (i = 0; i < vars.length; i++) {
              v = vars[i];
              name = v.getName();
              if (lookup(name) != v) {
                  throw new Failure("duplicate variable name: " + name);
              }
          }
      }
docs: Throws Failure if there are multiple variables with the same name.