svnno****@sourc*****
svnno****@sourc*****
2009年 2月 12日 (木) 23:27:39 JST
Revision: 2657 http://svn.sourceforge.jp/view?root=jiemamy&view=rev&rev=2657 Author: daisuke_m Date: 2009-02-12 23:27:39 +0900 (Thu, 12 Feb 2009) Log Message: ----------- テストがヌルポで落ちることがあったりなかったり。 Modified Paths: -------------- artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/formatter/DefaultSqlFormatter.java -------------- next part -------------- Modified: artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/formatter/DefaultSqlFormatter.java =================================================================== --- artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/formatter/DefaultSqlFormatter.java 2009-02-12 13:25:47 UTC (rev 2656) +++ artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/formatter/DefaultSqlFormatter.java 2009-02-12 14:27:39 UTC (rev 2657) @@ -34,14 +34,15 @@ private static boolean isSeparator(Token token) { - return token == null || token instanceof Separator; + return token instanceof Separator; } public String format(SqlStatement stmt) { StringBuilder sb = new StringBuilder(); Token lastToken = null; for (Token token : stmt.toTokens()) { - if ((isSeparator(lastToken) == false && isSeparator(token) == false) || lastToken.equals(Separator.COMMA)) { + if ((isSeparator(lastToken) == false && isSeparator(token) == false) || lastToken == null + || lastToken.equals(Separator.COMMA)) { sb.append(WHITESPACE); } sb.append(token);