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

RuntimeException in CSSParser.readTill

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • 6
    • client-libs

      FULL PRODUCT VERSION :
      1.6.0_01 from Sun Microsystems Inc.

      ADDITIONAL OS VERSION INFORMATION :
      Windows XP 5.1 on x86

      A DESCRIPTION OF THE PROBLEM :
      java.lang.RuntimeException: Unclosed '
          at javax.swing.text.html.CSSParser.readTill(Unknown Source)
          at javax.swing.text.html.CSSParser.nextToken(Unknown Source)
          at javax.swing.text.html.CSSParser.parseIdentifiers(Unknown Source)
          at javax.swing.text.html.CSSParser.parseDeclaration(Unknown Source)
          at javax.swing.text.html.CSSParser.parseDeclarationBlock(Unknown Source)
          at javax.swing.text.html.CSSParser.parseRuleSet(Unknown Source)
          at javax.swing.text.html.CSSParser.getNextStatement(Unknown Source)
          at javax.swing.text.html.CSSParser.parse(Unknown Source)
          at javax.swing.text.html.StyleSheet$CssParser.parse(Unknown Source)
          at javax.swing.text.html.StyleSheet.addRule(Unknown Source)
          at javax.swing.plaf.basic.BasicHTML$BasicDocument.setFontAndColor(Unknown Source)
          at javax.swing.plaf.basic.BasicHTML$BasicDocument.<init>(Unknown Source)
          at javax.swing.plaf.basic.BasicHTML$BasicEditorKit.createDefaultDocument(Unknown Source)
          at javax.swing.plaf.basic.BasicHTML.createHTMLView(Unknown Source)
          at javax.swing.plaf.basic.BasicHTML.updateRenderer(Unknown Source)
          at javax.swing.plaf.basic.BasicLabelUI.installComponents(Unknown Source)
          at javax.swing.plaf.basic.BasicLabelUI.installUI(Unknown Source)
          at javax.swing.JComponent.setUI(Unknown Source)
          at javax.swing.JLabel.setUI(Unknown Source)
          at javax.swing.JLabel.updateUI(Unknown Source)
          at javax.swing.JLabel.<init>(Unknown Source)
          at javax.swing.JLabel.<init>(Unknown Source)
          at com.limegroup.gnutella.gui.URLLabel.<init>(URLLabel.java:53)

      The call in URLLabel() looks like this:

      super("<html><a href=\"" + url + "\">" + display + "</a></html");

      I worked around this problem once before by setting font and foreground color to null so that the css script would be minimal if not empty:

      JLabel label = new JLabel();
      // setting font and color to null to minimize generated css script
      // which causes a parser exception under circumstances
      label.setFont(null);
      label.setForeground(null);
      BasicHTML.createHTMLView(label, "<html>.</html>");

      But this doesn't help in the general case.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Not reproducible.


      REPRODUCIBILITY :
      This bug can be reproduced rarely.

      CUSTOMER SUBMITTED WORKAROUND :
      JLabel label = new JLabel();
      // setting font and color to null to minimize generated css script
      // which causes a parser exception under circumstances
      label.setFont(null);
      label.setForeground(null);
      BasicHTML.createHTMLView(label, "<html>.</html>");

            peterz Peter Zhelezniakov
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: