code: public static String canonicalName(Class c) {
          try {
              return c.getCanonicalName();
          } catch (InternalError e) {
              return null;
          } catch (IllegalAccessError e) {
              return null;
          }
      }
docs: Java {@code Class.getCanonicalName()} sometimes will throw out
  {@code InternalError} with message: "{code Malformed class name}"
  We just ignore it
  @param c the class on which canonical name is returned
  @return the canonical name of the class specified or {@code null} if no
  canonical name found or error returned canonical name on the class