提交 d2f22a9b 编写于 作者: J jurgen

Case conversion fix (use EN locale)

Former-commit-id: 9ca42660
上级 cb864e4c
......@@ -29,6 +29,8 @@ import org.jkiss.dbeaver.model.net.DBWHandlerType;
import org.jkiss.dbeaver.model.net.DBWNetworkHandler;
import org.jkiss.utils.CommonUtils;
import java.util.Locale;
/**
* NetworkHandlerDescriptor
*/
......@@ -51,7 +53,7 @@ public class NetworkHandlerDescriptor extends AbstractContextDescriptor implemen
this.id = config.getAttribute(RegistryConstants.ATTR_ID);
this.label = config.getAttribute(RegistryConstants.ATTR_LABEL);
this.description = config.getAttribute(RegistryConstants.ATTR_DESCRIPTION);
this.type = DBWHandlerType.valueOf(config.getAttribute(RegistryConstants.ATTR_TYPE).toUpperCase());
this.type = DBWHandlerType.valueOf(config.getAttribute(RegistryConstants.ATTR_TYPE).toUpperCase(Locale.ENGLISH));
this.secured = CommonUtils.getBoolean(config.getAttribute(RegistryConstants.ATTR_SECURED), false);
this.handlerType = new ObjectType(config.getAttribute(RegistryConstants.ATTR_HANDLER_CLASS));
this.uiConfigType = new ObjectType(config.getAttribute(RegistryConstants.ATTR_UI_CLASS));
......
......@@ -32,6 +32,7 @@ import org.jkiss.utils.ArrayUtils;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Locale;
/**
* DataTransferNodeDescriptor
......@@ -64,7 +65,7 @@ public class DataTransferNodeDescriptor extends AbstractDescriptor
this.name = config.getAttribute(RegistryConstants.ATTR_LABEL);
this.description = config.getAttribute(RegistryConstants.ATTR_DESCRIPTION);
this.icon = iconToImage(config.getAttribute(RegistryConstants.ATTR_ICON));
this.nodeType = NodeType.valueOf(config.getAttribute(RegistryConstants.ATTR_TYPE).toUpperCase());
this.nodeType = NodeType.valueOf(config.getAttribute(RegistryConstants.ATTR_TYPE).toUpperCase(Locale.ENGLISH));
this.implType = new ObjectType(config.getAttribute(RegistryConstants.ATTR_CLASS));
this.settingsType = new ObjectType(config.getAttribute(RegistryConstants.ATTR_SETTINGS));
for (IConfigurationElement typeCfg : ArrayUtils.safeArray(config.getChildren(RegistryConstants.ATTR_SOURCE_TYPE))) {
......
......@@ -378,10 +378,10 @@ public class SQLQueryParameterBindDialog extends StatusDialog {
isNumber = false;
}
if (!isNumber && parameter.isNamed()) {
SQLQueryParameterRegistry.ParameterInfo info = savedParamValues.get(paramName.toUpperCase());
SQLQueryParameterRegistry.ParameterInfo info = savedParamValues.get(paramName.toUpperCase(Locale.ENGLISH));
if (info == null) {
info = new SQLQueryParameterRegistry.ParameterInfo(paramName, parameter.getTypeName(), displayString);
savedParamValues.put(paramName.toUpperCase(), info);
savedParamValues.put(paramName.toUpperCase(Locale.ENGLISH), info);
} else {
info.type = parameter.getTypeName();
info.value = displayString;
......
......@@ -31,6 +31,7 @@ import org.xml.sax.Attributes;
import java.io.*;
import java.util.LinkedHashMap;
import java.util.Locale;
import java.util.Map;
public class SQLQueryParameterRegistry
......@@ -70,12 +71,12 @@ public class SQLQueryParameterRegistry
public ParameterInfo getParameter(String name)
{
return parameterMap.get(name.toUpperCase());
return parameterMap.get(name.toUpperCase(Locale.ENGLISH));
}
public void setParameter(String name, String type, String value)
{
parameterMap.put(name.toUpperCase(), new ParameterInfo(name, type, value));
parameterMap.put(name.toUpperCase(Locale.ENGLISH), new ParameterInfo(name, type, value));
}
private void loadProfiles()
......
......@@ -45,10 +45,7 @@ import org.jkiss.utils.IOUtils;
import java.io.*;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
......@@ -392,7 +389,7 @@ public class StreamTransferConsumer implements IDataTransferConsumer<StreamConsu
DBDDisplayFormat format = DBDDisplayFormat.UI;
Object formatProp = processorProperties.get(StreamConsumerSettings.PROP_FORMAT);
if (formatProp != null) {
format = DBDDisplayFormat.valueOf(formatProp.toString().toUpperCase());
format = DBDDisplayFormat.valueOf(formatProp.toString().toUpperCase(Locale.ENGLISH));
}
return format;
}
......
......@@ -24,6 +24,8 @@ import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.ui.data.IValueController;
import java.util.Locale;
/**
* BooleanInlineEditor
*/
......@@ -58,6 +60,6 @@ public class BooleanInlineEditor extends BaseValueEditor<Combo> {
@Override
public void primeEditorValue(@Nullable Object value) throws DBException
{
control.setText(value == null ? "FALSE" : value.toString().toUpperCase());
control.setText(value == null ? "FALSE" : value.toString().toUpperCase(Locale.ENGLISH));
}
}
......@@ -25,6 +25,7 @@ import org.jkiss.dbeaver.model.sql.SQLSyntaxManager;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
/**
* Used to scan and detect for SQL keywords.
......@@ -105,7 +106,7 @@ public class SQLWordPartDetector extends SQLIdentifierDetector
String prevWord = document.get(prevOffset, prevStartOffset - prevOffset);
SQLDialect dialect = syntaxManager.getDialect();
if (dialect.isEntityQueryWord(prevWord) || dialect.isAttributeQueryWord(prevWord)) {
this.prevKeyWord = prevWord.toUpperCase();
this.prevKeyWord = prevWord.toUpperCase(Locale.ENGLISH);
break;
}
if (prevWords == null) {
......
......@@ -43,6 +43,7 @@ import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Locale;
/**
* DB2 Structure Assistant
......@@ -133,7 +134,7 @@ public class DB2StructureAssistant implements DBSStructureAssistant {
String searchObjectNameMask = objectNameMask;
if (!caseSensitive) {
searchObjectNameMask = searchObjectNameMask.toUpperCase();
searchObjectNameMask = searchObjectNameMask.toUpperCase(Locale.ENGLISH);
}
int nbResults = 0;
......
......@@ -35,10 +35,7 @@ import org.jkiss.utils.CommonUtils;
import java.sql.DatabaseMetaData;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* Foreign key cache
......@@ -153,7 +150,7 @@ class ForeignKeysCache extends JDBCCompositeCache<GenericStructContainer, Generi
}
if (CommonUtils.isEmpty(fkName)) {
// [JDBC] Some drivers return empty foreign key names
fkName = parent.getName().toUpperCase() + "_FK_" + pkTable.getName().toUpperCase();
fkName = parent.getName().toUpperCase() + "_FK_" + pkTable.getName().toUpperCase(Locale.ENGLISH);
}
return new GenericTableForeignKey(parent, fkName, null, pk, deleteRule, updateRule, defferability, true);
}
......
......@@ -76,7 +76,7 @@ public class GenericTable extends JDBCTable<GenericDataSource, GenericStructCont
this.tableType = tableType;
this.description = remarks;
if (!CommonUtils.isEmpty(this.getTableType())) {
String type = this.getTableType().toUpperCase();
String type = this.getTableType().toUpperCase(Locale.ENGLISH);
this.isView = (type.contains("VIEW"));
this.isSystem =
(type.contains("SYSTEM")) || // general rule
......
......@@ -32,6 +32,7 @@ import java.sql.DatabaseMetaData;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;
import java.util.Locale;
/**
* Index cache implementation
......@@ -106,7 +107,7 @@ class IndexCache extends JDBCCompositeCache<GenericStructContainer, GenericTable
}
if (CommonUtils.isEmpty(indexName)) {
// [JDBC] Some drivers return empty index names
indexName = parent.getName().toUpperCase() + "_INDEX";
indexName = parent.getName().toUpperCase(Locale.ENGLISH) + "_INDEX";
}
return new GenericTableIndex(
......
......@@ -32,6 +32,7 @@ import org.jkiss.utils.CommonUtils;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;
import java.util.Locale;
/**
* Index cache implementation
......@@ -72,7 +73,7 @@ class PrimaryKeysCache extends JDBCCompositeCache<GenericStructContainer, Generi
}
protected String getDefaultObjectName(String parentName) {
return parentName.toUpperCase() + "_PK";
return parentName.toUpperCase(Locale.ENGLISH) + "_PK";
}
@Override
......
......@@ -34,6 +34,7 @@ import java.sql.DatabaseMetaData;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.HashSet;
import java.util.Locale;
import java.util.Set;
/**
......@@ -171,7 +172,7 @@ public class TableCache extends JDBCStructCache<GenericStructContainer, GenericT
boolean autoIncrement = "YES".equals(GenericUtils.safeGetStringTrimmed(columnObject, dbResult, JDBCConstants.IS_AUTOINCREMENT));
boolean autoGenerated = "YES".equals(GenericUtils.safeGetStringTrimmed(columnObject, dbResult, JDBCConstants.IS_AUTOINCREMENT));
// Check for identity modifier [DBSPEC: MS SQL]
if (typeName.toUpperCase().endsWith(GenericConstants.TYPE_MODIFIER_IDENTITY)) {
if (typeName.toUpperCase(Locale.ENGLISH).endsWith(GenericConstants.TYPE_MODIFIER_IDENTITY)) {
autoIncrement = true;
typeName = typeName.substring(0, typeName.length() - GenericConstants.TYPE_MODIFIER_IDENTITY.length());
}
......
......@@ -98,7 +98,7 @@ public class MySQLUtils {
int colCount = rsMetaData.getColumnCount();
for (int i = 0; i < colCount; i++) {
String colName = rsMetaData.getColumnName(i + 1);
if (colName.toLowerCase().endsWith(COLUMN_POSTFIX_PRIV)) {
if (colName.toLowerCase(Locale.ENGLISH).endsWith(COLUMN_POSTFIX_PRIV)) {
privs.add(colName.substring(0, colName.length() - COLUMN_POSTFIX_PRIV.length()));
}
}
......
......@@ -31,6 +31,7 @@ import org.jkiss.utils.CommonUtils;
import java.sql.ResultSet;
import java.util.Collection;
import java.util.Locale;
/**
* GenericProcedure
......@@ -68,7 +69,7 @@ public class MySQLProcedure extends AbstractProcedure<MySQLDataSource, MySQLCata
{
setName(JDBCUtils.safeGetString(dbResult, MySQLConstants.COL_ROUTINE_NAME));
setDescription(JDBCUtils.safeGetString(dbResult, MySQLConstants.COL_ROUTINE_COMMENT));
this.procedureType = DBSProcedureType.valueOf(JDBCUtils.safeGetString(dbResult, MySQLConstants.COL_ROUTINE_TYPE).toUpperCase());
this.procedureType = DBSProcedureType.valueOf(JDBCUtils.safeGetString(dbResult, MySQLConstants.COL_ROUTINE_TYPE).toUpperCase(Locale.ENGLISH));
this.resultType = JDBCUtils.safeGetString(dbResult, MySQLConstants.COL_DTD_IDENTIFIER);
this.bodyType = JDBCUtils.safeGetString(dbResult, MySQLConstants.COL_ROUTINE_BODY);
this.body = JDBCUtils.safeGetString(dbResult, MySQLConstants.COL_ROUTINE_DEFINITION);
......
......@@ -38,6 +38,7 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.StringTokenizer;
import java.util.regex.Matcher;
......@@ -180,7 +181,7 @@ public class MySQLUser implements DBAUser, DBPRefreshableObject, DBPSaveableObje
String catalog;
String table;
String grantString = JDBCUtils.safeGetString(dbResult, 1).trim().toUpperCase();
String grantString = JDBCUtils.safeGetString(dbResult, 1).trim().toUpperCase(Locale.ENGLISH);
if (grantString.endsWith(" WITH GRANT OPTION")) {
grantOption = true;//privileges.add(getDataSource().getPrivilege(monitor, MySQLPrivilege.GRANT_PRIVILEGE));
}
......
......@@ -379,7 +379,7 @@ public class OracleConnectionPage extends ConnectionPageAbstract implements ICom
final Object roleName = connectionProperties.get(OracleConstants.PROP_INTERNAL_LOGON);
if (roleName != null) {
userRoleCombo.setText(roleName.toString().toUpperCase());
userRoleCombo.setText(roleName.toString().toUpperCase(Locale.ENGLISH));
}
}
......
......@@ -313,7 +313,7 @@ public class JDBCSQLDialect extends BasicSQLDialect {
Collection<? extends DBSDataType> supportedDataTypes = dataSource.getDataTypes();
if (supportedDataTypes != null) {
for (DBSDataType dataType : supportedDataTypes) {
types.add(dataType.getName().toUpperCase());
types.add(dataType.getName().toUpperCase(Locale.ENGLISH));
}
}
......
......@@ -117,7 +117,7 @@ public class BasicSQLDialect implements SQLDialect {
@Override
public DBPKeywordType getKeywordType(@NotNull String word)
{
return allKeywords.get(word.toUpperCase());
return allKeywords.get(word.toUpperCase(Locale.ENGLISH));
}
@NotNull
......
......@@ -30,6 +30,7 @@ import org.jkiss.dbeaver.model.struct.DBSEntityAttributeRef;
import org.jkiss.dbeaver.model.runtime.VoidProgressMonitor;
import java.util.List;
import java.util.Locale;
/**
* JDBC constraint manager
......@@ -83,7 +84,7 @@ public abstract class SQLConstraintManager<OBJECT_TYPE extends JDBCTableConstrai
if (!legacySyntax) {
decl.append(constraintName).append(" ");
}
decl.append(constraint.getConstraintType().getName().toUpperCase()) //$NON-NLS-1$
decl.append(constraint.getConstraintType().getName().toUpperCase(Locale.ENGLISH)) //$NON-NLS-1$
.append(" ("); //$NON-NLS-1$
// Get columns using void monitor
try {
......
......@@ -33,6 +33,7 @@ import org.jkiss.utils.CommonUtils;
import java.util.Collection;
import java.util.List;
import java.util.Locale;
/**
* JDBC foreign key manager
......@@ -86,7 +87,7 @@ public abstract class SQLForeignKeyManager<OBJECT_TYPE extends JDBCTableConstrai
if (!legacySyntax) {
decl.append(constraintName).append(" "); //$NON-NLS-1$
}
decl.append(foreignKey.getConstraintType().getName().toUpperCase()) //$NON-NLS-1$
decl.append(foreignKey.getConstraintType().getName().toUpperCase(Locale.ENGLISH)) //$NON-NLS-1$
.append(" ("); //$NON-NLS-1$
try {
// Get columns using void monitor
......
......@@ -18,6 +18,8 @@
package org.jkiss.dbeaver.model.struct;
import java.util.Locale;
/**
* DBSEntityConstraintType
*/
......@@ -45,9 +47,9 @@ public class DBSActionTiming
public static DBSActionTiming getByName(String name)
{
if (name.toUpperCase().equals(BEFORE.getName())) {
if (name.toUpperCase(Locale.ENGLISH).equals(BEFORE.getName())) {
return BEFORE;
} else if (name.toUpperCase().equals(AFTER.getName())) {
} else if (name.toUpperCase(Locale.ENGLISH).equals(AFTER.getName())) {
return AFTER;
} else {
return UNKNOWN;
......
......@@ -18,6 +18,8 @@
package org.jkiss.dbeaver.model.struct.rdb;
import java.util.Locale;
/**
* DBSManipulationType
*/
......@@ -46,11 +48,11 @@ public class DBSManipulationType
public static DBSManipulationType getByName(String name)
{
if (name.toUpperCase().equals(INSERT.getName())) {
if (name.toUpperCase(Locale.ENGLISH).equals(INSERT.getName())) {
return INSERT;
} else if (name.toUpperCase().equals(DELETE.getName())) {
} else if (name.toUpperCase(Locale.ENGLISH).equals(DELETE.getName())) {
return DELETE;
} if (name.toUpperCase().equals(UPDATE.getName())) {
} if (name.toUpperCase(Locale.ENGLISH).equals(UPDATE.getName())) {
return UPDATE;
} else {
return UNKNOWN;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册