You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 helpersMoreObjects.toStringHelper
- we can easily generate the same from IDEAObjects.hashCode
,Optional<CyclicReference>
,Joiner.on(" -> ")
- can be replaced withObjects.hash
and the rest of the JDK 8 alternativesImmutableSetMultimap<String, CopyMethod>
- not sure yet, wouldunmodifiableMap of LinkedHashMap
suffice here - as used in other places? Or maybeVAVr
could be used to provide persistent datastructuresImmutableList<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 fromConcurrentHashMap
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.
The text was updated successfully, but these errors were encountered: