From: tcofoegbu Date: Tue, 11 Apr 2017 14:50:55 +0000 (+0100) Subject: JAL-1648 Fix review issue - remove usage of String.join X-Git-Tag: Release_2_10_2~3^2~45^2~16 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=75415606931bbe145f471ff2e13abefc431dbd2c;p=jalview.git JAL-1648 Fix review issue - remove usage of String.join --- 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); } }