Search code examples
javaguava

Why should we not use Internal libraries and use original library?


I was using Guava Internal libraries in my project:

import org.glassfish.jersey.internal.guava.HashBasedTable;
import org.glassfish.jersey.internal.guava.Table;

It is suggested me to not use these internal and use original library.

Is there specific reasons of not using internals, i mean any legal concerns?


Solution

  • Internal packages are not meant to be used directly by clients of the library.

    The developers of the library have no obligation to keep the internal packages backwards compatible, and they may even eliminate some classes of the internal packages in future version, and replace them by others.

    If your code relies on internal packages, it has a high risk of breaking when you upgrade to future versions of the library.