Skip to content

Commit

Permalink
fixing issue with wrong groupByValues
Browse files Browse the repository at this point in the history
which were not properly resolved, when more than one parameter was given
only in /users requests
  • Loading branch information
FabiKo117 committed Feb 5, 2019
1 parent 0acc593 commit 04a798b
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,13 @@ public static Response executeCountGroupByType(HttpServletRequest servletRequest
public static Response executeCountGroupByTag(HttpServletRequest servletRequest,
HttpServletResponse servletResponse, boolean isDensity) throws Exception {
long startTime = System.currentTimeMillis();
String[] groupByKey = servletRequest.getParameterValues("groupByKey");
if (groupByKey == null || groupByKey.length != 1) {
InputProcessor inputProcessor = new InputProcessor(servletRequest, false, isDensity);
String[] groupByKey = inputProcessor.splitParamOnComma(
inputProcessor.createEmptyArrayIfNull(servletRequest.getParameterValues("groupByKey")));
if (groupByKey.length != 1) {
throw new BadRequestException(ExceptionMessages.GROUP_BY_KEY_PARAM);
}
MapReducer<OSMContribution> mapRed = null;
InputProcessor inputProcessor = new InputProcessor(servletRequest, false, isDensity);
mapRed = inputProcessor.processParameters();
ProcessingData processingData = inputProcessor.getProcessingData();
RequestParameters requestParameters = processingData.getRequestParameters();
Expand All @@ -160,10 +161,8 @@ public static Response executeCountGroupByTag(HttpServletRequest servletRequest,
if (!"post".equalsIgnoreCase(requestParameters.getRequestMethod())) {
requestUrl = RequestInterceptor.requestUrl;
}
String[] groupByValues = servletRequest.getParameterValues("groupByValues");
if (groupByValues == null) {
groupByValues = new String[0];
}
String[] groupByValues = inputProcessor.splitParamOnComma(
inputProcessor.createEmptyArrayIfNull(servletRequest.getParameterValues("groupByValues")));
TagTranslator tt = DbConnData.tagTranslator;
Integer[] valuesInt = new Integer[groupByValues.length];
ArrayList<Pair<Integer, Integer>> zeroFill = new ArrayList<>();
Expand Down

0 comments on commit 04a798b

Please sign in to comment.