Community
Participate
Working Groups
When editing a XHTML file in Web Page Editor, trying to view or update attributes in the Properties view fails with a NullPointerException. This problem consistently occurs in WTP of the Indigo GA version and the latest Juno M2 release for Java EE. It also happens with every Java 6 release tested between 1.6.0_01 and 1.6.0_27. Stacktrace: eclipse.buildId=I20110916-1615 java.version=1.6.0_01 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_DE Framework arguments: -product org.eclipse.epp.package.jee.product Command-line arguments: -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.jee.product Error Fri Oct 14 18:25:34 CEST 2011 Unexpected runtime error while computing a text hover java.lang.NullPointerException at org.eclipse.jst.jsf.facelet.core.internal.cm.ElementCMAdapter.getLength(ElementCMAdapter.java:109) at org.eclipse.wst.xml.core.internal.contentmodel.basic.CMNamedNodeMapImpl.<init>(CMNamedNodeMapImpl.java:40) at org.eclipse.wst.xml.ui.internal.taginfo.XMLTagInfoHoverProcessor.getCMAttributeDeclaration(XMLTagInfoHoverProcessor.java:206) at org.eclipse.wst.xml.ui.internal.taginfo.XMLTagInfoHoverProcessor.computeTagAttNameHelp(XMLTagInfoHoverProcessor.java:122) at org.eclipse.wst.xml.ui.internal.taginfo.XMLTagInfoHoverProcessor.computeRegionHelp(XMLTagInfoHoverProcessor.java:108) at org.eclipse.wst.xml.ui.internal.taginfo.XMLTagInfoHoverProcessor.computeHoverHelp(XMLTagInfoHoverProcessor.java:86) at org.eclipse.wst.xml.ui.internal.taginfo.XMLTagInfoHoverProcessor.getHoverInfo(XMLTagInfoHoverProcessor.java:257) at org.eclipse.jst.jsf.facelet.ui.internal.hover.FaceletHover.getHoverInfo(FaceletHover.java:58) at org.eclipse.wst.sse.ui.internal.taginfo.BestMatchHover.getHoverInfo(BestMatchHover.java:108) at org.eclipse.jface.text.TextViewerHoverManager$4.run(TextViewerHoverManager.java:168)
I doubt ElementCMAdapter#getLength() should ever throw a NPE.
(In reply to comment #1) > I doubt ElementCMAdapter#getLength() should ever throw a NPE. The reason of this NullPointerException is org.eclipse.jst.jsf.facelet.core.internal.cm.FaceletDocumentFactory.createExternalTagInfo(String) method returning null in case of JSFVersion cannot be calculated on a faceted project. But IMO this method should return new MetadataTagInfo(_project, uri) rather than just null.
Created attachment 205355 [details] The patch prevents NullPointerException in org.eclipse.jst.jsf.facelet.core.internal.cm.ElementCMAdapter.getLength() method call The patch prevents NullPointerException in org.eclipse.jst.jsf.facelet.core.internal.cm.ElementCMAdapter.getLength() method call by returning TagInfo regardless of JSFVersion determination result. In case of JSF Version couldn't be determined on faceted project it returns a new MetadataTagInfo object as TagInfo.
Thanks for the patch. We will review.
Fix committed to HEAD at 2012/01/06 11:01AM PST.