From 358555929d4ff7d33dc1a5895a324e550cfa993e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Nicoll?= Date: Tue, 23 Jan 2024 14:45:27 +0100 Subject: [PATCH] Revert "Merge pull request #32088 from Ryan-Dia" This reverts commit 484aee069e7edaf0cf904d0135ab10b6b8162e70, reversing changes made to 6bd7f0231dcc47e8099000dea301157788fd5b15. See gh-32088 --- .../mvc/condition/ParamsRequestCondition.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/ParamsRequestCondition.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/ParamsRequestCondition.java index 503cbafce2e2..590c71daa7df 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/ParamsRequestCondition.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/ParamsRequestCondition.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2024 the original author or authors. + * Copyright 2002-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -137,9 +137,13 @@ public int compareTo(ParamsRequestCondition other, HttpServletRequest request) { } private long getValueMatchCount(Set expressions) { - return expressions.stream() - .filter(e -> e.getValue() != null && !e.isNegated()) - .count(); + long count = 0; + for (ParamExpression e : expressions) { + if (e.getValue() != null && !e.isNegated()) { + count++; + } + } + return count; }