You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@metamodel.apache.org by "Kasper Sørensen (JIRA)" <ji...@apache.org> on 2018/10/29 21:23:00 UTC

[jira] [Commented] (METAMODEL-1201) Remove guava dependency in package jdbc

    [ https://issues.apache.org/jira/browse/METAMODEL-1201?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16667773#comment-16667773 ] 

Kasper Sørensen commented on METAMODEL-1201:
--------------------------------------------

That makes sense to me. Wanna post a Pull Request for it?

> Remove guava dependency in package jdbc
> ---------------------------------------
>
>                 Key: METAMODEL-1201
>                 URL: https://issues.apache.org/jira/browse/METAMODEL-1201
>             Project: Apache MetaModel
>          Issue Type: Task
>    Affects Versions: 5.0.0, 5.1.0
>            Reporter: Julien
>            Priority: Minor
>
> guava dependency is only used in one class (org.apache.metamodel.jdbc.dialects.HsqldbQueryRewriter)
>  
> {{@Override}}
> {{public boolean needsQuoting(String alias, String identifierQuoteString) }}{
> {{  boolean containsLowerCase = CharMatcher.JAVA_LOWER_CASE.matchesAnyOf(identifierQuoteString);}}
> {{  return containsLowerCase || super.needsQuoting(alias, identifierQuoteString);}}
> {{}}}
> It could be rewritten this way, to get rid of the dependency :
>  
> {{@Override}}
> {{public boolean needsQuoting(String alias, String identifierQuoteString) }}{
> {{  if (alias != null)}}
> {{    for (int i = 0; i < alias.length(); i++)}}
> {{      if (Character.isLowerCase(alias.charAt(i)))}}
> {{        return true;}}
> {{  return super.needsQuoting(alias, identifierQuoteString);}}
> {{}}}
>  
> Note: DefaultQueryRewriter.needsQuoting is protected, not public
>   



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)