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

HTMLEditorKit$HTMLFactory.create(...) throws Error instead of RuntimeException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.3.0
    • client-libs
    • beta
    • generic
    • generic



      Name: krT82822 Date: 03/12/2000


      (1.2.2 and kestrel-rc1)

      At lines 909, 930, and 934 (of the v1.2.2 source) the code throws an Error
      object. Since Errors are not subclasses of RuntimeExceptions, they are very
      nasty to catch. Besides, your Errors for invalid HTML are hardly worthy of the
      importance associated with ThreadDeath, VirtualMachineError, and
      ClassFormatError.

      Here is a partial trace of when I found this nasty peice of code:

      java.lang.Error: Can't build a BranchElement(section) 0,48
      at javax.swing.text.html.HTMLEditorKit$HTMLFactory.create
      (HTMLEditorKit.java:934)
      at javax.swing.plaf.basic.BasicTextUI.modelChanged(BasicTextUI.java:372)
      at javax.swing.plaf.basic.BasicTextUI$UpdateHandler.propertyChange
      (BasicTextUI.java:1382)
      at javax.swing.event.SwingPropertyChangeSupport.firePropertyChange
      (SwingPropertyChangeSupport.java:154)
      at javax.swing.JComponent.firePropertyChange(JComponent.java:3023)
      at javax.swing.text.JTextComponent.setDocument(JTextComponent.java:651)
      at javax.swing.JTextPane.setDocument(JTextPane.java:95)

      I recommend adding an InvalidHTMLException extends RuntimeException for this.
      (Review ID: 102090)
      ======================================================================

            svioletsunw Scott Violet (Inactive)
            kryansunw Kevin Ryan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: