
|
If you were logged in you would be able to see more operations.
|
|
|
|
Original Estimate:
|
Unknown
|
Remaining Estimate:
|
Unknown
|
Time Spent:
|
Unknown
|
|
|
Class: com.thoughtworks.selenium.HttpCommandProcessor
Method: getBooleanArray(String commandName, String[] args)
Bug: String equals String[] will always return false (line 244 & 248). The method will always return an array consisting of only "false"-element, irrespective of the args-array.
Fix: Compare with the correct element in the args-array rather than with the array itself.
public boolean[] getBooleanArray(String commandName, String[] args) {
String[] result = getStringArray(commandName, args);
boolean[] b = new boolean[result.length];
for (int i = 0; i < result.length; i++) {
if ("true".equals(result[i])) {
b[i] = true;
continue;
}
if ("false".equals(result[i])) {
b[i] = false;
continue;
}
throw new RuntimeException("result was neither 'true' nor 'false': " + result);
}
return b;
}
----------------------------
Patch:
Index: C:/Projects/current/external/selenium_rc/clients/java/src/main/java/com/thoughtworks/selenium/HttpCommandProcessor.java
===================================================================
--- C:/Projects/current/external/selenium_rc/clients/java/src/main/java/com/thoughtworks/selenium/HttpCommandProcessor.java (revision 2045)
+++ C:/Projects/current/external/selenium_rc/clients/java/src/main/java/com/thoughtworks/selenium/HttpCommandProcessor.java (working copy)
@@ -241,11 +241,11 @@
String[] result = getStringArray(commandName, args);
boolean[] b = new boolean[result.length];
for (int i = 0; i < result.length; i++) {
- if ("true".equals(result)) {
+ if ("true".equals(result[i])) {
b[i] = true;
continue;
}
- if ("false".equals(result)) {
+ if ("false".equals(result[i])) {
b[i] = false;
continue;
}
|
|
Description
|
Class: com.thoughtworks.selenium.HttpCommandProcessor
Method: getBooleanArray(String commandName, String[] args)
Bug: String equals String[] will always return false (line 244 & 248). The method will always return an array consisting of only "false"-element, irrespective of the args-array.
Fix: Compare with the correct element in the args-array rather than with the array itself.
public boolean[] getBooleanArray(String commandName, String[] args) {
String[] result = getStringArray(commandName, args);
boolean[] b = new boolean[result.length];
for (int i = 0; i < result.length; i++) {
if ("true".equals(result[i])) {
b[i] = true;
continue;
}
if ("false".equals(result[i])) {
b[i] = false;
continue;
}
throw new RuntimeException("result was neither 'true' nor 'false': " + result);
}
return b;
}
----------------------------
Patch:
Index: C:/Projects/current/external/selenium_rc/clients/java/src/main/java/com/thoughtworks/selenium/HttpCommandProcessor.java
===================================================================
--- C:/Projects/current/external/selenium_rc/clients/java/src/main/java/com/thoughtworks/selenium/HttpCommandProcessor.java (revision 2045)
+++ C:/Projects/current/external/selenium_rc/clients/java/src/main/java/com/thoughtworks/selenium/HttpCommandProcessor.java (working copy)
@@ -241,11 +241,11 @@
String[] result = getStringArray(commandName, args);
boolean[] b = new boolean[result.length];
for (int i = 0; i < result.length; i++) {
- if ("true".equals(result)) {
+ if ("true".equals(result[i])) {
b[i] = true;
continue;
}
- if ("false".equals(result)) {
+ if ("false".equals(result[i])) {
b[i] = false;
continue;
}
|
Show » |
|