From 75415606931bbe145f471ff2e13abefc431dbd2c Mon Sep 17 00:00:00 2001 From: tcofoegbu Date: Tue, 11 Apr 2017 15:50:55 +0100 Subject: [PATCH] JAL-1648 Fix review issue - remove usage of String.join --- src/jalview/fts/core/GFTSPanel.java | 1 - src/jalview/io/cache/AppCache.java | 16 +++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/jalview/fts/core/GFTSPanel.java b/src/jalview/fts/core/GFTSPanel.java index 918b3c9..a338400 100644 --- a/src/jalview/fts/core/GFTSPanel.java +++ b/src/jalview/fts/core/GFTSPanel.java @@ -838,7 +838,6 @@ public abstract class GFTSPanel extends JPanel implements GFTSPanelI, Cacheable String typed = txt_search.getEditor().getItem() == null ? "" : txt_search .getEditor().getItem().toString().trim(); - System.out.println("Typed : " + typed); return typed; } diff --git a/src/jalview/io/cache/AppCache.java b/src/jalview/io/cache/AppCache.java index 26e1eda..46f6df2 100644 --- a/src/jalview/io/cache/AppCache.java +++ b/src/jalview/io/cache/AppCache.java @@ -118,8 +118,18 @@ public class AppCache implements AppCacheI public void persistCache(Cacheable cacheable) { String cacheKey = cacheable.getCacheKey(); - LinkedHashSet foundCache = getAllCachedItemsFor(cacheable); - String commaJoinedStr = String.join(CACHE_DELIMITER, foundCache); - Cache.setProperty(cacheKey, commaJoinedStr); + LinkedHashSet foundCacheItems = getAllCachedItemsFor(cacheable); + StringBuffer delimitedCacheBuf = new StringBuffer(); + for (String cacheItem : foundCacheItems) + { + delimitedCacheBuf.append(CACHE_DELIMITER).append(cacheItem); + } + if (delimitedCacheBuf.length() > 0) + { + delimitedCacheBuf.deleteCharAt(0); + } + String delimitedCacheString = delimitedCacheBuf.toString(); + + Cache.setProperty(cacheKey, delimitedCacheString); } } -- 1.7.10.2