code: public static String makeValidJavaClassName(String className) {
  
          StringBuffer result = new StringBuffer(className.length());
          int length = className.length();
          boolean nodot = true;
          for (int i = 0; i < length; i++) {
              char ch = className.charAt(i);
              if (nodot) {
                  if (ch == '.') {
                      // ignore, remove
                  } else if (Character.isJavaIdentifierStart(ch)) {
                      nodot = false;
                      result.append(ch);
                  } else {
                      result.append('_');
                  }
              } else {
                  if (ch == '.') {
                      nodot = true;
                      result.append(ch);
                  } else if (Character.isJavaIdentifierPart(ch)) {
                      nodot = false;
                      result.append(ch);
                  } else {
                      result.append('_');
                  }
              }
          }
          return result.toString();
      }
docs: Generates a (hopefully) valid Java class name from an invalid class name.<p>
  
  All invalid characters are replaced by an underscore "_".
  This is for example used to make sure old (5.0) modules can still be imported,
  by converting the name to a valid class name.<p>
  
  @param className the class name to make valid
  
  @return a valid Java class name from an invalid class name