@@ -114,7 +114,7 @@ static boolean isLikeGetter(String methodName) {
114114 return (methodName .startsWith ("get" ) || methodName .startsWith ("is" )) && !methodName .equals ("getClass" );
115115 }
116116
117- private void processProperty (String propertyName , Method method , StringBuilder out , Map <String , List <String >> classAnnotations ) throws IllegalAccessException , InvocationTargetException , NoSuchMethodException {
117+ private void processProperty (String propertyName , Method method , StringBuilder out , Map <String , List <String >> methodAnnotations ) throws IllegalAccessException , InvocationTargetException , NoSuchMethodException {
118118 var fieldBuffer = new StringBuilder ();
119119
120120 if (propertyName == null ) return ;
@@ -139,8 +139,8 @@ else if (annotationName.equals("JsonProperty")) {
139139
140140 fieldBuffer .append (propertyName );
141141
142- if (!classAnnotations .isEmpty ())
143- for (var annotation : classAnnotations .getOrDefault (method .getName (), emptyList ()))
142+ if (!methodAnnotations .isEmpty ())
143+ for (var annotation : methodAnnotations .getOrDefault (method .getName (), emptyList ()))
144144 if (annotation .contains ("Nullable;" ))
145145 fieldBuffer .append ("?" );
146146
@@ -247,7 +247,7 @@ public ClassAnnotationExtractor(Map<String, List<String>> annotations) {
247247 }
248248
249249 @ Override public MethodVisitor visitMethod (int access , String name , String desc , String signature , String [] exceptions ) {
250- if (!isPublic (access ) || ! isLikeGetter ( name ) ) return null ;
250+ if (!isPublic (access )) return null ;
251251 return new MethodAnnotationExtractor (annotations .computeIfAbsent (name , k -> new ArrayList <>()));
252252 }
253253 }
0 commit comments