@@ -117,7 +117,7 @@ private static void push(Method method, List<ResourceField> resourceFields, Obje
117117 resourceFields .stream ().forEach (resourceField -> {
118118 try {
119119 // source
120- Field sourceField = getSourceField (method , objectClass , resourceField .source ());
120+ Field sourceField = getSourceField (method , objectClass , resourceField .source (), resourceField . name () );
121121 // target
122122 Field resourceFieldInstance = getResourceField (method , objectClass , resourceField .name ());
123123
@@ -156,9 +156,9 @@ else if (resourceField.isList()) {
156156 * @return
157157 * @throws NoSuchFieldException
158158 */
159- private static Field getSourceField (Method method , Class objectClass , String sourceFieldName ) throws NoSuchFieldException {
159+ private static Field getSourceField (Method method , Class objectClass , String sourceFieldName , String resourceFieldName ) throws NoSuchFieldException {
160160 // cache from memory
161- ResourcePushField resourcePushField = ApiBootResourceContext .getPushFieldFromCache (method );
161+ ResourcePushField resourcePushField = ApiBootResourceContext .getPushFieldFromCache (method , resourceFieldName );
162162 // if don't have source field from cache
163163 if (ObjectUtils .isEmpty (resourcePushField ) || ObjectUtils .isEmpty (resourcePushField .getSourceField ())) {
164164 Field sourceField = objectClass .getDeclaredField (sourceFieldName );
@@ -172,7 +172,7 @@ private static Field getSourceField(Method method, Class objectClass, String sou
172172 }
173173
174174 // cache to memory
175- ApiBootResourceContext .setPushFieldToCache (method , resourcePushField );
175+ ApiBootResourceContext .setPushFieldToCache (method , resourceFieldName , resourcePushField );
176176 }
177177 return resourcePushField .getSourceField ();
178178 }
@@ -186,7 +186,7 @@ private static Field getSourceField(Method method, Class objectClass, String sou
186186 */
187187 private static Field getResourceField (Method method , Class objectClass , String resourceFieldName ) throws NoSuchFieldException {
188188 // cache from memory
189- ResourcePushField resourcePushField = ApiBootResourceContext .getPushFieldFromCache (method );
189+ ResourcePushField resourcePushField = ApiBootResourceContext .getPushFieldFromCache (method , resourceFieldName );
190190 // if don't have source field from cache
191191 if (ObjectUtils .isEmpty (resourcePushField ) || ObjectUtils .isEmpty (resourcePushField .getResourceField ())) {
192192 Field resourceFieldInstance = objectClass .getDeclaredField (resourceFieldName );
@@ -199,7 +199,7 @@ private static Field getResourceField(Method method, Class objectClass, String r
199199 resourcePushField .setResourceField (resourceFieldInstance );
200200 }
201201 // cache to memory
202- ApiBootResourceContext .setPushFieldToCache (method , resourcePushField );
202+ ApiBootResourceContext .setPushFieldToCache (method , resourceFieldName , resourcePushField );
203203 }
204204
205205 return resourcePushField .getResourceField ();
0 commit comments