Author: akazakov
Date: 2011-08-11 20:10:40 -0400 (Thu, 11 Aug 2011)
New Revision: 33826
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java
Log:
Made the class thread safe
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java 2011-08-11
23:14:05 UTC (rev 33825)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java 2011-08-12
00:10:40 UTC (rev 33826)
@@ -112,7 +112,7 @@
*/
@SuppressWarnings("restriction")
public class PageContextFactory implements IResourceChangeListener {
- private static PageContextFactory fInstance;
+ private static PageContextFactory fInstance = new PageContextFactory();
private static final String XHTML_TAG_LIB_URI =
"http://www.w3.org/1999/xhtml"; //$NON-NLS-1$
public static final String XML_PAGE_CONTEXT_TYPE = "XML_PAGE_CONTEXT_TYPE";
//$NON-NLS-1$
public static final String JSP_PAGE_CONTEXT_TYPE = "JSP_PAGE_CONTEXT_TYPE";
//$NON-NLS-1$
@@ -120,9 +120,7 @@
private static final String JAVA_PROPERTIES_CONTENT_TYPE =
"org.eclipse.jdt.core.javaProperties"; //$NON-NLS-1$
public static final PageContextFactory getInstance() {
- if (fInstance != null)
- return fInstance;
- return (fInstance = new PageContextFactory());
+ return fInstance;
}
/**
@@ -139,8 +137,6 @@
}
private PageContextFactory() {
-// IWorkspace workspace = ResourcesPlugin.getWorkspace();
-// if (workspace != null) workspace.addResourceChangeListener(this);
}
/*
@@ -470,6 +466,7 @@
}
return new XmlContextImpl();
}
+
/**
* Sets up the context with namespaces and according libraries from the
TagLibraryManager
*
Show replies by date