[102087] TaglibHelperManager updates according to classpath changes now
also changed System.out.println(...) > Logger.log(...) (if the debug option is on for taglibvars)
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCorePlugin.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCorePlugin.java
index a250767..4299b1b 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCorePlugin.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCorePlugin.java
@@ -14,10 +14,12 @@
 import org.eclipse.core.resources.IWorkspace;
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.Plugin;
+import org.eclipse.jdt.core.JavaCore;
 import org.eclipse.jst.jsp.core.internal.contentmodel.TaglibController;
 import org.eclipse.jst.jsp.core.internal.contentmodel.TaglibIndex;
 import org.eclipse.jst.jsp.core.internal.java.search.JSPIndexManager;
 import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchSupport;
+import org.eclipse.jst.jsp.core.internal.taglib.TaglibHelperManager;
 import org.osgi.framework.BundleContext;
 
 /**
@@ -60,6 +62,9 @@
 		// should be started first
 		TaglibController.startup();
 		
+		// listen for classpath changes
+		JavaCore.addElementChangedListener(TaglibHelperManager.getInstance());
+		
 		// add JSPIndexManager to keep JSP Index up to date
 		// listening for IResourceChangeEvent.PRE_DELETE and IResourceChangeEvent.POST_CHANGE
 		ResourcesPlugin.getWorkspace().addResourceChangeListener(JSPIndexManager.getInstance(), IResourceChangeEvent.POST_CHANGE);
@@ -79,6 +84,10 @@
 		JSPSearchSupport.getInstance().setCanceled(true);
 		// stop any indexing
 		JSPIndexManager.getInstance().shutdown();
+		
+		// stop listening for classpath changes
+		JavaCore.removeElementChangedListener(TaglibHelperManager.getInstance());
+		
 		// stop taglib controller
 		TaglibController.shutdown();
 		TaglibIndex.shutdown();
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/taglib/TaglibHelperCache.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/taglib/TaglibHelperCache.java
index 2ef9131..4f241fb 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/taglib/TaglibHelperCache.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/taglib/TaglibHelperCache.java
@@ -8,6 +8,7 @@
 
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.runtime.Platform;
+import org.eclipse.jst.jsp.core.internal.Logger;
 
 /**
  * A simple cache for TaglibHelpers to avoid excessive creation of TaglibClassLoaders
@@ -17,7 +18,7 @@
 
     private static final boolean DEBUG;
     static {
-        String value = Platform.getDebugOption("com.ibm.sse.model.jsp/debug/taglibvars"); //$NON-NLS-1$
+        String value = Platform.getDebugOption("org.eclipse.jst.jsp.core/debug/taglibvars"); //$NON-NLS-1$
         DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
     }
 
@@ -84,7 +85,7 @@
                     fHelpers.remove(entry);
 	                fHelpers.add(1, entry);
 	                if(DEBUG) {
-	                    System.out.println("(->) TaglibHelperCache moved: " + entry + " to the front of the list");
+	                    Logger.log(Logger.INFO, "(->) TaglibHelperCache moved: " + entry + " to the front of the list");
 	                    printCacheContents();
 	                }
                 }
@@ -112,14 +113,14 @@
         Entry newEntry = new Entry(projectPath, helper);
         fHelpers.add(0, newEntry);
         if(DEBUG) {
-            System.out.println("(+) TaglibHelperCache added: " + newEntry);
+        	Logger.log(Logger.INFO, "(+) TaglibHelperCache added: " + newEntry);
             printCacheContents();
         }
         if(fHelpers.size() > MAX_SIZE) {
             // one too many, remove last
             Object removed = fHelpers.remove(fHelpers.size()-1);
             if(DEBUG) {
-                System.out.println("(-) TaglibHelperCache removed: " + removed);
+            	Logger.log(Logger.INFO, "(-) TaglibHelperCache removed: " + removed);
                 printCacheContents();
             }
         }
@@ -134,7 +135,7 @@
             if(entry.getProjectPath().equals(projectPath)) {
                 fHelpers.remove(entry);
                 if(DEBUG) { 
-                    System.out.println("(-) TaglibHelperCache removed: " + entry);
+                    Logger.log(Logger.INFO, "(-) TaglibHelperCache removed: " + entry);
                     printCacheContents();
                 }
                 break;
@@ -143,11 +144,12 @@
     }
     
     private void printCacheContents() {
-        
-        System.out.println("-----------------------------------------------------------");
-        System.out.println("cache contents:");
+        StringBuffer debugString = new StringBuffer();
+        debugString.append("\n-----------------------------------------------------------");
+        debugString.append("\ncache contents:");
         for (int i=0; i<fHelpers.size(); i++)	
-            System.out.println(" -" + i + "- " + fHelpers.get(i));
-        System.out.println("-----------------------------------------------------------");
+        	debugString.append("\n -" + i + "- " + fHelpers.get(i));
+        debugString.append("\n-----------------------------------------------------------");
+        Logger.log(Logger.INFO, debugString.toString());
     }
 }