ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject [10/50] incubator-ignite git commit: # ignite-sprint-3 avoid StringIndexOutOfBoundsException (ignite-657)
Date Wed, 01 Apr 2015 15:22:52 GMT
# ignite-sprint-3 avoid StringIndexOutOfBoundsException (ignite-657)


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/e182c34b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/e182c34b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/e182c34b

Branch: refs/heads/ignite-gg-10002
Commit: e182c34bde3321f7fb8e9af471bc0dfa2a938f65
Parents: 07683c9
Author: sboikov <sboikov@gridgain.com>
Authored: Tue Mar 31 15:34:05 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Tue Mar 31 15:34:05 2015 +0300

----------------------------------------------------------------------
 .../cache/transactions/IgniteTxLocalAdapter.java       | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e182c34b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
index ca85838..e552619 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
@@ -3067,17 +3067,20 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
             if (!cctx.txCompatible(this, activeCacheIds, cacheCtx)) {
                 StringBuilder cacheNames = new StringBuilder();
 
+                int idx = 0;
+
                 for (Integer activeCacheId : activeCacheIds) {
                     cacheNames.append(cctx.cacheContext(activeCacheId).name());
 
-                    cacheNames.append(", ");
+                    if (idx++ < activeCacheIds.size() - 1)
+                        cacheNames.append(", ");
                 }
 
-                cacheNames.setLength(cacheNames.length() - 2);
-
                 throw new IgniteCheckedException("Failed to enlist new cache to existing
transaction " +
-                    "(cache configurations are not compatible) [activeCaches=[" + cacheNames
+
-                    "], cacheName=" + cacheCtx.name() + ", txSystem=" + system() +
+                    "(cache configurations are not compatible) [" +
+                    "activeCaches=[" + cacheNames + "]" +
+                    ", cacheName=" + cacheCtx.name() +
+                    ", txSystem=" + system() +
                     ", cacheSystem=" + cacheCtx.system() + ']');
             }
             else


Mime
View raw message