You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Signatures, i.e. the keys used to replace fragments of class files, are not properly sanitized when constructed from attribute or method types.
Example
If an attribute bar has type Map<String, @NonNull Object>, it initially generates fragments with signatures like class/Foo/method/setBar(Map<String, @NonNull Object>). When parsing the generated file in the next run, the method is parsed with the (correct) signature class/Foo/method/setBar(Map<String,Object>) - note the lack of the annotations and the missing space after the comma. The obvious mismatch causes a second method to be generated.
Solution
The solution is to sanitize the user-supplied types like Map<String, @NonNull Object> and transform them for use in signatures, in this case Map<String,Object>. The implementation for the method parser can be mostly reused in this regard.
The text was updated successfully, but these errors were encountered:
Summary
Signatures, i.e. the keys used to replace fragments of class files, are not properly sanitized when constructed from attribute or method types.
Example
If an attribute
bar
has typeMap<String, @NonNull Object>
, it initially generates fragments with signatures likeclass/Foo/method/setBar(Map<String, @NonNull Object>)
. When parsing the generated file in the next run, the method is parsed with the (correct) signatureclass/Foo/method/setBar(Map<String,Object>)
- note the lack of the annotations and the missing space after the comma. The obvious mismatch causes a second method to be generated.Solution
The solution is to sanitize the user-supplied types like
Map<String, @NonNull Object>
and transform them for use in signatures, in this caseMap<String,Object>
. The implementation for the method parser can be mostly reused in this regard.The text was updated successfully, but these errors were encountered: