Author: vrubezhny
Date: 2009-11-27 11:55:22 -0500 (Fri, 27 Nov 2009)
New Revision: 18891
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java
Log:
JBIDE-5273: NPE in junit tests for jsp components
Issue is fixed
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 2009-11-27
16:48:34 UTC (rev 18890)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java 2009-11-27
16:55:22 UTC (rev 18891)
@@ -179,7 +179,7 @@
return;
// Remove all the contexts that are parent to the removed context
- Collection<ELContext> contexts = cache.values();
+ ELContext[] contexts = cache.values().toArray(new ELContext[0]);
if (contexts != null) {
for (ELContext context : contexts) {
if (isDependencyContext(context, file)) {
@@ -200,7 +200,7 @@
return;
synchronized (cache) {
// Remove all the contexts that are parent to the removed context
- Collection<IFile> files = cache.keySet();
+ IFile[] files = cache.keySet().toArray(new IFile[0]);
if (files != null) {
for (IFile file : files) {
if (project.equals(file.getProject())) {
@@ -217,9 +217,11 @@
* @param file
*/
public void cleanUp(IResourceDelta delta) {
- if(cache == null || cache.size() == 0) return;
- if(!checkDelta(delta)) return;
- processDelta(delta);
+ synchronized (cache) {
+ if(cache.size() == 0) return;
+ if(!checkDelta(delta)) return;
+ processDelta(delta);
+ }
}
// long ctm = 0;
@@ -979,7 +981,7 @@
synchronized (cache) {
// Remove all the contexts that are parent to the removed context
- Collection<ELContext> contexts = cache.values();
+ ELContext[] contexts = cache.values().toArray(new ELContext[0]);
if (contexts != null) {
for (ELContext context : contexts) {
removeSavedContext(context.getResource());
@@ -1006,7 +1008,7 @@
synchronized (cache) {
// Remove all the contexts that are parent to the removed context
- Collection<ELContext> contexts = cache.values();
+ ELContext[] contexts = cache.values().toArray(new ELContext[0]);
if (contexts != null) {
for (ELContext context : contexts) {
if (context instanceof XmlContextImpl &&
Show replies by date