[Httpunit-commit] CVS: httpunit/src/com/meterware/httpunit WebForm.java,1.9,1.10
Brought to you by:
russgold
|
From: Russell G. <rus...@us...> - 2000-10-03 13:41:09
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit In directory slayer.i.sourceforge.net:/tmp/cvs-serv22618/src/com/meterware/httpunit Modified Files: WebForm.java Log Message: Correct handling of untyped input parameters Index: WebForm.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebForm.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- WebForm.java 2000/10/02 16:32:10 1.9 +++ WebForm.java 2000/10/03 13:41:05 1.10 @@ -240,9 +240,9 @@ String name = getValue( parameters[i].getNamedItem( "name" ) ); String value = getValue( parameters[i].getNamedItem( "value" ) ); String type = getValue( parameters[i].getNamedItem( "type" ) ).toUpperCase(); - if (type == null) type = "TEXT"; + if (type == null || type.length() == 0) type = "TEXT"; - if (type.equals( "TEXT" ) | type.equals( "HIDDEN" ) | type.equals( "PASSWORD" )) { + if (type.equals( "TEXT" ) || type.equals( "HIDDEN" ) || type.equals( "PASSWORD" )) { defaults.put( name, value ); } else if (type.equals( "RADIO" ) && parameters[i].getNamedItem( "checked" ) != null) { defaults.put( name, value ); @@ -291,7 +291,7 @@ String name = getValue( parameters[i].getNamedItem( "name" ) ); String value = getValue( parameters[i].getNamedItem( "value" ) ); String type = getValue( parameters[i].getNamedItem( "type" ) ).toUpperCase(); - if (type == null) type = "TEXT"; + if (type == null || type.length() == 0) type = "TEXT"; if (type.equals( "RADIO" ) || type.equals( "CHECKBOX" )) { if (value.length() == 0 && type.equals( "CHECKBOX" )) value = "on"; @@ -328,9 +328,9 @@ for (int i = 0; i < parameters.length; i++) { String name = getValue( parameters[i].getNamedItem( "name" ) ); String type = getValue( parameters[i].getNamedItem( "type" ) ).toUpperCase(); - if (type == null) type = "TEXT"; + if (type == null || type.length() == 0) type = "TEXT"; - if (type.equals( "TEXT" ) | type.equals( "HIDDEN" ) | type.equals( "PASSWORD" )) { + if (type.equals( "TEXT" ) || type.equals( "HIDDEN" ) || type.equals( "PASSWORD" )) { types.put( name, TYPE_TEXT ); } else if (type.equals( "RADIO" )) { types.put( name, TYPE_SCALAR ); |