Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix URL generation for endpoints with a single parameter but multiple…

… values.
  • Loading branch information...
commit c957a74b9426fcad1decc0b36f2ae9ce4cde0c84 1 parent 6e8b4ad
Ryan Morgan authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/org/hyperic/hq/hqapi1/HQConnection.java
View
8 src/org/hyperic/hq/hqapi1/HQConnection.java
@@ -145,16 +145,16 @@ private String urlEncode(String s)
uri.append("?");
}
- int idx = 0;
- for (Iterator i = params.keySet().iterator(); i.hasNext(); idx++) {
- String key = (String)i.next();
+ boolean append = false;
+ for (String key : params.keySet()) {
String[] vals = params.get(key);
for (String val : vals) {
if (val != null) {
- if (idx > 0) {
+ if (append) {
uri.append("&");
}
uri.append(key).append("=").append(urlEncode(val));
+ append = true;
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.