Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 101343 Details for
Bug 233309
NPE thrown if HTML model is busy / unavailable from JSDT outline provider
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
patch to catch any NPEs from null HTML model
removedebug.txt (text/plain), 4.90 KB, created by
Bradley Childs
on 2008-05-21 14:48:41 EDT
(
hide
)
Description:
patch to catch any NPEs from null HTML model
Filename:
MIME Type:
Creator:
Bradley Childs
Created:
2008-05-21 14:48:41 EDT
Size:
4.90 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.wst.jsdt.web.ui >Index: src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JFaceNodeAdapterForJs.java >=================================================================== >RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JFaceNodeAdapterForJs.java,v >retrieving revision 1.26 >diff -u -r1.26 JFaceNodeAdapterForJs.java >--- src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JFaceNodeAdapterForJs.java 30 Apr 2008 19:06:30 -0000 1.26 >+++ src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JFaceNodeAdapterForJs.java 21 May 2008 18:43:30 -0000 >@@ -17,8 +17,8 @@ > import org.eclipse.jface.text.Position; > import org.eclipse.swt.graphics.Image; > import org.eclipse.wst.html.ui.internal.contentoutline.JFaceNodeAdapterForHTML; >-import org.eclipse.wst.jsdt.core.IJavaScriptUnit; > import org.eclipse.wst.jsdt.core.IJavaScriptElement; >+import org.eclipse.wst.jsdt.core.IJavaScriptUnit; > import org.eclipse.wst.jsdt.core.ISourceRange; > import org.eclipse.wst.jsdt.core.IType; > import org.eclipse.wst.jsdt.core.JavaScriptModelException; >@@ -26,19 +26,13 @@ > import org.eclipse.wst.jsdt.internal.core.SourceRefElement; > import org.eclipse.wst.jsdt.ui.JavaScriptElementLabelProvider; > import org.eclipse.wst.jsdt.ui.StandardJavaScriptElementContentProvider; >-import org.eclipse.wst.jsdt.web.core.internal.Logger; > import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation; > import org.eclipse.wst.jsdt.web.core.javascript.JsTranslation; > import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter; >-import org.eclipse.wst.sse.core.StructuredModelManager; >-import org.eclipse.wst.sse.core.internal.provisional.IModelManager; > import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter; >-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel; >-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument; > import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter; > import org.eclipse.wst.xml.core.internal.document.NodeImpl; > import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument; >-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel; > import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeAdapterFactory; > import org.w3c.dom.Node; > /** >@@ -109,7 +103,7 @@ > return type.isAnonymous(); > } catch (JavaScriptModelException e) { > // TODO Auto-generated catch block >- e.printStackTrace(); >+ //e.printStackTrace(); > } > } > } >@@ -179,10 +173,10 @@ > range = ((SourceRefElement)allChildren[i] ).getSourceRange(); > } catch (JavaScriptModelException e) { > // TODO Auto-generated catch block >- e.printStackTrace(); >+ //e.printStackTrace(); > } > } >- if (allChildren[i].getElementType() == IJavaScriptElement.TYPE || (javaPositionStart <= range.getOffset() && range.getLength() + range.getOffset() <= (javaPositionEnd))) { >+ if (allChildren[i].getElementType() == IJavaScriptElement.TYPE || (range != null && javaPositionStart <= range.getOffset() && range.getLength() + range.getOffset() <= (javaPositionEnd))) { > > int htmllength = range==null?0:range.getLength(); > int htmloffset = range==null?0:range.getOffset(); >@@ -220,13 +214,13 @@ > if(ensureConsistant) unit.makeConsistent(getProgressMonitor()); > } catch (JavaScriptModelException ex1) { > // TODO Auto-generated catch block >- ex1.printStackTrace(); >+ //ex1.printStackTrace(); > } > try { > result = filterChildrenForRange(unit.getChildren(),node); > } catch (JavaScriptModelException ex) { > // TODO Auto-generated catch block >- ex.printStackTrace(); >+ // ex.printStackTrace(); > result = new Object[0]; > lazyCu=null; > } >@@ -304,32 +298,16 @@ > lazyCu.makeConsistent( new NullProgressMonitor() ); > } catch (JavaScriptModelException e) { > // TODO Auto-generated catch block >- e.printStackTrace(); >+ //e.printStackTrace(); >+ }catch(Exception e){ >+ // do nothing > } > } > return lazyCu; > } > > private IJsTranslation getTranslation(Node node) { >- IStructuredModel model = null; >- IModelManager modelManager = StructuredModelManager.getModelManager(); >- IDOMDocument xmlDoc = null; >- try { >- if (modelManager != null) { >- IStructuredDocument doc = ((NodeImpl) node).getStructuredDocument(); >- model = modelManager.getExistingModelForRead(doc); >- // model = modelManager.getModelForRead(doc); >- } >- IDOMModel domModel = (IDOMModel) model; >- xmlDoc = domModel.getDocument(); >- } catch (Exception e) { >- Logger.logException(e); >- } finally { >- if (model != null) { >- // model.changedModel(); >- model.releaseFromRead(); >- } >- } >+ IDOMDocument xmlDoc = (IDOMDocument) node.getOwnerDocument(); > if (xmlDoc == null) { > return null; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 233309
: 101343