diff options
Diffstat (limited to 'src/main/java/com/keuin/kbackupfabric/backup/suggestion/BackupNameSuggestionProvider.java')
-rw-r--r-- | src/main/java/com/keuin/kbackupfabric/backup/suggestion/BackupNameSuggestionProvider.java | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/src/main/java/com/keuin/kbackupfabric/backup/suggestion/BackupNameSuggestionProvider.java b/src/main/java/com/keuin/kbackupfabric/backup/suggestion/BackupNameSuggestionProvider.java index 9c0c1c2..fa38979 100644 --- a/src/main/java/com/keuin/kbackupfabric/backup/suggestion/BackupNameSuggestionProvider.java +++ b/src/main/java/com/keuin/kbackupfabric/backup/suggestion/BackupNameSuggestionProvider.java @@ -47,11 +47,6 @@ public class BackupNameSuggestionProvider { } } -// private static void updateCandidateList(Collection<String> stringCollection) { -// candidateList.clear(); -// candidateList.addAll(stringCollection); -// } - public static SuggestionProvider<ServerCommandSource> getProvider() { // return (context, builder) -> getCompletableFuture(builder); return (context, builder) -> { @@ -61,24 +56,6 @@ public class BackupNameSuggestionProvider { }; } -// private static CompletableFuture<Suggestions> getCompletableFuture(SuggestionsBuilder builder) { -// if (isCacheExpired()) -// updateCandidateList(); -// String remaining = builder.getRemaining().toLowerCase(Locale.ROOT); -// synchronized (syncCache) { -// if (candidateCacheList.isEmpty()) { // If the list is empty then return no suggestions -// return Suggestions.empty(); // No suggestions -// } -// -// for (String string : candidateCacheList) { // Iterate through the supplied list -// if (string.toLowerCase(Locale.ROOT).startsWith(remaining)) { -// builder.suggest(string); // Add every single entry to suggestions list. -// } -// } -// } -// return builder.buildFuture(); // Create the CompletableFuture containing all the suggestions -// } - private static boolean isCacheExpired() { return ((int) System.currentTimeMillis()) - cacheUpdateTime > CACHE_TTL || cacheUpdateTime == 0; } |