diff --git a/nullaway/src/main/java/com/uber/nullaway/handlers/LibraryModelsHandler.java b/nullaway/src/main/java/com/uber/nullaway/handlers/LibraryModelsHandler.java index 646246275b..a5034f96bb 100644 --- a/nullaway/src/main/java/com/uber/nullaway/handlers/LibraryModelsHandler.java +++ b/nullaway/src/main/java/com/uber/nullaway/handlers/LibraryModelsHandler.java @@ -1370,8 +1370,8 @@ public ImmutableSetMultimap explicitlyNullableParameters() { for (Map.Entry> entry : innerEntry.getValue().entrySet()) { Integer index = entry.getKey(); if (index >= 0 && entry.getValue().stream().anyMatch(a -> a.contains("Nullable"))) { - // remove spaces - methodNameAndSignature = methodNameAndSignature.replaceAll("\\s", ""); + // remove spaces after commas + methodNameAndSignature = methodNameAndSignature.replaceAll(",\\s", ","); mapBuilder.put(methodRef(className, methodNameAndSignature), index); } } @@ -1403,8 +1403,8 @@ public ImmutableSetMultimap nonNullParameters() { + methodEntry.getKey() + " arg " + argEntry.getKey()); - // remove spaces - methodNameAndSignature = methodNameAndSignature.replaceAll("\\s", ""); + // remove spaces after commas + methodNameAndSignature = methodNameAndSignature.replaceAll(",\\s", ","); mapBuilder.put(methodRef(className, methodNameAndSignature), index); } }