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

TextLayout handling of empty strings

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3 P3
    • None
    • 1.2.0
    • client-libs
    • 2d
    • Fix Understood
    • x86, sparc
    • solaris_2.5.1, solaris_2.6, windows_nt

      TextLayout should deal more gracefully with zero length strings. Currently the exception listed below is the one that is thrown.

      new TextLayout("", f, new FontRenderContext(null, false, false));

      > Exception in thread "main" java.lang.IllegalArgumentException: Zero length
      > string passed to TextLayout constructor.
      > at java.lang.Throwable.<init>(Compiled Code)
      > at java.lang.Exception.<init>(Compiled Code)
      > at java.lang.RuntimeException.<init>(Compiled Code)
      > at java.lang.IllegalArgumentException.<init>(Compiled Code)
      > at java.awt.font.TextLayout.<init>(Compiled Code)
      > at test.main(Compiled Code)

            dougfelt Doug Felt
            blichtensunw Brian Lichtenwalter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: