Skip to content

Commit

Permalink
Extend raw ComparableSubject instead of supplying type parameters.
Browse files Browse the repository at this point in the history
The self-type parameter is being removed from ComparableSubject. In order to remove one type parameter while leaving the other in place, it's necessary either to make an atomic change (which is tricky for third-party code) or to temporarily remove *both* type parameters and then put the one back. This CL implements the latter. This CL will temporarily produce rawtypes warnings -- and temporarily eliminate type-checking of calls to the ComparableSubject methods -- which will go away when I remove the type parameters (as soon as this batch of CLs is submitted).

This CL requires Truth 0.45. I should already have another CL out to you (perhaps even already submitted) to make other changes to prepare for Truth 0.45.

PiperOrigin-RevId: 251895062
  • Loading branch information
cpovirk authored and glide-copybara-robot committed Jun 6, 2019
1 parent 6022f50 commit cd37a54
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,9 @@ private static void deleteDirectory(File file) {
assertThat(!file.exists() || file.delete()).isTrue();
}

static final class FileSubject extends ComparableSubject<FileSubject, File> {
// TODO(b/134664588): Remove after go/truth-subject-lsc
@SuppressWarnings({"rawtypes", "unchecked"})
static final class FileSubject extends ComparableSubject {
private static final Subject.Factory<FileSubject, File> FACTORY =
new Subject.Factory<FileSubject, File>() {
@Override
Expand Down

0 comments on commit cd37a54

Please sign in to comment.