aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid P. Baker <dpb@google.com>2021-05-25 09:47:54 -0700
committerGoogle Java Core Libraries <java-libraries-firehose+copybara@google.com>2021-05-25 09:48:27 -0700
commit123cc71251e1b1ed5a4e4f95c7e7224c8c7fb1b5 (patch)
tree1e4923cab29b457f63a8a0f2212151fb958a85f4
parentd4c865be14f28db279006e9f0241f067cb785d23 (diff)
downloadauto-123cc71251e1b1ed5a4e4f95c7e7224c8c7fb1b5.tar.gz
Use the return value of `addAll()` instead of making separate calls to `containsAll()` and `addAll()`.
RELNOTES=n/a PiperOrigin-RevId: 375727307
-rw-r--r--service/processor/src/main/java/com/google/auto/service/processor/AutoServiceProcessor.java3
1 files changed, 1 insertions, 2 deletions
diff --git a/service/processor/src/main/java/com/google/auto/service/processor/AutoServiceProcessor.java b/service/processor/src/main/java/com/google/auto/service/processor/AutoServiceProcessor.java
index e70cf6c9..932a0fdf 100644
--- a/service/processor/src/main/java/com/google/auto/service/processor/AutoServiceProcessor.java
+++ b/service/processor/src/main/java/com/google/auto/service/processor/AutoServiceProcessor.java
@@ -186,12 +186,11 @@ public class AutoServiceProcessor extends AbstractProcessor {
}
Set<String> newServices = new HashSet<>(providers.get(providerInterface));
- if (allServices.containsAll(newServices)) {
+ if (!allServices.addAll(newServices)) {
log("No new service entries being added.");
continue;
}
- allServices.addAll(newServices);
log("New service file contents: " + allServices);
FileObject fileObject = filer.createResource(StandardLocation.CLASS_OUTPUT, "",
resourceFile);