-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Most DTOs in the PubNub SDK don't have a default (empty) constructor. Gson, which is used to serialize and deserialize the DTOs, uses the empty constructor to create instances of the DTO classes. If this is not possible (as it is the case in most classes of the PubNub SDK), sun.misc.Unsafe.allocateInstance() is used for the allocation. This works fine under normal circumstances. However, since we use PubNub on a hardware with limited resources, we try to minimize the JRE size and memory usage. We use a tailored JRE that includes as few modules as possible.
sun.misc.Unsafe.allocateInstance() is part of the jdk.unsupported module, which we normally don't include in our JRE.
It would be helpful for us if empty constructors were added to all DTOs (for example with Lombok's @NoArgsConstructor) so that the PubNub SDK worked without the jdk.unsupported module.