diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/JdbcValueHandler.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/JdbcValueHandler.java index 8a680e9850..9d8b469b55 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/JdbcValueHandler.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/JdbcValueHandler.java @@ -31,6 +31,7 @@ import java.sql.SQLException; import java.sql.Timestamp; import java.sql.Types; import java.util.HashMap; +import java.util.Locale; import java.util.Map; import javax.sql.rowset.serial.SerialBlob; @@ -181,8 +182,8 @@ public abstract class JdbcValueHandler { } protected static String parseSqlType(String sqlType) { - String result = sqlType.toUpperCase(); - int pos = result.indexOf("("); + String result = sqlType.toUpperCase(Locale.getDefault()); + int pos = result.indexOf('('); if (pos != -1) { result = result.substring(0, pos); } diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/SQLProcessor.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/SQLProcessor.java index 5325c6a34c..af911dc2de 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/SQLProcessor.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/SQLProcessor.java @@ -56,9 +56,9 @@ public class SQLProcessor implements AutoCloseable { public static final String module = SQLProcessor.class.getName(); /** Used for testing connections when test is enabled */ - public static List CONNECTION_TEST_LIST = new ArrayList(); - public static int MAX_CONNECTIONS = 1000; - public static boolean ENABLE_TEST = false; + private static final List CONNECTION_TEST_LIST = new ArrayList(); + public static final int MAX_CONNECTIONS = 1000; + public static final boolean ENABLE_TEST = false; private final Delegator delegator; diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/SqlJdbcUtil.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/SqlJdbcUtil.java index dca75815f0..92c5f6a3a7 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/SqlJdbcUtil.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/SqlJdbcUtil.java @@ -225,10 +225,8 @@ public final class SqlJdbcUtil { ModelViewEntity.ViewEntityCondition viewEntityCondition = viewLink.getViewEntityCondition(); if (viewEntityCondition != null) { EntityCondition whereCondition = viewEntityCondition.getWhereCondition(modelFieldTypeReader, null); - if (whereCondition != null) { - condBuffer.append(" AND "); - condBuffer.append(whereCondition.makeWhereString(modelEntity, null, datasourceInfo)); - } + condBuffer.append(" AND "); + condBuffer.append(whereCondition.makeWhereString(modelEntity, null, datasourceInfo)); } restOfStatement.append(condBuffer.toString()); @@ -640,7 +638,7 @@ public final class SqlJdbcUtil { } } else { String value = rs.getString(ind); - if (value instanceof String && curField.getEncryptMethod().isEncrypted()) { + if (curField.getEncryptMethod().isEncrypted()) { value = (String) entity.getDelegator().decryptFieldValue(encryptionKeyName, curField.getEncryptMethod(), value); } entity.dangerousSetNoCheckButFast(curField, value);