-
Bug
-
Resolution: Won't Fix
-
P3
-
None
-
1.4.0
-
sparc
-
solaris_2.6
Name: aaR10142 Date: 07/13/2000
javax.swing.table.DefaultTableModel.moveRow() method doc and behavior
was changed.
jdk1.3 javadoc says:"
public void moveRow(int startIndex,
int endIndex,
int toIndex)
Moves one or more rows starting at startIndex to endIndex in the model to the toIndex. This method will send a
tableChanged notification message to all the listeners.
Examples of moves:
1. moveRow(1,3,5);
a|B|C|D|e|f|g|h|i|j|k - before
a|e|f|B|C|D|g|h|i|j|k - after
" ^^^^^
jdk1.4 javadoc says:"
public void moveRow(int start,
int end,
int to)
Moves one or more rows from the inlcusive range start to end to the to position in the model. After the move, the
row that was at index start will be at index to. This method will send a tableChanged notification message to all
the listeners.
Examples of moves:
1. moveRow(1,3,5);
a|B|C|D|e|f|g|h|i|j|k - before
a|e|f|g|h|B|C|D|i|j|k - after
" ^^^^^
An interpretation of the toIndex parameter was changed.
See javadoc example for illustration.
The next problem is in the "Throws" section
jdk1.3 javadoc says:"
Throws:
ArrayIndexOutOfBoundsException - if any of the indices are out of range; or if endIndex is less than
startIndex
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
jdk1.4 javadoc says:"
Throws:
ArrayIndexOutOfBoundsException - if any of the elements would be moved out of the table's range
"
The new doc lost the sentense "or if endIndex is less than startIndex" so the
new behavior for this case is unspecified.
Please send out the ccc request and update doc, or change behavior and doc back.
======================================================================