From c3173932f01fef85c88e81b6f696007d304199b3 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Thu, 23 Jun 2016 12:43:29 +1000 Subject: [PATCH] Revert "Issue #660 - simplifying parameter extraction to prevent NPE" This reverts commit ecea486d0795299a3ef04538a62c64e71f5d66c3. --- .../main/java/org/eclipse/jetty/server/Request.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java b/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java index 34816469de6..d54972f2792 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java @@ -1012,9 +1012,16 @@ public class Request implements HttpServletRequest if (_queryParameters == null) extractQueryParameters(); - _parameters = new MultiMap<>(); - _parameters.addAllValues(_queryParameters); - _parameters.addAllValues(_contentParameters); + if (_queryParameters==NO_PARAMS || _queryParameters.size()==0) + _parameters=_contentParameters; + else if (_contentParameters==NO_PARAMS || _contentParameters.size()==0) + _parameters=_queryParameters; + else + { + _parameters = new MultiMap<>(); + _parameters.addAllValues(_queryParameters); + _parameters.addAllValues(_contentParameters); + } } /* ------------------------------------------------------------ */