Improve usage of String.substring()

Closes gh-23923
This commit is contained in:
stsypanov
2019-11-03 22:05:12 +02:00
committed by Sam Brannen
parent f9c1f136c3
commit 9da15ee23a
5 changed files with 11 additions and 13 deletions

View File

@@ -127,9 +127,9 @@ public class AspectMetadata implements Serializable {
*/
private String findPerClause(Class<?> aspectClass) {
String str = aspectClass.getAnnotation(Aspect.class).value();
str = str.substring(str.indexOf('(') + 1);
str = str.substring(0, str.length() - 1);
return str;
int beginIndex = str.indexOf('(') + 1;
int endIndex = str.length() - 1;
return str.substring(beginIndex, endIndex);
}