diff options
author | David P. Baker <dpb@google.com> | 2021-05-25 09:47:54 -0700 |
---|---|---|
committer | Google Java Core Libraries <java-libraries-firehose+copybara@google.com> | 2021-05-25 09:48:27 -0700 |
commit | 123cc71251e1b1ed5a4e4f95c7e7224c8c7fb1b5 (patch) | |
tree | 1e4923cab29b457f63a8a0f2212151fb958a85f4 | |
parent | d4c865be14f28db279006e9f0241f067cb785d23 (diff) | |
download | auto-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.java | 3 |
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); |