diff options
author | Ahmed Ashour <asashour@yahoo.com> | 2017-10-09 12:49:10 +0200 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-10-09 13:49:10 +0300 |
commit | 9494818412d3f7d9aa9b8817dd6d62bb64963753 (patch) | |
tree | 7d53ae6fb3d1da2da5a47da8460a52980aaea2f4 /compatibility-server | |
parent | 915463b21a339b6bbc741ac1ce325ba209d821c9 (diff) | |
download | vaadin-framework-9494818412d3f7d9aa9b8817dd6d62bb64963753.tar.gz vaadin-framework-9494818412d3f7d9aa9b8817dd6d62bb64963753.zip |
Use StringBuilder instead of StringBuffer (#10154)
Diffstat (limited to 'compatibility-server')
6 files changed, 16 insertions, 16 deletions
diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/RowItem.java b/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/RowItem.java index b7e6a4f38e..3cb4103521 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/RowItem.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/RowItem.java @@ -125,7 +125,7 @@ public final class RowItem implements Item { @Override public String toString() { - StringBuffer s = new StringBuffer(); + StringBuilder s = new StringBuilder(); s.append("ID:"); s.append(getId().toString()); for (Object propId : getItemPropertyIds()) { diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/query/FreeformQuery.java b/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/query/FreeformQuery.java index bc5cfc56a3..4575a51904 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/query/FreeformQuery.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/query/FreeformQuery.java @@ -465,7 +465,7 @@ public class FreeformQuery extends AbstractTransactionalQuery private String modifyWhereClause(Object... keys) { // Build the where rules for the provided keys - StringBuffer where = new StringBuffer(); + StringBuilder where = new StringBuilder(); for (int ix = 0; ix < primaryKeyColumns.size(); ix++) { where.append(QueryBuilder.quote(primaryKeyColumns.get(ix))); if (keys[ix] == null) { diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/query/generator/DefaultSQLGenerator.java b/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/query/generator/DefaultSQLGenerator.java index 3f5c60d8e8..cb02c496b5 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/query/generator/DefaultSQLGenerator.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/query/generator/DefaultSQLGenerator.java @@ -137,7 +137,7 @@ public class DefaultSQLGenerator implements SQLGenerator { throw new IllegalArgumentException("Updated item must be given."); } StatementHelper sh = getStatementHelper(); - StringBuffer query = new StringBuffer(); + StringBuilder query = new StringBuilder(); query.append("UPDATE ").append(tableName).append(" SET"); /* Generate column<->value and rowidentifiers map */ @@ -191,7 +191,7 @@ public class DefaultSQLGenerator implements SQLGenerator { "Cannot generate an insert query for item already in database."); } StatementHelper sh = getStatementHelper(); - StringBuffer query = new StringBuffer(); + StringBuilder query = new StringBuilder(); query.append("INSERT INTO ").append(tableName).append(" ("); /* Generate column<->value map */ @@ -246,7 +246,7 @@ public class DefaultSQLGenerator implements SQLGenerator { "Valid keyColumnNames must be provided."); } StatementHelper sh = getStatementHelper(); - StringBuffer query = new StringBuffer(); + StringBuilder query = new StringBuilder(); query.append("DELETE FROM ").append(tableName).append(" WHERE "); int count = 1; for (String keyColName : primaryKeyColumns) { diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/Label.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/Label.java index 4b8c8ebd6f..273b4433c5 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/ui/Label.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/Label.java @@ -505,7 +505,7 @@ public class Label extends AbstractLegacyComponent implements Property<String>, */ private String stripTags(String xml) { - final StringBuffer res = new StringBuffer(); + final StringBuilder res = new StringBuilder(); int processed = 0; final int xmlLen = xml.length(); diff --git a/compatibility-server/src/test/java/com/vaadin/v7/data/util/sqlcontainer/SQLContainerTest.java b/compatibility-server/src/test/java/com/vaadin/v7/data/util/sqlcontainer/SQLContainerTest.java index 1842b41734..aae3ffd687 100644 --- a/compatibility-server/src/test/java/com/vaadin/v7/data/util/sqlcontainer/SQLContainerTest.java +++ b/compatibility-server/src/test/java/com/vaadin/v7/data/util/sqlcontainer/SQLContainerTest.java @@ -1705,7 +1705,7 @@ public class SQLContainerTest { .getQueryString(); } } else { - StringBuffer query = new StringBuffer( + StringBuilder query = new StringBuilder( "SELECT * FROM people"); if (!orderBys.isEmpty()) { query.append(" ORDER BY "); @@ -1823,7 +1823,7 @@ public class SQLContainerTest { .getQueryString(); } } else { - StringBuffer query = new StringBuffer( + StringBuilder query = new StringBuilder( "SELECT * FROM people"); if (!orderBys.isEmpty()) { query.append(" ORDER BY "); @@ -1911,7 +1911,7 @@ public class SQLContainerTest { @Override public StatementHelper answer() throws Throwable { StatementHelper sh = new StatementHelper(); - StringBuffer query = new StringBuffer( + StringBuilder query = new StringBuilder( "SELECT COUNT(*) FROM people"); if (!filters.isEmpty()) { query.append(QueryBuilder @@ -1982,7 +1982,7 @@ public class SQLContainerTest { @Override public StatementHelper answer() throws Throwable { StatementHelper sh = new StatementHelper(); - StringBuffer query = new StringBuffer( + StringBuilder query = new StringBuilder( "SELECT COUNT(*) FROM people"); if (!filters.isEmpty()) { query.append(QueryBuilder @@ -2052,7 +2052,7 @@ public class SQLContainerTest { @Override public StatementHelper answer() throws Throwable { StatementHelper sh = new StatementHelper(); - StringBuffer query = new StringBuffer( + StringBuilder query = new StringBuilder( "SELECT COUNT(*) FROM people"); if (!filters.isEmpty()) { query.append(QueryBuilder @@ -2123,7 +2123,7 @@ public class SQLContainerTest { @Override public StatementHelper answer() throws Throwable { StatementHelper sh = new StatementHelper(); - StringBuffer query = new StringBuffer( + StringBuilder query = new StringBuilder( "SELECT COUNT(*) FROM people"); if (!filters.isEmpty()) { query.append(QueryBuilder @@ -2200,7 +2200,7 @@ public class SQLContainerTest { @Override public StatementHelper answer() throws Throwable { StatementHelper sh = new StatementHelper(); - StringBuffer query = new StringBuffer( + StringBuilder query = new StringBuilder( "SELECT COUNT(*) FROM people"); if (!filters.isEmpty()) { query.append(QueryBuilder @@ -2277,7 +2277,7 @@ public class SQLContainerTest { @Override public StatementHelper answer() throws Throwable { StatementHelper sh = new StatementHelper(); - StringBuffer query = new StringBuffer( + StringBuilder query = new StringBuilder( "SELECT COUNT(*) FROM people"); if (!filters.isEmpty()) { query.append(QueryBuilder @@ -2408,7 +2408,7 @@ public class SQLContainerTest { .getQueryString(); } } else { - StringBuffer query = new StringBuffer( + StringBuilder query = new StringBuilder( "SELECT * FROM people"); if (!orderBys.isEmpty()) { query.append(" ORDER BY "); diff --git a/compatibility-server/src/test/java/com/vaadin/v7/data/util/sqlcontainer/TicketTest.java b/compatibility-server/src/test/java/com/vaadin/v7/data/util/sqlcontainer/TicketTest.java index f48524b338..a00961edb5 100644 --- a/compatibility-server/src/test/java/com/vaadin/v7/data/util/sqlcontainer/TicketTest.java +++ b/compatibility-server/src/test/java/com/vaadin/v7/data/util/sqlcontainer/TicketTest.java @@ -92,7 +92,7 @@ public class TicketTest { @Override public StatementHelper answer() throws Throwable { StatementHelper sh = new StatementHelper(); - StringBuffer query = new StringBuffer( + StringBuilder query = new StringBuilder( "SELECT COUNT(*) FROM people"); if (!filters.isEmpty()) { query.append(QueryBuilder |