db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r988264 - /db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/planexporter/AccessDatabase.java
Date Mon, 23 Aug 2010 19:36:19 GMT
Author: kmarsden
Date: Mon Aug 23 19:36:19 2010
New Revision: 988264

URL: http://svn.apache.org/viewvc?rev=988264&view=rev
Log:
DERBY-4781 (partial) Fix XplainStatisticsTest failure with J2ME on split method
introduced by DERBY-4587

Contributed by C.S. Nirmal J Fernando ( nirmal070125 at gmail dot com )

Modified:
    db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/planexporter/AccessDatabase.java

Modified: db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/planexporter/AccessDatabase.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/planexporter/AccessDatabase.java?rev=988264&r1=988263&r2=988264&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/planexporter/AccessDatabase.java
(original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/planexporter/AccessDatabase.java
Mon Aug 23 19:36:19 2010
@@ -460,15 +460,17 @@ public class AccessDatabase {
      * @return modified string
      */
     private String replace(String stmt, String expr, String replace){
-        String[] part=stmt.split(expr);
-        String newStmt= part[0];
-        for(int i=1;i<part.length;i++){
-            newStmt += " "+replace+" "+part[i];
-        }
-
-        return newStmt;
+    	if(stmt.indexOf(expr)!=-1){
+    		stmt=stmt.substring(0, stmt.indexOf(expr))
+    		+replace+stmt.substring(stmt.indexOf(expr)+1);
+    		replace(stmt,expr,replace);
+    		return "";
+    	}
+    	else{
+    		return stmt;
+    	}
     }
-
+   
     /**
      *
      * @return XPLAIN_TIME of SYSXPLAIN_STATEMENTS



Mime
View raw message