Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6239484
Votes 0
Synopsis TCK JTextComponent methods throw NullPointerException
Category java:classes_swing
Reported Against
Release Fixed
State 3-Accepted, bug
Priority: 4-Low
Related Bugs
Submit Date 11-MAR-2005
Description
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.
  xxxxx@xxxxx   2005-03-11 14:39:04 GMT
Work Around
N/A
Evaluation
N/A
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang