< prev index next >
src/java.sql.rowset/share/classes/com/sun/rowset/CachedRowSetImpl.java
Print this page
rev 52881 : 8214971: Replace use of string.equals("") with isEmpty()
@@ -591,11 +591,11 @@
*/
public void setCommand(String cmd) throws SQLException {
super.setCommand(cmd);
- if(!buildTableName(cmd).equals("")) {
+ if(!buildTableName(cmd).isEmpty()) {
this.setTableName(buildTableName(cmd));
}
}
@@ -7067,11 +7067,11 @@
* parameter index is out of bounds
*/
public void setMatchColumn(String[] columnNames) throws SQLException {
for(int j = 0; j < columnNames.length; j++) {
- if( columnNames[j] == null || columnNames[j].equals("")) {
+ if( columnNames[j] == null || columnNames[j].isEmpty()) {
throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.matchcols2").toString());
}
}
for( int i = 0; i < columnNames.length; i++) {
strMatchColumns.add(i,columnNames[i]);
@@ -7122,11 +7122,11 @@
* @throws SQLException if an error occurs or the
* parameter index is out of bounds
*/
public void setMatchColumn(String columnName) throws SQLException {
// validate, if col is ok to be set
- if(columnName == null || (columnName= columnName.trim()).equals("") ) {
+ if(columnName == null || (columnName= columnName.trim()).isEmpty() ) {
throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.matchcols2").toString());
} else {
// set strMatchColumn
strMatchColumns.set(0, columnName);
//iMatchColumn = -1;
< prev index next >