Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce deliverable size by keeping Guava only as a test dependency #189

Open
paplorinc opened this issue Sep 22, 2022 · 0 comments
Open

Comments

@paplorinc
Copy link

paplorinc commented Sep 22, 2022

Most probably use this library in their tests, where additional dependencies probably don't matter that much.
I want to use it for production, where transitive dependencies should be minimized.
One of the bigger dependencies of the lib is Guava (~3 MB) and most of the production uses (~70, we could leave it for tests) could easily be replaced with more focused dependencies (some may be more difficult to eliminate, see below).

The use categories seem to be:

  • checkNotNull, checkArgument, firstNonNull - we can copy the trivial implementations to our own helpers
  • MoreObjects.toStringHelper- we can easily generate the same from IDEA
  • Objects.hashCode, Optional<CyclicReference>, Joiner.on(" -> ") - can be replaced with Objects.hash and the rest of the JDK 8 alternatives
  • ImmutableSetMultimap<String, CopyMethod> - not sure yet, would unmodifiableMap of LinkedHashMap suffice here - as used in other places? Or maybe VAVr could be used to provide persistent datastructures
  • ImmutableList<AnalysisResult>, ImmutableSet.copyOf, ImmutableList.of(1) - seems a bit inconsistent, when are we using immutable ones and when are we just wrapping with unmodifiable?
  • CacheBuilder.newBuilder().recordStats().build() - is this any different from ConcurrentHashMap in our case?
  • transform(dottedClassNames, AllowedIfOtherClassIsImmutable::new) - seems like a simple stream.

If you think this is a good idea, I can provide some PRs for the categories.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant