From: SourceForge.net <no...@so...> - 2011-02-03 18:07:16
|
Bugs item #3171843, was opened at 2011-02-03 19:07 Message generated for change (Tracker Item Submitted) made by dtonhofer You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=113153&aid=3171843&group_id=13153 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: David Tonhofer (dtonhofer) Assigned to: Nobody/Anonymous (nobody) Summary: Unreachable code in "Clean" and "DOMDocumentImpl" Initial Comment: Eclipse detects the following unreachable code, which should be cleaned up: In Clean.cleanWord2000() at line 2159, the following can be removed: if (node == null) { break; } In DOMDocumentImpl.createElement() In DOMDocumentImpl.createTextNode() In DOMDocumentImpl.createComment() In DOMDocumentImpl.createAttribute() objects are created using "new", then tested for non-nullness. This seems to be something that comes from literal translation from C. For example: public org.w3c.dom.Attr createAttribute(String name) throws DOMException { AttVal av = new AttVal(null, null, '"', name, null); if (av != null) { av.dict = AttributeTable.getDefaultAttributeTable().findAttribute(av); return av.getAdapter(); } return null; } Can be shortened to public org.w3c.dom.Attr createAttribute(String name) throws DOMException { AttVal av = new AttVal(null, null, '"', name, null); av.dict = AttributeTable.getDefaultAttributeTable().findAttribute(av); return av.getAdapter(); } ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=113153&aid=3171843&group_id=13153 |