-
Enhancement
-
Resolution: Unresolved
-
P5
-
None
-
6
-
x86
-
windows_xp
A DESCRIPTION OF THE REQUEST :
JTable.CellEditorRemover.propertyChange requires Boolean.TRUE to be used when atempting to set the "terminateEditOnFocusLost" client property to true. You can't pass new Boolean(true) even though new Boolean(true).equals(Boolean.TRUE).
Line 5891 of JTable.java from JDK 1.6.0_05 looks like this...
if (!isEditing() || getClientProperty("terminateEditOnFocusLost") != Boolean.TRUE) {
It would be "friendlier" if it were...
if (!isEditing() || getClientProperty("terminateEditOnFocusLost").equals( Boolean.TRUE)) {
JUSTIFICATION :
You can't pass new Boolean(true) when setting the "terminateEditOnFocusLost" client property. If you do pass new Boolean(true), it is an extraordinarily diffcult problem to find because new Boolean(true).equals(Boolean.TRUE) but new Boolean(true) != Boolean.TRUE. The intent of the property is a simple boolean so it is reasonable to expect that setClientProperty("terminateEditOnFocusLost", new Boolean(true)) would work.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Allow setClientProperty("terminateEditOnFocusLost", new Boolean(true)) to produce the same behavior as setClientProperty("terminateEditOnFocusLost", Boolean.TRUE).
ACTUAL -
setClientProperty("terminateEditOnFocusLost", new Boolean(true)) is _essentially_ equal to setClientProperty("terminateEditOnFocusLost", Boolean.FALSE).
---------- BEGIN SOURCE ----------
/*
In the spirit of being as brief as possible, I'll defer to the content I have provided in the rest of this report
*/
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Use setClientProperty("terminateEditOnFocusLost", Boolean.TRUE)
JTable.CellEditorRemover.propertyChange requires Boolean.TRUE to be used when atempting to set the "terminateEditOnFocusLost" client property to true. You can't pass new Boolean(true) even though new Boolean(true).equals(Boolean.TRUE).
Line 5891 of JTable.java from JDK 1.6.0_05 looks like this...
if (!isEditing() || getClientProperty("terminateEditOnFocusLost") != Boolean.TRUE) {
It would be "friendlier" if it were...
if (!isEditing() || getClientProperty("terminateEditOnFocusLost").equals( Boolean.TRUE)) {
JUSTIFICATION :
You can't pass new Boolean(true) when setting the "terminateEditOnFocusLost" client property. If you do pass new Boolean(true), it is an extraordinarily diffcult problem to find because new Boolean(true).equals(Boolean.TRUE) but new Boolean(true) != Boolean.TRUE. The intent of the property is a simple boolean so it is reasonable to expect that setClientProperty("terminateEditOnFocusLost", new Boolean(true)) would work.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Allow setClientProperty("terminateEditOnFocusLost", new Boolean(true)) to produce the same behavior as setClientProperty("terminateEditOnFocusLost", Boolean.TRUE).
ACTUAL -
setClientProperty("terminateEditOnFocusLost", new Boolean(true)) is _essentially_ equal to setClientProperty("terminateEditOnFocusLost", Boolean.FALSE).
---------- BEGIN SOURCE ----------
/*
In the spirit of being as brief as possible, I'll defer to the content I have provided in the rest of this report
*/
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Use setClientProperty("terminateEditOnFocusLost", Boolean.TRUE)