Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8093509

FXMLLoader fails to load a type and throws ClassNotFoundException if the classname starts with a lowercase letter

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 7u51
    • javafx
    • None

      The FXMLLoader fails to load any type when its classname starts with a lowercase letter.
      Inspection of method FXMLLoader.loadType(String,boolean) reveals a faulty algorithm to split the package name from the classname by finding the first dot followed by an uppercase letter.

      Naming classes in UpperCamelCase is a convention, not required, so FXMLLoader should not depend on it.
      I discovered this because ProGuard obfuscates many classnames to start with lowercase letters.

      For now, we are working around the problem by preventing ProGuard from obfuscating the affected classnames.
      If it were not for this issue, I believe that we could allow obfuscation of the classnames, because we also make ProGuard adapt the classnames where they appear in our FXML files.

      (JIRA configuration note: 2.2.51 appears under "Unreleased Versions" in the Affects Version/s dropdown at the time I am submitting this issue, but I believe it is the released version in JDK 1.7.0_51.)

            msladecek Martin Sládeček
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: