Skip to content

Commit

Permalink
Add a MCVE for NonApiType and a record.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 713309496
  • Loading branch information
kluever authored and Error Prone Team committed Jan 8, 2025
1 parent 650a95f commit d9ee5d5
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -345,4 +345,24 @@ public Record(ArrayList<String> a) {
""")
.doTest();
}

@Test
public void recordCompactConstructor_notFlagged() {
helper
.addSourceLines(
"Test.java",
"""
import static com.google.common.base.Preconditions.checkArgument;
import com.google.common.collect.ImmutableSet;
public class Test {
public record RecordWithImmutableSet(ImmutableSet<String> ids) {
public RecordWithImmutableSet {
ids.forEach(id -> checkArgument(!id.isBlank()));
}
}
}
""")
.doTest();
}
}

0 comments on commit d9ee5d5

Please sign in to comment.