mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
Checks for overly complicated boolean return statements.
This commit is contained in:
@@ -73,11 +73,7 @@ public class CharsetConvert {
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean isEmpty(String s) {
|
||||
if (s == null || "".equals(s)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
return s == null || "".equals(s);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -56,11 +56,7 @@ public class CobarFailureDetecter extends DefaultDataSourceFailureDetecter {
|
||||
|
||||
String status = rs.getString(1);
|
||||
|
||||
if ("on".equalsIgnoreCase(status)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
return "on".equalsIgnoreCase(status);
|
||||
} catch (Exception ex) {
|
||||
LOG.error("check datasource valid errror", ex);
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user