Skip to content

Commit 817e80c

Browse files
committed
Property actually throws exception for no write method found
Issue: SPR-15507
1 parent 7ca0094 commit 817e80c

File tree

1 file changed

+3
-2
lines changed
  • spring-core/src/main/java/org/springframework/core/convert

1 file changed

+3
-2
lines changed

spring-core/src/main/java/org/springframework/core/convert/Property.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -143,10 +143,11 @@ private String resolveName() {
143143
return StringUtils.uncapitalize(this.readMethod.getName().substring(index));
144144
}
145145
else {
146-
int index = this.writeMethod.getName().indexOf("set") + 3;
146+
int index = this.writeMethod.getName().indexOf("set");
147147
if (index == -1) {
148148
throw new IllegalArgumentException("Not a setter method");
149149
}
150+
index += 3;
150151
return StringUtils.uncapitalize(this.writeMethod.getName().substring(index));
151152
}
152153
}

0 commit comments

Comments
 (0)