[prev in list] [next in list] [prev in thread] [next in thread] 

List:       slide-dev
Subject:    cvs commit: jakarta-slide/src/stores/org/apache/slide/store/impl/rdbms/expression RDBMSExpressionFac
From:       luetzkendorf () apache ! org
Date:       2004-09-28 13:36:32
Message-ID: 20040928133632.50948.qmail () minotaur ! apache ! org
[Download RAW message or body]

luetzkendorf    2004/09/28 06:36:32

  Modified:    src/stores/org/apache/slide/store/impl/rdbms/expression
                        RDBMSExpressionFactory.java
  Log:
  merge with release branch (fix to make the it JDK1.3 compatible)
  
  Revision  Changes    Path
  1.12      +15 -5     \
jakarta-slide/src/stores/org/apache/slide/store/impl/rdbms/expression/RDBMSExpressionFactory.java
  
  Index: RDBMSExpressionFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/stores/org/apache/slide/store/impl/rdbms/expression/RDBMSExpressionFactory.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- RDBMSExpressionFactory.java	10 Aug 2004 14:40:17 -0000	1.11
  +++ RDBMSExpressionFactory.java	28 Sep 2004 13:36:32 -0000	1.12
  @@ -172,7 +172,7 @@
       }
   
       public static boolean isSQLCompilableProperty(Element element) {
  -        Element davProp = (Element) element.getChild(Literals.PROP, \
NamespaceCache.DEFAULT_NAMESPACE);  +        Element davProp = \
element.getChild(Literals.PROP, NamespaceCache.DEFAULT_NAMESPACE);  if (davProp != \
null) {  Element property = (Element) davProp.getChildren().get(0);
               return isSQLCompilableProperty(property.getNamespaceURI(), \
property.getName());  @@ -188,7 +188,17 @@
        * converts a property name to a legal SQL alias.
        */
       public static String propertyToAlias(String propertyName) {
  -        return "prop_" + propertyName.replaceAll("-", "_");
  +        // replaceAll occurs in JDK1.4
  +        //return "prop_" + propertyName.replaceAll("-", "_");
  +        
  +        StringBuffer buffer = new StringBuffer(propertyName.length() + 5);
  +        buffer.append("prop_");
  +        for (int i = 0, l = propertyName.length(); i < l; i++) {
  +            char c = propertyName.charAt(i);
  +            if (c == '-') c = '_';
  +            buffer.append(c);
  +        }
  +        return buffer.toString();
       }
   
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic