-
Notifications
You must be signed in to change notification settings - Fork 670
Description
This is like #398, except this time the method getHostText
is missing because it is being removed from Guava. It's considered fair game because the class com.google.common.net.HostAndPort
is marked @Beta
. See https://github.com/google/guava/wiki/PhilosophyExplained#beta-apis
This could be handled by switching from getHostText
to getHost
, but this would force users to upgrade to Guava 22 20 (and upgrading Guava is often difficult, precisely because of problems like this).
I would recommend avoiding Guava's @Beta
classes/methods altogether (or perhaps Guava generally) in any library code, because they eventually lead to maintenance problems. Another option is to repackage the guava jar.
FindBugs with the extra detector GuavaBetaDetector can help to prevent @Beta
API calls from creeping in again:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<plugins>
<plugin>
<groupId>com.overstock.findbugs</groupId>
<artifactId>library-detectors</artifactId>
<version>1.1</version>
</plugin>
</plugins>
</configuration>
<executions>
<execution>
<id>default</id>
<phase>test</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>