Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix use of non-localized String.toLowerCase() issue #1775

Merged
merged 1 commit into from
Jan 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.SQLException;
import java.util.Locale;
import javax.sql.DataSource;

/**
Expand Down Expand Up @@ -80,7 +81,7 @@ private Connection initConnection() {
String databaseProductName = databaseMetaData.getDatabaseProductName();
// DB2 product name changes with the specific versions(For an example DB2/LINUXX8664, DB2/NT). Hence, checks
// whether the product name contains "DB2".
if (databaseProductName.toLowerCase().contains(DB2_DB_TYPE.toLowerCase())) {
if (databaseProductName.toLowerCase(Locale.ENGLISH).contains(DB2_DB_TYPE.toLowerCase(Locale.ENGLISH))) {
databaseProductName = DB2_DB_TYPE;
}
queryManager = new QueryManager(databaseProductName, databaseMetaData.getDatabaseProductVersion(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public DataProvider init(String topic, String sessionId, JsonElement jsonElement
String databaseVersion = connection.getMetaData().getDatabaseProductVersion();
// DB2 product name changes with the specific versions(For an example DB2/LINUXX8664, DB2/NT). Hence, checks
// whether the product name contains "DB2".
if (databaseName.toLowerCase().contains(DB2_DB_TYPE.toLowerCase())) {
if (databaseName.toLowerCase(Locale.ENGLISH).contains(DB2_DB_TYPE.toLowerCase(Locale.ENGLISH))) {
databaseName = DB2_DB_TYPE;
}
RDBMSQueryManager rdbmsQueryManager = new RDBMSQueryManager(databaseName, databaseVersion);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.wso2.carbon.streaming.integrator.core.persistence.query.QueryManager;

import java.io.IOException;
import java.util.Locale;

/**
* Class used to get Database queries according to RDBMS type used.
Expand All @@ -50,7 +51,7 @@ public RDBMSQueryConfigurationEntry getDatabaseQueryEntries(String databaseType,
RDBMSQueryConfigurationEntry databaseQueryEntries = new RDBMSQueryConfigurationEntry();
// DB2 product name changes with the specific versions(For an example DB2/LINUXX8664, DB2/NT). Hence, checks
// whether the product name contains "DB2".
if (databaseType.toLowerCase().contains(DB2_DB_TYPE)) {
if (databaseType.toLowerCase(Locale.ENGLISH).contains(DB2_DB_TYPE)) {
databaseType = DB2_DB_TYPE;
}
try {
Expand Down