Author: mareshkau
Date: 2008-07-10 13:11:49 -0400 (Thu, 10 Jul 2008)
New Revision: 9119
Modified:
branches/jbosstools-2.1.x/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/DocTypeUtil.java
Log:
http://jira.jboss.org/jira/browse/JBIDE-2433
Modified:
branches/jbosstools-2.1.x/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/DocTypeUtil.java
===================================================================
---
branches/jbosstools-2.1.x/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/DocTypeUtil.java 2008-07-10
15:25:00 UTC (rev 9118)
+++
branches/jbosstools-2.1.x/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/DocTypeUtil.java 2008-07-10
17:11:49 UTC (rev 9119)
@@ -24,6 +24,7 @@
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocumentType;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.jboss.tools.vpe.VpePlugin;
import org.w3c.dom.Attr;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
@@ -50,8 +51,9 @@
* @param editorInput
* @return
*/
- static public String getDoctype(IEditorInput editorInput) {
+ public static String getDoctype(IEditorInput editorInput) {
+ try{
// if opened file is located in eclipse workspace
if (editorInput instanceof IFileEditorInput) {
IFile f = ((IFileEditorInput) editorInput).getFile();
@@ -64,6 +66,11 @@
return null;
return getDoctype(path.toFile());
}
+ }catch(StackOverflowError error) {
+ //Fix For JBIDE-2433
+ VpePlugin.getPluginLog().logInfo(error.toString());
+ return ""; //$NON-NLS-1$
+ }
return null;
}
@@ -74,7 +81,7 @@
* @param file
* @return
*/
- static public String getDoctype(IFile file) {
+ static private String getDoctype(IFile file) {
String docTypeValue = null;