From: SVN by r. <sv...@ca...> - 2009-02-20 23:46:05
|
Author: roy Date: 2009-02-20 22:59:19 +0100 (Fri, 20 Feb 2009) New Revision: 379 Modified: pom.xml src/main/java/nl/improved/sqlclient/AbstractSQLShellWindow.java src/main/java/nl/improved/sqlclient/TabCompletionInfo.java Log: small code cleanup version 0.7 started Modified: pom.xml =================================================================== --- pom.xml 2009-02-20 20:54:04 UTC (rev 378) +++ pom.xml 2009-02-20 21:59:19 UTC (rev 379) @@ -19,7 +19,7 @@ <groupId>nl.improved</groupId> <artifactId>sqlshell</artifactId> <packaging>jar</packaging> - <version>0.6.2</version> + <version>0.7-SNAPSHOT</version> <name>SQLShell ~ the improved sqlclient</name> <url>http://sqlshell.sourceforge.org</url> <build> Modified: src/main/java/nl/improved/sqlclient/AbstractSQLShellWindow.java =================================================================== --- src/main/java/nl/improved/sqlclient/AbstractSQLShellWindow.java 2009-02-20 20:54:04 UTC (rev 378) +++ src/main/java/nl/improved/sqlclient/AbstractSQLShellWindow.java 2009-02-20 21:59:19 UTC (rev 379) @@ -927,12 +927,13 @@ * @param sub the start of the match * @return the match starting with sub minus the sub itself in the correct casing */ - protected CharSequence findMatch(List<String> values, String sub) { + protected CharSequence findMatch(List<String> values, CharSequence sub) { List<String> matches = new ArrayList<String>(); Iterator<String> iValues = values.iterator(); + String subUpper = sub.toString().toUpperCase(); while (iValues.hasNext()) { String value = iValues.next(); - if (value.toUpperCase().startsWith(sub.toUpperCase())) { + if (value.toUpperCase().startsWith(subUpper)) { matches.add(value); } } @@ -954,7 +955,7 @@ } if (match != null) { match = DBConnector.getInstance().translateDbVar(match); - if (sub.length() > 0 && !match.startsWith(sub)) { // case insensitive change + if (sub.length() > 0 && !match.startsWith(sub.toString())) { // case insensitive change Point cursorPosition = screen.getCursorPosition(); List<StringBuffer> lines = getEditableCommand().getEditableLines(); if (lines.get(cursorPosition.y).length() >=sub.length()) { Modified: src/main/java/nl/improved/sqlclient/TabCompletionInfo.java =================================================================== --- src/main/java/nl/improved/sqlclient/TabCompletionInfo.java 2009-02-20 20:54:04 UTC (rev 378) +++ src/main/java/nl/improved/sqlclient/TabCompletionInfo.java 2009-02-20 21:59:19 UTC (rev 379) @@ -22,13 +22,13 @@ private MatchType type; private List<String> possibleMatches; - private String start; + private CharSequence start; public TabCompletionInfo(MatchType type, List<String> possibleMatches) { this(type, possibleMatches, ""); } - public TabCompletionInfo(MatchType type, List<String> possibleMatches, String start) { + public TabCompletionInfo(MatchType type, List<String> possibleMatches, CharSequence start) { this.type = type; this.possibleMatches = possibleMatches; this.start = start; @@ -40,7 +40,7 @@ public List<String> getPossibleMatches() { return possibleMatches; } - public String getStart() { + public CharSequence getStart() { return start; } |