@@ -64,11 +64,11 @@ default PropertyPath getLeafProperty() {
64
64
65
65
PropertyPath result = this ;
66
66
67
- while (result .hasNext ()) {
67
+ while (result != null && result .hasNext ()) {
68
68
result = result .next ();
69
69
}
70
70
71
- return result ;
71
+ return result == null ? this : result ;
72
72
}
73
73
74
74
/**
@@ -158,8 +158,8 @@ default PropertyPath nested(String path) {
158
158
}
159
159
160
160
/**
161
- * Returns an {@link Iterator < PropertyPath> } that iterates over all the partial property paths with the same leaf
162
- * type but decreasing length. For example:
161
+ * Returns an {@link Iterator Iterator of PropertyPath} that iterates over all the partial property paths with the
162
+ * same leaf type but decreasing length. For example:
163
163
*
164
164
* <pre class="code">
165
165
* PropertyPath propertyPath = PropertyPath.from("a.b.c", Some.class);
@@ -179,13 +179,12 @@ default PropertyPath nested(String path) {
179
179
180
180
/**
181
181
* Extracts the {@link PropertyPath} chain from the given source {@link String} and {@link TypeInformation}. <br />
182
- * Uses {@link SimplePropertyPath#SPLITTER } by default and {@link SimplePropertyPath#SPLITTER_FOR_QUOTED } for
182
+ * Uses {@code (?:[%s]?([%s]*?[^%s]+)) } by default and {@code (?:[%s]?([%s]*?[^%s]+)) } for
183
183
* {@link Pattern#quote(String) quoted} literals.
184
184
* <p>
185
185
* Separate parts of the path may be separated by {@code "."} or by {@code "_"} or by camel case. When the match to
186
- * properties is ambiguous longer property names are preferred. So for "userAddressCity" the interpretation
187
- * "userAddress.city" is preferred over "user.address.city".
188
- * </p>
186
+ * properties is ambiguous longer property names are preferred. So for {@code userAddressCity} the interpretation
187
+ * {@code userAddress.city} is preferred over {@code user.address.city}.
189
188
*
190
189
* @param source a String denoting the property path, must not be {@literal null}.
191
190
* @param type the owning type of the property path, must not be {@literal null}.
@@ -197,13 +196,12 @@ static PropertyPath from(String source, Class<?> type) {
197
196
198
197
/**
199
198
* Extracts the {@link PropertyPath} chain from the given source {@link String} and {@link TypeInformation}. <br />
200
- * Uses {@link SimplePropertyPath#SPLITTER } by default and {@link SimplePropertyPath#SPLITTER_FOR_QUOTED } for
199
+ * Uses {@code (?:[%s]?([%s]*?[^%s]+)) } by default and {@code (?:[%s]?([%s]*?[^%s]+)) } for
201
200
* {@link Pattern#quote(String) quoted} literals.
202
201
* <p>
203
202
* Separate parts of the path may be separated by {@code "."} or by {@code "_"} or by camel case. When the match to
204
- * properties is ambiguous longer property names are preferred. So for "userAddressCity" the interpretation
205
- * "userAddress.city" is preferred over "user.address.city".
206
- * </p>
203
+ * properties is ambiguous longer property names are preferred. So for {@code userAddressCity} the interpretation
204
+ * {@code userAddress.city} is preferred over {@code user.address.city}.
207
205
*
208
206
* @param source a String denoting the property path, must not be {@literal null}.
209
207
* @param type the owning type of the property path, must not be {@literal null}.
0 commit comments