comparison src/main/java/nl/cwi/monetdb/jdbc/MonetConnection.java @ 8:a27ee2cb14a0

Replace String methods equals("") and "".equals( with isEmpty()
author Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
date Thu, 29 Sep 2016 15:29:42 +0200 (2016-09-29)
parents a5a898f6886c
children 5ec116ba7d71
comparison
equal deleted inserted replaced
7:b3ca1157be73 8:a27ee2cb14a0
177 sockTimeout = Integer.parseInt(props.getProperty("so_timeout")); 177 sockTimeout = Integer.parseInt(props.getProperty("so_timeout"));
178 } catch (NumberFormatException e) { 178 } catch (NumberFormatException e) {
179 sockTimeout = 0; 179 sockTimeout = 0;
180 } 180 }
181 // check input arguments 181 // check input arguments
182 if (hostname == null || hostname.trim().equals("")) 182 if (hostname == null || hostname.trim().isEmpty())
183 throw new IllegalArgumentException("hostname should not be null or empty"); 183 throw new IllegalArgumentException("hostname should not be null or empty");
184 if (port == 0) 184 if (port == 0)
185 throw new IllegalArgumentException("port should not be 0"); 185 throw new IllegalArgumentException("port should not be 0");
186 if (username == null || username.trim().equals("")) 186 if (username == null || username.trim().isEmpty())
187 throw new IllegalArgumentException("user should not be null or empty"); 187 throw new IllegalArgumentException("user should not be null or empty");
188 if (password == null || password.trim().equals("")) 188 if (password == null || password.trim().isEmpty())
189 throw new IllegalArgumentException("password should not be null or empty"); 189 throw new IllegalArgumentException("password should not be null or empty");
190 if (language == null || language.trim().equals("")) { 190 if (language == null || language.trim().isEmpty()) {
191 language = "sql"; 191 language = "sql";
192 addWarning("No language given, defaulting to 'sql'", "M1M05"); 192 addWarning("No language given, defaulting to 'sql'", "M1M05");
193 } 193 }
194 194
195 // initialise query templates (filled later, but needed below) 195 // initialise query templates (filled later, but needed below)
1114 * output parameter values have been retrieved. 1114 * output parameter values have been retrieved.
1115 * 1115 *
1116 * NOTE: If this method is called during a transaction, the 1116 * NOTE: If this method is called during a transaction, the
1117 * transaction is committed. 1117 * transaction is committed.
1118 * 1118 *
1119 * @param autoCommit true to enable auto-commit mode; false to disable it 1119 * @param autoCommit true to enable auto-commit mode; false to disable it
1120 * @throws SQLException if a database access error occurs 1120 * @throws SQLException if a database access error occurs
1121 * @see #getAutoCommit() 1121 * @see #getAutoCommit()
1122 */ 1122 */
1123 @Override 1123 @Override
1124 public void setAutoCommit(boolean autoCommit) throws SQLException { 1124 public void setAutoCommit(boolean autoCommit) throws SQLException {