public void visitAnyMember(Clazz clazz, Member member) {
    // Special cases: <clinit> and <init> are always kept unchanged.
    // We can ignore them here.
    String name = member.getName(clazz);
    if (name.equals(ClassConstants.INTERNAL_METHOD_NAME_CLINIT)
        || name.equals(ClassConstants.INTERNAL_METHOD_NAME_INIT)) {
      return;
    }

    // Get the member's new name.
    String newName = MemberObfuscator.newMemberName(member);

    // Remember it, if it has already been set.
    if (newName != null) {
      // Get the member's descriptor.
      String descriptor = member.getDescriptor(clazz);

      // Check whether we're allowed to do aggressive overloading
      if (!allowAggressiveOverloading) {
        // Trim the return argument from the descriptor if not.
        // Works for fields and methods alike.
        descriptor = descriptor.substring(0, descriptor.indexOf(')') + 1);
      }

      // Put the [descriptor - new name] in the map,
      // creating a new [new name - old name] map if necessary.
      Map nameMap = MemberObfuscator.retrieveNameMap(descriptorMap, descriptor);

      // Isn't there another original name for this new name, or should
      // this original name get priority?
      String otherName = (String) nameMap.get(newName);
      if (otherName == null
          || MemberObfuscator.hasFixedNewMemberName(member)
          || name.compareTo(otherName) < 0) {
        // Remember not to use the new name again in this name space.
        nameMap.put(newName, name);
      }
    }
  }
 public void visitProgramField(ProgramClass programClass, ProgramField programField) {
   String newName = MemberObfuscator.newMemberName(programField);
   if (newName != null) {
     ps.println(
         "    "
             +
             // lineNumberRange(programClass, programField) +
             ClassUtil.externalFullFieldDescription(
                 0, programField.getName(programClass), programField.getDescriptor(programClass))
             + " -> "
             + newName);
   }
 }
  public void visitProgramMethod(ProgramClass programClass, ProgramMethod programMethod) {
    // Special cases: <clinit> and <init> are always kept unchanged.
    // We can ignore them here.
    String name = programMethod.getName(programClass);
    if (name.equals(ClassConstants.INTERNAL_METHOD_NAME_CLINIT)
        || name.equals(ClassConstants.INTERNAL_METHOD_NAME_INIT)) {
      return;
    }

    String newName = MemberObfuscator.newMemberName(programMethod);
    if (newName != null) {
      ps.println(
          "    "
              + lineNumberRange(programClass, programMethod)
              + ClassUtil.externalFullMethodDescription(
                  programClass.getName(),
                  0,
                  programMethod.getName(programClass),
                  programMethod.getDescriptor(programClass))
              + " -> "
              + newName);
    }
  }