in static-analysis/autodispose-error-prone/src/main/java/autodispose2/errorprone/UseAutoDispose.java [152:169]
private static ImmutableSet<String> getClassesWithScope(
Optional<ImmutableSet<String>> inputClasses, Optional<Boolean> overrideScopes) {
if (inputClasses.isPresent()) {
if (overrideScopes.isPresent() && overrideScopes.get()) {
// The custom scopes are exclusive, just return that.
return inputClasses.get();
} else {
// The custom scopes aren't exclusive, so bundle them together with default scopes.
return ImmutableSet.<String>builder()
.addAll(DEFAULT_CLASSES_WITH_LIFECYCLE)
.addAll(inputClasses.get())
.build();
}
} else {
// No custom scopes. Return default scopes.
return DEFAULT_CLASSES_WITH_LIFECYCLE;
}
}