mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8214971: Replace use of string.equals("") with isEmpty()
Reviewed-by: jlaskey, prappo, lancea, dfuchs, redestad
This commit is contained in:
parent
df5b42f33b
commit
938b844088
95 changed files with 195 additions and 195 deletions
|
@ -593,7 +593,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
|
|||
|
||||
super.setCommand(cmd);
|
||||
|
||||
if(!buildTableName(cmd).equals("")) {
|
||||
if(!buildTableName(cmd).isEmpty()) {
|
||||
this.setTableName(buildTableName(cmd));
|
||||
}
|
||||
}
|
||||
|
@ -7069,7 +7069,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
|
|||
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());
|
||||
}
|
||||
}
|
||||
|
@ -7124,7 +7124,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
|
|||
*/
|
||||
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
|
||||
|
|
|
@ -624,7 +624,7 @@ public class JdbcRowSetImpl extends BaseRowSet implements JdbcRowSet, Joinable {
|
|||
(getDataSourceName());
|
||||
//return ds.getConnection(getUsername(),getPassword());
|
||||
|
||||
if(getUsername() != null && !getUsername().equals("")) {
|
||||
if(getUsername() != null && !getUsername().isEmpty()) {
|
||||
return ds.getConnection(getUsername(),getPassword());
|
||||
} else {
|
||||
return ds.getConnection();
|
||||
|
@ -3873,7 +3873,7 @@ public class JdbcRowSetImpl extends BaseRowSet implements JdbcRowSet, Joinable {
|
|||
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("jdbcrowsetimpl.matchcols2").toString());
|
||||
}
|
||||
}
|
||||
|
@ -3928,7 +3928,7 @@ public class JdbcRowSetImpl extends BaseRowSet implements JdbcRowSet, Joinable {
|
|||
*/
|
||||
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("jdbcrowsetimpl.matchcols2").toString());
|
||||
} else {
|
||||
// set strMatchColumn
|
||||
|
|
|
@ -537,7 +537,7 @@ public class WebRowSetXmlWriter implements XmlWriter, Serializable {
|
|||
private void writeStringData(String s) throws java.io.IOException {
|
||||
if (s == null) {
|
||||
writeNull();
|
||||
} else if (s.equals("")) {
|
||||
} else if (s.isEmpty()) {
|
||||
writeEmptyString();
|
||||
} else {
|
||||
|
||||
|
|
|
@ -852,7 +852,7 @@ public abstract class BaseRowSet implements Serializable, Cloneable {
|
|||
|
||||
if (name == null) {
|
||||
dataSource = null;
|
||||
} else if (name.equals("")) {
|
||||
} else if (name.isEmpty()) {
|
||||
throw new SQLException("DataSource name cannot be empty string");
|
||||
} else {
|
||||
dataSource = name;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue