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

TCK JTextComponent methods throw NullPointerException

XMLWordPrintable

      Some methods of JTextComponent throw NullPointerException, which is not mentioned in the spec.

      Some of them throw NPE in case of null parameter:
        setDocument(null) (note that by default document is null, but then it's not possible to return to null model)
        public void read(java.io.Reader in, java.lang.Object desc) throws IOException
        public void write(java.io.Writer out) throws IOException
        public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction)
        public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction)

      Other methods throw NPE when document is null:
        public void select(int selectionStart, int selectionEnd)
        public void replaceSelection(java.lang.String content)
        public java.lang.String getSelectedText()
        public int getSelectionStart()
        public void setSelectionStart(int selectionStart)
        public int getSelectionEnd()
        public void setSelectionEnd(int selectionEnd)

      It'll be useful to specify such behavior.
      ###@###.### 2005-03-11 14:39:04 GMT

            Unassigned Unassigned
            aglasman Alexander Glasman (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: