Community
Participate
Working Groups
Build Identifier: WTP 3.3.0M6 org.eclipse.wst.xml.core.internal.document.ElementImpl.getAttribute(String) returns null in some cases, but it must never return null. This is regression to https://bugs.eclipse.org/bugs/show_bug.cgi?id=272378 It seems like this is caused by the recent changes in org.eclipse.wst.xml.core.internal.document.ElementImpl.getAttribute(String name): lines String defaultValue = getDefaultValue(name); return (defaultValue != null) ? defaultValue : NodeImpl.EMPTY_STRING; were replaced by return getDefaultValue(name, NodeImpl.EMPTY_STRING); , but the method getDefaultValue(String, String) may return null. Reproducible: Always Steps to Reproduce: 1. Create new Dynamic Web Project 2. Create NewFile.jsp page with one line inside: <html></html> 3. Check 'id' attribute of the <html> element programmatically (call htmlElement.getAttribute("id")). ACTUAL RESULT: htmlElement.getAttribute("id") returns null. EXPECTED RESULT: htmlElement.getAttribute("id") returns "".
Thank you for spotting this. But I don't think this meets the definition of Critical which is "crashes, loss of data, severe memory leak"
Created attachment 192307 [details] patch
Code checked in.