From: Dion A. <di...@us...> - 2011-01-31 20:59:25
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "HaXeSideKick jEdit plugin". The branch, master has been updated via 9dff11d1e463512d52b92a95e1d9594f4b95910a (commit) from 73151a6139b93b2c4bfb86a8a8f7a834eb328838 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 9dff11d1e463512d52b92a95e1d9594f4b95910a Author: dionjwa <di...@gm...> Date: Mon Jan 31 14:59:07 2011 -0600 Let the import class cache expire after 15 seconds diff --git a/src/sidekick/haxe/ImportManager.java b/src/sidekick/haxe/ImportManager.java index 14f260e..c595648 100644 --- a/src/sidekick/haxe/ImportManager.java +++ b/src/sidekick/haxe/ImportManager.java @@ -319,9 +319,15 @@ public class ImportManager protected static Map<String, List<String>> getAllImportableClasses () { + long now = System.currentTimeMillis(); + if (now - lastImportQueryTime > IMPORT_CACHE_EXPIRE_DELAY) { + importableClassesCache = null; + } String projectRoot = HaXeSideKickPlugin.getCurrentProject() == null ? null : HaXeSideKickPlugin.getCurrentProject().getRootPath();//getProjectRoot(); if (currentProjectRootForImporting != projectRoot) { currentProjectRootForImporting = projectRoot; + //Allow these results to last a while before recomputing + lastImportQueryTime = System.currentTimeMillis(); importableClassesCache = getAllClassPackages(); } @@ -329,6 +335,8 @@ public class ImportManager return importableClassesCache; } + //Allow these results to last a while before recomputing + lastImportQueryTime = System.currentTimeMillis(); return getAllClassPackages(); } @@ -467,6 +475,7 @@ public class ImportManager } results.put(baseclass, imports); } + return results; } @@ -542,6 +551,8 @@ public class ImportManager protected static Pattern patternPackage = Pattern.compile("^[ \t]*package[ \t]+([a-z][a-zA-Z0-9_\\.]*)[ \t;\n].*"); private static Map<String, List<String>> importableClassesCache; + private static long lastImportQueryTime = 0; + private static long IMPORT_CACHE_EXPIRE_DELAY = 10 * 1000;//10 seconds private static String currentProjectRootForImporting; } ----------------------------------------------------------------------- Summary of changes: src/sidekick/haxe/ImportManager.java | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) hooks/post-receive -- HaXeSideKick jEdit plugin |