482172 - Report form key size count in UrlEncoded exceptions
+ Fixing ISE message format/syntax
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/UrlEncoded.java b/jetty-util/src/main/java/org/eclipse/jetty/util/UrlEncoded.java
index e776c9a..f6c3419 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/UrlEncoded.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/UrlEncoded.java
@@ -453,7 +453,7 @@
key = null;
value=null;
if (maxKeys>0 && map.size()>maxKeys)
- throw new IllegalStateException("Form too many keys");
+ throw new IllegalStateException(String.format("Form with too many keys [%d > %d]",map.size(),maxKeys));
break;
case '=':
@@ -499,7 +499,7 @@
break;
}
if (maxLength>=0 && (++totalLength > maxLength))
- throw new IllegalStateException("Form too large");
+ throw new IllegalStateException(String.format("Form with too many keys [%d > %d]",map.size(),maxKeys));
}
if (key != null)
@@ -555,7 +555,7 @@
key = null;
value=null;
if (maxKeys>0 && map.size()>maxKeys)
- throw new IllegalStateException("Form too many keys");
+ throw new IllegalStateException(String.format("Form with too many keys [%d > %d]",map.size(),maxKeys));
break;
case '=':
@@ -629,7 +629,7 @@
LOG.debug(e);
}
if (maxLength>=0 && (++totalLength > maxLength))
- throw new IllegalStateException("Form too large");
+ throw new IllegalStateException(String.format("Form with too many keys [%d > %d]",map.size(),maxKeys));
}
if (key != null)
@@ -751,7 +751,7 @@
key = null;
value=null;
if (maxKeys>0 && map.size()>maxKeys)
- throw new IllegalStateException("Form too many keys");
+ throw new IllegalStateException(String.format("Form with too many keys [%d > %d]",map.size(),maxKeys));
break;
case '=':
if (key!=null)
@@ -797,7 +797,7 @@
totalLength++;
if (maxLength>=0 && totalLength > maxLength)
- throw new IllegalStateException("Form too large");
+ throw new IllegalStateException(String.format("Form with too many keys [%d > %d]",map.size(),maxKeys));
}
size=output.size();