Remove unnecessary check and cast to Element, as this can be done using generics on the first Iterator
@@ -72,12 +72,9 @@ public class WysiwygEditingRenderer
*/
private void processChildren(Element baseElement)
{
- for( Iterator itr = baseElement.getChildren().iterator(); itr.hasNext(); )
+ for( Iterator< Element > itr = baseElement.getChildren().iterator(); itr.hasNext(); )
{
- Object childElement = itr.next();
- if( childElement instanceof Element )
- {
- Element element = (Element)childElement;
+ Element element = itr.next();
String elementName = element.getName().toLowerCase();
Attribute classAttr = element.getAttribute( CLASS_ATTRIBUTE );
@@ -161,7 +158,6 @@ public class WysiwygEditingRenderer
processChildren( element );
}
}
- }
/**
* {@inheritDoc}
