| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 916fba5 commit 5063d31
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1828,7 +1828,7 @@ private static String getKeyNameFromMethod(Method method) { | |||
| 1828 | 1828 | } | |
| 1829 | 1829 | } | |
| 1830 | 1830 | JSONPropertyName annotation = getAnnotation(method, JSONPropertyName.class); | |
| 1831 | - if (annotation != null && annotation.value() != null && !annotation.value().isEmpty()) { | ||
| 1831 | + if (annotationValueNotEmpty(annotation)) { | ||
| 1832 | 1832 | return annotation.value(); | |
| 1833 | 1833 | } | |
| 1834 | 1834 | String key; | |
@@ -1854,6 +1854,15 @@ private static String getKeyNameFromMethod(Method method) { | |||
| 1854 | 1854 | return key; | |
| 1855 | 1855 | } | |
| 1856 | 1856 | ||
| 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 | + | ||
| 1857 | 1866 | /** | |
| 1858 | 1867 | * Checks if the method is valid for the {@link #populateMap(Object, Set, JSONParserConfiguration)} use case | |
| 1859 | 1868 | * @param method the Method to check | |
| Back | FazBrowse Home | New Git URL |
0 commit comments