Skip to content

Commit 5fec7af

Browse files
committed
Address review comments
1 parent 0eec539 commit 5fec7af

File tree

3 files changed

+4
-7
lines changed
  • annotator-core/src
    • main/java/edu/ucr/cs/riple/core/checkers/nullaway
    • test
      • java/edu/ucr/cs/riple/core
      • resources/assignNullableToNonnullArrayComponentTypeTest/expected/Target/src/main/java/test

3 files changed

+4
-7
lines changed

annotator-core/src/main/java/edu/ucr/cs/riple/core/checkers/nullaway/NullAway.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ private NullAwayError deserializeErrorFromTSVLine(ModuleInfo moduleInfo, String
136136
annotations = Set.of();
137137
} else if (Utility.isTypeUseAnnotation(config.nullableAnnot)) {
138138
if (errorType.equals(NullAwayError.ASSIGN_NULLABLE_TO_NONNULL_ARRAY)) {
139+
// The typeIndex ImmutableList.of(1, 0) specifies that the annotation
140+
// should be applied to the array's component type.
139141
annotations =
140142
Set.of(
141143
new AddTypeUseMarkerAnnotation(

annotator-core/src/test/java/edu/ucr/cs/riple/core/CoreTest.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ public void nonnullTypeUseAnnotationOnFormalParameterAcknowledgmentTest() {
575575
}
576576

577577
@Test
578-
public void fieldAssignNullableNonNullArrayContent() {
578+
public void assignNullableToNonnullArrayComponentTypeTest() {
579579
coreTestHelper
580580
.onTarget()
581581
.withSourceLines(
@@ -592,13 +592,8 @@ public void fieldAssignNullableNonNullArrayContent() {
592592
new OnField("Main.java", "test.Main", Set.of("arr")),
593593
ImmutableList.of(ImmutableList.of(1, 0)),
594594
-1))
595-
.setPredicate(
596-
(expected, found) ->
597-
expected.root.equals(found.root)
598-
&& expected.getOverallEffect(coreTestHelper.getConfig())
599-
== found.getOverallEffect(coreTestHelper.getConfig()))
600595
.disableBailOut()
601-
.checkExpectedOutput("fieldAssignNullableNonNullArrayContent/expected")
596+
.checkExpectedOutput("assignNullableToNonnullArrayComponentTypeTest/expected")
602597
.enableJSpecifyMode()
603598
.start();
604599
}

0 commit comments

Comments
 (0)