From 83996b12cc0597896722cd4e4c08ed117600f75e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B5=D1=80=D0=B3=D0=B5=D0=B9=20=D0=A6=D1=8B=D0=BF?= =?UTF-8?q?=D0=B0=D0=BD=D0=BE=D0=B2?= Date: Mon, 16 Nov 2020 15:51:08 +0200 Subject: [PATCH] Simplify AstUtils.getPropertyAccessorsToTry() --- .../org/springframework/expression/spel/ast/AstUtils.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/spring-expression/src/main/java/org/springframework/expression/spel/ast/AstUtils.java b/spring-expression/src/main/java/org/springframework/expression/spel/ast/AstUtils.java index 78bf5536ec..ac7a9f0db1 100644 --- a/spring-expression/src/main/java/org/springframework/expression/spel/ast/AstUtils.java +++ b/spring-expression/src/main/java/org/springframework/expression/spel/ast/AstUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2020 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. @@ -54,10 +54,9 @@ public abstract class AstUtils { } else { if (targetType != null) { - int pos = 0; for (Class clazz : targets) { if (clazz == targetType) { // put exact matches on the front to be tried first? - specificAccessors.add(pos++, resolver); + specificAccessors.add(resolver); } else if (clazz.isAssignableFrom(targetType)) { // put supertype matches at the end of the // specificAccessor list