Moved a few variables closer to the point where they are actually used, but only in cases where this means moving them past a (potential) return/throw statement. (#1029)

This commit is contained in:
Koen De Groote
2017-05-21 21:51:58 +12:00
committed by Rob Bygrave
parent 9e2923f571
commit b4e2c89e2d
2 changed files with 6 additions and 4 deletions
@@ -27,16 +27,17 @@ public final class TimeStringParser implements StringParser {
}
String s = value.trim();
int minute;
int second;
int firstColon = s.indexOf(':');
int secondColon = s.indexOf(':', firstColon + 1);
if (firstColon == -1) {
throw new java.lang.IllegalArgumentException("No ':' in value [" + s + "]");
}
try {
int second;
int minute;
int hour = Integer.parseInt(s.substring(0, firstColon));
int secondColon = s.indexOf(':', firstColon + 1);
if (secondColon == -1) {
minute = Integer.parseInt(s.substring(firstColon + 1, s.length()));
second = 0;
@@ -2176,12 +2176,13 @@ public class BeanDescriptor<T> implements MetaBeanInfo, BeanType<T> {
if (basePos > -1) {
// nested or embedded property
String baseName = propName.substring(0, basePos);
String remainder = propName.substring(basePos + 1);
BeanProperty assocProp = _findBeanProperty(baseName);
if (assocProp == null) {
return null;
}
String remainder = propName.substring(basePos + 1);
return assocProp.buildElPropertyValue(propName, remainder, chain, propertyDeploy);
}