square / javapoet

A Java API for generating .java source files.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AnnotationSpec#get(Annotation) fails on member with type long

Tim203 opened this issue · comments

AnnotationSpec.Builder#addMemberForValue(String, Object) works perfectly for other special cases like adding F for floats as the default is double.
However it seems like the special case for longs has been forgotten. The default is int, and when a number doesn't fit in an int the compiler will say: integer number too large.
L should be added to long types, just like F is added to floats, to prevent this error.