Author: vrubezhny
Date: 2009-10-24 11:57:37 -0400 (Sat, 24 Oct 2009)
New Revision: 18285
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/META-INF/MANIFEST.MF
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IIncludedContextSupport.java
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/internal/JspContextImpl.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/XmlContextImpl.java
Log:
JBIDE-5083: java.lang.StackOverflowError exception when DND the same file into page
The fix for trunk is committed
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/META-INF/MANIFEST.MF 2009-10-24 15:34:15
UTC (rev 18284)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/META-INF/MANIFEST.MF 2009-10-24 15:57:37
UTC (rev 18285)
@@ -21,7 +21,7 @@
org.eclipse.wst.xml.ui,
org.eclipse.jdt.ui,
org.eclipse.wst.validation,
- org.eclipse.ui.editors,
+ org.eclipse.ui.editors;visibility:=reexport,
org.eclipse.ui.ide,
org.eclipse.wst.css.core;bundle-version="1.1.300",
org.eclipse.wst.html.core;bundle-version="1.1.300"
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IIncludedContextSupport.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IIncludedContextSupport.java 2009-10-24
15:34:15 UTC (rev 18284)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IIncludedContextSupport.java 2009-10-24
15:57:37 UTC (rev 18285)
@@ -51,4 +51,26 @@
* @return
*/
Map<String, List<INameSpace>> getNameSpaces(int offset);
+
+ /**
+ * Checks if the context exists in parent contexts for the specified resource
+ *
+ * @param resource
+ * @return
+ */
+ boolean contextExistsInParents(IFile resource);
+
+ /**
+ * Set up parent context
+ *
+ * @param parent
+ */
+ void setParent(IIncludedContextSupport parent);
+
+ /**
+ * Returns parent context
+ *
+ * @return
+ */
+ IIncludedContextSupport getParent();
}
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-10-24
15:34:15 UTC (rev 18284)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java 2009-10-24
15:57:37 UTC (rev 18285)
@@ -309,6 +309,11 @@
if (file == null)
return;
+ // Fix for JBIDE-5083 >>>
+ if (context.contextExistsInParents(file))
+ return;
+ // Fix for JBIDE-5083 <<<
+
IStructuredModel sModel = null;
try {
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/JspContextImpl.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/JspContextImpl.java 2009-10-24
15:34:15 UTC (rev 18284)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/JspContextImpl.java 2009-10-24
15:57:37 UTC (rev 18285)
@@ -11,15 +11,11 @@
package org.jboss.tools.jst.web.kb.internal;
import java.util.ArrayList;
-import java.util.HashSet;
import java.util.List;
import java.util.Map;
-import java.util.Set;
import org.jboss.tools.jst.web.kb.ICSSContainerSupport;
-import org.jboss.tools.jst.web.kb.IIncludedContextSupport;
import org.jboss.tools.jst.web.kb.IPageContext;
-import org.jboss.tools.jst.web.kb.IResourceBundle;
import org.jboss.tools.jst.web.kb.internal.taglib.NameSpace;
import org.jboss.tools.jst.web.kb.taglib.INameSpace;
import org.w3c.dom.css.CSSStyleSheet;
@@ -39,6 +35,9 @@
fIncludedContexts = new ArrayList<IPageContext>();
}
fIncludedContexts.add(includedContext);
+ // Fix for JBIDE-5083 >>>
+ includedContext.setParent(this);
+ // Fix for JBIDE-5083 <<<
}
@Override
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/XmlContextImpl.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/XmlContextImpl.java 2009-10-24
15:34:15 UTC (rev 18284)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/XmlContextImpl.java 2009-10-24
15:57:37 UTC (rev 18285)
@@ -6,9 +6,9 @@
import java.util.Map;
import java.util.Set;
+import org.eclipse.core.resources.IFile;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
-import org.eclipse.ui.part.IPage;
import org.jboss.tools.common.el.core.resolver.ELContextImpl;
import org.jboss.tools.jst.web.kb.IIncludedContextSupport;
import org.jboss.tools.jst.web.kb.IPageContext;
@@ -21,7 +21,8 @@
protected ITagLibrary[] libs;
protected Map<IRegion, Map<String, INameSpace>> nameSpaces = new
HashMap<IRegion, Map<String, INameSpace>>();
protected IResourceBundle[] bundles;
-
+ private IIncludedContextSupport parentContext = null;
+
/*
* (non-Javadoc)
* @see org.jboss.tools.jst.web.kb.IPageContext#getLibraries()
@@ -158,5 +159,31 @@
return null;
}
-
+ /**
+ * (non-Javadoc)
+ * @see
org.jboss.tools.jst.web.kb.IIncludedContextSupport#contextExistsInParents(org.eclipse.core.resources.IFile)
+ */
+ public boolean contextExistsInParents(IFile resource) {
+ // Assuming that the resource must not be null here
+ if (resource.equals(getResource()))
+ return true;
+
+ return getParent() == null ? false : getParent().contextExistsInParents(resource);
+ }
+
+ /**
+ * (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.IIncludedContextSupport#getParent()
+ */
+ public IIncludedContextSupport getParent() {
+ return parentContext;
+ }
+
+ /**
+ * (non-Javadoc)
+ * @see
org.jboss.tools.jst.web.kb.IIncludedContextSupport#setParent(org.jboss.tools.jst.web.kb.IIncludedContextSupport)
+ */
+ public void setParent(IIncludedContextSupport parent) {
+ parentContext = parent;
+ }
}
Show replies by date