-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/issue#2436_enhancement
- Loading branch information
Showing
16 changed files
with
224 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
shrinker-test/src/main/java/com/example/ClassWithUnreferencedHasArgsConstructor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.example; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
|
||
/** | ||
* Class without no-args constructor, but with field annotated with | ||
* {@link SerializedName}. The constructor should not actually be used in the | ||
* code, but this shouldn't lead to R8 concluding that values of the type are | ||
* not constructible and therefore must be null. | ||
*/ | ||
public class ClassWithUnreferencedHasArgsConstructor { | ||
@SerializedName("myField") | ||
public int i; | ||
|
||
// Specify explicit constructor with args to remove implicit no-args default constructor | ||
public ClassWithUnreferencedHasArgsConstructor(int i) { | ||
this.i = i; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
shrinker-test/src/main/java/com/example/ClassWithUnreferencedNoArgsConstructor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.example; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
|
||
/** | ||
* Class with no-args constructor and with field annotated with | ||
* {@link SerializedName}. The constructor should not actually be used in the | ||
* code, but this shouldn't lead to R8 concluding that values of the type are | ||
* not constructible and therefore must be null. | ||
*/ | ||
public class ClassWithUnreferencedNoArgsConstructor { | ||
@SerializedName("myField") | ||
public int i; | ||
|
||
public ClassWithUnreferencedNoArgsConstructor() { | ||
i = -3; | ||
} | ||
} |
Oops, something went wrong.