File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -1828,7 +1828,7 @@ private static String getKeyNameFromMethod(Method method) {
18281828 }
18291829 }
18301830 JSONPropertyName annotation = getAnnotation (method , JSONPropertyName .class );
1831- if (annotation != null && annotation . value () != null && ! annotation . value (). isEmpty ( )) {
1831+ if (annotationValueNotEmpty ( annotation )) {
18321832 return annotation .value ();
18331833 }
18341834 String key ;
@@ -1854,6 +1854,15 @@ private static String getKeyNameFromMethod(Method method) {
18541854 return key ;
18551855 }
18561856
1857+ /**
1858+ * checks if the annotation is not null and the {@link JSONPropertyName#value()} is not null and is not empty.
1859+ * @param annotation the annotation to check
1860+ * @return true if the annotation and the value is not null and not empty, false otherwise.
1861+ */
1862+ private static boolean annotationValueNotEmpty (JSONPropertyName annotation ) {
1863+ return annotation != null && annotation .value () != null && !annotation .value ().isEmpty ();
1864+ }
1865+
18571866 /**
18581867 * Checks if the method is valid for the {@link #populateMap(Object, Set, JSONParserConfiguration)} use case
18591868 * @param method the Method to check
You can’t perform that action at this time.
0 commit comments