Type names in --types option are case insensitive v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Sat, 28 Dec 2013 20:47:43 +0100
branchv_0
changeset 935a4dbe6f962c
parent 92 1399ac70a5bd
child 94 b9af501399ef
Type names in --types option are case insensitive
java/sql-dk/src/info/globalcode/sql/dk/CLIParser.java
java/sql-dk/src/info/globalcode/sql/dk/InfoLister.java
java/sql-dk/src/info/globalcode/sql/dk/SQLType.java
     1.1 --- a/java/sql-dk/src/info/globalcode/sql/dk/CLIParser.java	Sat Dec 28 20:36:29 2013 +0100
     1.2 +++ b/java/sql-dk/src/info/globalcode/sql/dk/CLIParser.java	Sat Dec 28 20:47:43 2013 +0100
     1.3 @@ -46,11 +46,11 @@
     1.4  					for (String oneType : typesString.split(",")) {
     1.5  						int sepatratorIndex = oneType.indexOf(TYPE_NAME_SEPARATOR);
     1.6  						if (sepatratorIndex == -1) {
     1.7 -							numberedTypes.add(getType(oneType));
     1.8 +							numberedTypes.add(getType(oneType.toUpperCase()));
     1.9  						} else {
    1.10  							String namePart = oneType.substring(0, sepatratorIndex).trim();
    1.11  							String typePart = oneType.substring(sepatratorIndex + TYPE_NAME_SEPARATOR.length(), oneType.length());
    1.12 -							namedTypes.put(namePart, getType(typePart));
    1.13 +							namedTypes.put(namePart, getType(typePart.toUpperCase()));
    1.14  						}
    1.15  					}
    1.16  					break;
     2.1 --- a/java/sql-dk/src/info/globalcode/sql/dk/InfoLister.java	Sat Dec 28 20:36:29 2013 +0100
     2.2 +++ b/java/sql-dk/src/info/globalcode/sql/dk/InfoLister.java	Sat Dec 28 20:47:43 2013 +0100
     2.3 @@ -113,6 +113,7 @@
     2.4  			data.add(new Object[]{sqlType.name(), sqlType.getCode()});
     2.5  		}
     2.6  		printTable(formatter, header, data);
     2.7 +		log.log(Level.INFO, "Type names in --types option are case insensitive");
     2.8  	}
     2.9  
    2.10  	public void listDatabases() throws ConfigurationException, FormatterException {
     3.1 --- a/java/sql-dk/src/info/globalcode/sql/dk/SQLType.java	Sat Dec 28 20:36:29 2013 +0100
     3.2 +++ b/java/sql-dk/src/info/globalcode/sql/dk/SQLType.java	Sat Dec 28 20:47:43 2013 +0100
     3.3 @@ -25,6 +25,9 @@
     3.4   */
     3.5  public enum SQLType {
     3.6  
     3.7 +	/**
     3.8 +	 * Names must be upper case – user input is also converted to upper case → case insensitive
     3.9 +	 */
    3.10  	BIT(Types.BIT),
    3.11  	TINYINT(Types.TINYINT),
    3.12  	SMALLINT(Types.SMALLINT),