gson-comments/shrinker-test/src/main/java/com/example/ClassWithoutDefaultConstructor.java
Søren Gjesse 7b5629bcfc
Update ProGuard default shrinking rules (#2448)
* Update ProGuard default shrinking rules to correctly deal with classes without a no-args constructor

* Update test after changing default shrinking rules

* Adjust shrinker tests

* Update rules

* Addressed review comments

* Addressed more review comments

* Addressed more review comments

---------

Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>
2023-08-22 08:40:31 -07:00

18 lines
439 B
Java

package com.example;
import com.google.gson.annotations.SerializedName;
/**
* Class without no-args default constructor, but with field annotated with
* {@link SerializedName}.
*/
public class ClassWithoutDefaultConstructor {
@SerializedName("myField")
public int i;
// Specify explicit constructor with args to remove implicit no-args default constructor
public ClassWithoutDefaultConstructor(int i) {
this.i = i;
}
}