-
Notifications
You must be signed in to change notification settings - Fork 331
Migrate AutoValue to Records #1415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 18 commits
1b2483b
9c7e5d3
ed33a43
75a2d78
c43b083
76cf410
9ebfd92
506e4c4
a14c9ce
9de1799
32806d6
5dd8b69
f7fd4bd
21d6359
3000a24
f8671ff
fa305c1
91f0cdc
b449530
d85b929
06ccd25
c2e6bda
c67a209
158fbd2
daec884
99049cb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,24 +1,21 @@ | ||
| package com.uber.nullaway.libmodel; | ||
|
|
||
| import com.google.auto.value.AutoValue; | ||
| import com.google.common.collect.ImmutableMap; | ||
| import com.google.common.collect.ImmutableSet; | ||
|
|
||
| /** A record describing the annotations associated with a java method and its arguments. */ | ||
| @AutoValue | ||
| public abstract class MethodAnnotationsRecord { | ||
| /** A record describing the annotations associated with a java method and its arguments. | ||
| */ | ||
|
|
||
| public record MethodAnnotationsRecord(ImmutableSet<String> methodAnnotations, | ||
| ImmutableSet<Integer> typeParamNullableUpperbounds, | ||
| ImmutableMap<Integer, ImmutableSet<String>> argumentAnnotations) { | ||
|
|
||
| public static MethodAnnotationsRecord create( | ||
| ImmutableSet<String> methodAnnotations, | ||
| ImmutableSet<Integer> typeParamNullableUpperbounds, | ||
| ImmutableMap<Integer, ImmutableSet<String>> argumentAnnotations) { | ||
| return new AutoValue_MethodAnnotationsRecord( | ||
| return new MethodAnnotationsRecord( | ||
| methodAnnotations, typeParamNullableUpperbounds, argumentAnnotations); | ||
| } | ||
|
|
||
| abstract ImmutableSet<String> methodAnnotations(); | ||
|
|
||
| abstract ImmutableSet<Integer> typeParamNullableUpperbounds(); | ||
|
|
||
| abstract ImmutableMap<Integer, ImmutableSet<String>> argumentAnnotations(); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,7 +22,6 @@ | |
|
|
||
| package com.uber.nullaway; | ||
|
|
||
| import com.google.auto.value.AutoValue; | ||
| import com.google.common.base.Joiner; | ||
| import com.google.common.base.Preconditions; | ||
| import com.google.common.collect.ImmutableSet; | ||
|
|
@@ -613,11 +612,11 @@ public boolean warnOnGenericInferenceFailure() { | |
| return warnOnInferenceFailure; | ||
| } | ||
|
|
||
| @AutoValue | ||
| abstract static class MethodClassAndName { | ||
| record MethodClassAndName(String enclosingClass, | ||
| String methodName) { | ||
|
|
||
| static MethodClassAndName create(String enclosingClass, String methodName) { | ||
| return new AutoValue_ErrorProneCLIFlagsConfig_MethodClassAndName(enclosingClass, methodName); | ||
| return new MethodClassAndName(enclosingClass, methodName); | ||
| } | ||
|
||
|
|
||
| static MethodClassAndName fromClassDotMethod(String classDotMethod) { | ||
|
|
@@ -627,8 +626,5 @@ static MethodClassAndName fromClassDotMethod(String classDotMethod) { | |
| return MethodClassAndName.create(className, methodName); | ||
| } | ||
|
|
||
| abstract String enclosingClass(); | ||
|
|
||
| abstract String methodName(); | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.