File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
spring-webflux/src/main/java/org/springframework/web/reactive/result/condition
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -128,9 +128,10 @@ else if (this.version != null && otherVersion != null) {
128128 return (-1 * compareVersions (this .version , otherVersion ));
129129 }
130130 else {
131- // Prefer mapping without version for unversioned request
131+ // Prefer mappings with a version unless the request is without a version
132+ int result = this .version != null ? -1 : 1 ;
132133 Comparable <?> version = exchange .getAttribute (HandlerMapping .API_VERSION_ATTRIBUTE );
133- return (version != null ? ( this . version ! = null ? -1 : 1 ) : ( this . version != null ? 1 : - 1 ) );
134+ return (version = = null ? -1 * result : result );
134135 }
135136 }
136137
Original file line number Diff line number Diff line change @@ -127,9 +127,10 @@ else if (this.version != null && otherVersion != null) {
127127 return (-1 * compareVersions (this .version , otherVersion ));
128128 }
129129 else {
130- // Prefer mapping without version for unversioned request
130+ // Prefer mappings with a version unless the request is without a version
131+ int result = this .version != null ? -1 : 1 ;
131132 Comparable <?> version = (Comparable <?>) request .getAttribute (HandlerMapping .API_VERSION_ATTRIBUTE );
132- return (version != null ? ( this . version ! = null ? -1 : 1 ) : ( this . version != null ? 1 : - 1 ) );
133+ return (version = = null ? -1 * result : result );
133134 }
134135 }
135136
You can’t perform that action at this time.
0 commit comments