mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-17 16:39:29 +00:00
Prior to this commit, Property.resolveName() located the "set" prefix of a write method with String.indexOf(), which matches the token anywhere in the method name. A write method that merely contains "set" (for example "offsetX" or "upset") was silently accepted and resolved to a meaningless property name derived from whatever follows the token, while only names with no "set" token at all were rejected. To address that, this commit matches the "set" prefix only at the start of the method name via startsWith(), so that an IllegalArgumentException is consistently thrown for any write method candidate that is not a setter. See gh-36911 Closes gh-37139 Signed-off-by: junhyeong9812 <pickjog@gmail.com>