summaryrefslogtreecommitdiffstats
path: root/luni/src/main/java/java/net/HttpCookie.java
diff options
context:
space:
mode:
Diffstat (limited to 'luni/src/main/java/java/net/HttpCookie.java')
-rw-r--r--luni/src/main/java/java/net/HttpCookie.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/luni/src/main/java/java/net/HttpCookie.java b/luni/src/main/java/java/net/HttpCookie.java
index 057afef..ce1a8d2 100644
--- a/luni/src/main/java/java/net/HttpCookie.java
+++ b/luni/src/main/java/java/net/HttpCookie.java
@@ -445,7 +445,7 @@ public final class HttpCookie implements Cloneable {
public HttpCookie(String name, String value) {
String ntrim = name.trim(); // erase leading and trailing whitespace
if (!isValidName(ntrim)) {
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("Invalid name: " + name);
}
this.name = ntrim;
@@ -650,11 +650,11 @@ public final class HttpCookie implements Cloneable {
*
* @throws IllegalArgumentException if v is neither 0 nor 1
*/
- public void setVersion(int v) {
- if (v != 0 && v != 1) {
- throw new IllegalArgumentException();
+ public void setVersion(int newVersion) {
+ if (newVersion != 0 && newVersion != 1) {
+ throw new IllegalArgumentException("Bad version: " + newVersion);
}
- version = v;
+ version = newVersion;
}
@Override public Object clone() {