Update of /cvsroot/squirrel-sql/sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31110
Modified Files:
ClobDescriptor.java
Log Message:
adjust to handle all possible null combinations
Index: ClobDescriptor.java
===================================================================
RCS file: /cvsroot/squirrel-sql/sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/ClobDescriptor.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ClobDescriptor.java 4 Feb 2004 20:06:55 -0000 1.1
--- ClobDescriptor.java 6 Apr 2004 19:55:38 -0000 1.2
***************
*** 96,106 ****
*/
public boolean equals(ClobDescriptor c) {
! if (c == null)
! return false;
if (c.getClobRead() == false) {
if (_clobRead == true)
! return false;
! else return true;
}
// the other object has real data
if (_clobRead == false)
--- 96,117 ----
*/
public boolean equals(ClobDescriptor c) {
! if (c == null) {
! // the other obj is null, so see if this non-null obj contains
! // a null value, which is equivilent.
! // Assume that if we have read some of the data and we still have
! // _data == null, then the value in the DB is actually null.
! if (_clobRead == true && _data == null)
! return true;
! else
! return false;
! }
!
if (c.getClobRead() == false) {
+ // the other obj has not read the data yet.
if (_clobRead == true)
! return false; // we have read data, so that is not the same state
! else return true; // odd-ball case: assume if neither has read data that they are equal
}
+
// the other object has real data
if (_clobRead == false)
***************
*** 108,111 ****
--- 119,124 ----
// both have actual data, so compare the strings
+ // Note that if one has read all of the data and the other has read only part
+ // of the data that we will say that they are NOT equal.
return c.getData().equals(_data);
}
***************
*** 119,123 ****
if (_wholeClobRead || _userSetClobLimit > _data.length())
return _data; // we have the whole contents of the CLOB
! else return _data+"[...]"; // tell user the data is truncated
}
else return s_stringMgr.getString("ClobDescriptor.clob");
--- 132,136 ----
if (_wholeClobRead || _userSetClobLimit > _data.length())
return _data; // we have the whole contents of the CLOB
! else return _data+"..."; // tell user the data is truncated
}
else return s_stringMgr.getString("ClobDescriptor.clob");
|