修复JDK15下StringBuilder.isEmpty方法

This commit is contained in:
Redkale
2023-01-04 10:44:50 +08:00
parent abe73c4022
commit 80c04d9645
4 changed files with 9 additions and 9 deletions

View File

@@ -2351,7 +2351,7 @@ public final class Application {
clusterRemovedKeys.forEach(k -> { clusterRemovedKeys.forEach(k -> {
sb.append(ClusterAgent.class.getSimpleName()).append(" skip change '").append(k).append("'\r\n"); sb.append(ClusterAgent.class.getSimpleName()).append(" skip change '").append(k).append("'\r\n");
}); });
if (!sb.isEmpty()) { if (sb.length() > 0) {
logger.log(Level.INFO, sb.toString()); logger.log(Level.INFO, sb.toString());
} }
} }

View File

@@ -77,7 +77,7 @@ public class CacheClusterAgent extends ClusterAgent implements Resourcable {
this.ttls = newTtls; this.ttls = newTtls;
start(); start();
} }
if (!sb.isEmpty()) { if (sb.length() > 0) {
logger.log(Level.INFO, sb.toString()); logger.log(Level.INFO, sb.toString());
} }
} }

View File

@@ -2218,7 +2218,7 @@ public class DataJdbcSource extends DataSqlSource {
} else { } else {
int b = 0; int b = 0;
for (String table : tables) { for (String table : tables) {
if (!union.isEmpty()) { if (union.length() > 0) {
union.append(" UNION ALL "); union.append(" UNION ALL ");
} }
union.append("SELECT ").append(info.getQueryColumns("a", selects)).append(" FROM ").append(table).append(" a").append(joinAndWhere); union.append("SELECT ").append(info.getQueryColumns("a", selects)).append(" FROM ").append(table).append(" a").append(joinAndWhere);

View File

@@ -210,7 +210,7 @@ public abstract class DataSqlSource extends AbstractDataSource implements Functi
} }
} }
afterResourceChange(); afterResourceChange();
if (!sb.isEmpty()) { if (sb.length() > 0) {
logger.log(Level.INFO, sb.toString()); logger.log(Level.INFO, sb.toString());
} }
} }
@@ -2345,7 +2345,7 @@ public abstract class DataSqlSource extends AbstractDataSource implements Functi
int b = 0; int b = 0;
StringBuilder union = new StringBuilder(); StringBuilder union = new StringBuilder();
for (String table : tables) { for (String table : tables) {
if (!union.isEmpty()) { if (union.length() > 0) {
union.append(" UNION ALL "); union.append(" UNION ALL ");
} }
union.append("SELECT a.").append(keySqlColumn).append(", ").append(funcSqlColumn) union.append("SELECT a.").append(keySqlColumn).append(", ").append(funcSqlColumn)
@@ -2465,7 +2465,7 @@ public abstract class DataSqlSource extends AbstractDataSource implements Functi
} else { } else {
StringBuilder union = new StringBuilder(); StringBuilder union = new StringBuilder();
for (String table : tables) { for (String table : tables) {
if (!union.isEmpty()) { if (union.length() > 0) {
union.append(" UNION ALL "); union.append(" UNION ALL ");
} }
String subsql = "SELECT "; String subsql = "SELECT ";
@@ -2663,7 +2663,7 @@ public abstract class DataSqlSource extends AbstractDataSource implements Functi
} else { } else {
StringBuilder union = new StringBuilder(); StringBuilder union = new StringBuilder();
for (String table : tables) { for (String table : tables) {
if (!union.isEmpty()) { if (union.length() > 0) {
union.append(" UNION ALL "); union.append(" UNION ALL ");
} }
union.append("SELECT ").append(info.getQueryColumns("a", selects)).append(" FROM ").append(table).append(" a").append(joinAndWhere); union.append("SELECT ").append(info.getQueryColumns("a", selects)).append(" FROM ").append(table).append(" a").append(joinAndWhere);
@@ -2785,7 +2785,7 @@ public abstract class DataSqlSource extends AbstractDataSource implements Functi
} else { } else {
StringBuilder union = new StringBuilder(); StringBuilder union = new StringBuilder();
for (String table : tables) { for (String table : tables) {
if (!union.isEmpty()) { if (union.length() > 0) {
union.append(" UNION ALL "); union.append(" UNION ALL ");
} }
union.append("SELECT ").append(info.getSQLColumn("a", column)).append(" FROM ").append(table).append(" a").append(joinAndWhere); union.append("SELECT ").append(info.getSQLColumn("a", column)).append(" FROM ").append(table).append(" a").append(joinAndWhere);
@@ -2913,7 +2913,7 @@ public abstract class DataSqlSource extends AbstractDataSource implements Functi
} else { } else {
StringBuilder union = new StringBuilder(); StringBuilder union = new StringBuilder();
for (String table : tables) { for (String table : tables) {
if (!union.isEmpty()) { if (union.length() > 0) {
union.append(" UNION ALL "); union.append(" UNION ALL ");
} }
union.append("SELECT ").append(info.getPrimarySQLColumn("a")).append(" FROM ").append(table).append(" a").append(joinAndWhere); union.append("SELECT ").append(info.getPrimarySQLColumn("a")).append(" FROM ").append(table).append(" a").append(joinAndWhere);