@@ -61,15 +61,13 @@ public boolean contains(Element element) {
6161 return true ;
6262 }
6363 Vector children = getChildren ();
64- if (children != null ) {
65- int i = 0 ;
66- while (i < children .size ()) {
67- Element child = (Element ) children .get (i );
68- if (child .contains (element )) {
69- return true ;
70- }
71- i ++;
64+ int i = 0 ;
65+ while (i < children .size ()) {
66+ Element child = (Element ) children .get (i );
67+ if (child .contains (element )) {
68+ return true ;
7269 }
70+ i ++;
7371 }
7472 return false ;
7573 }
@@ -193,17 +191,14 @@ public Element getElementById(String id) {
193191 return this ;
194192 }
195193 Vector children = getChildren ();
196- if (children != null ) {
197- int i = 0 ;
198- while (i < children .size ()) {
199- Element child = (Element ) children .get (i );
200- Element match = child .getElementById (id );
201- if (match != null ) {
202- return match ;
203- }
204- i ++;
194+ int i = 0 ;
195+ while (i < children .size ()) {
196+ Element child = (Element ) children .get (i );
197+ Element match = child .getElementById (id );
198+ if (match != null ) {
199+ return match ;
205200 }
206-
201+ i ++;
207202 }
208203 return null ;
209204 }
@@ -389,10 +384,8 @@ public String toString(String spacing) {
389384 }
390385 str += ">\n " ;
391386 Vector children = getChildren ();
392- if (children != null ) {
393- for (int i = 0 ; i < children .size (); i ++) {
394- str += ((Element ) children .get (i )).toString (spacing + ' ' );
395- }
387+ for (int i = 0 ; i < children .size (); i ++) {
388+ str += ((Element ) children .get (i )).toString (spacing + ' ' );
396389 }
397390 str += spacing + "</" + getTagName () + ">\n " ;
398391 return str ;
0 commit comments