msgilligan / modular-guava

Most of com.google.common repackaged and modularized

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

guava

What

This package is a fork of Guava around roughly release 32.1.1 which

  • Is shaded under dev.mccue.guava
  • Has a proper module-info.java
  • Has all usages of sun.misc.* removed

This is an aggregator module and each package of guava has been split into submodules which can be found here

Why

Why Not

  • The transformation from Guava code to this was not entirely mechanical.
  • I did make some small changes to APIs and internals that were Java 8 specific.
  • I haven't ported over the unit tests
  • GWT, j2objc, j2cl, etc. are not things I care about or want to support.
  • Does not include any android specific code. Equivalent to the -jre build.
  • Compiled for Java 9+, not Java 8
  • Does not include
    • com.google.common.eventbus (Guava docs explicitly recommends against its use)
    • com.google.common.cache (Caffiene covers that use.)
    • com.google.common.annotations (Only @Beta and @VisibleForTesting would be relevant without GWT+etc. testing, and you can make your own pretty easily.)

If you have a use for this

Click to expand

The biggest thing holding this back from being a "reliable" project is that the transformation from Guava to the subpackages was done manually. If that transformation is scripted (with something like OpenRewrite) then I could more easily keep this up to date with guava's development and test only the parts I make changes to.

I am willing to do that work, but only if it will genuinely help someone. So reach out to me over discord, reddit, slack, or email. I'm happy enough to stop here otherwise since I got my fun jlink builds working.

Usage

For the most part, you should be able to just find+replace all references to com.google.common with dev.mccue.guava.

Consult the original documentation for in-depth usage guides.

<dependency>
    <groupId>dev.mccue</groupId>
    <artifactId>guava</artifactId>
    <version>0.0.2</version>
</dependency>

About

Most of com.google.common repackaged and modularized

License:Apache License 2.0


Languages

Language:Java 100.0%