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
On Guava 22: NoSuchMethodError: com.google.common.net.HostAndPort.fromHost #638
Comments
Correction: switching from |
Thanks for noting this. The issue has been resolved by #666. It's unfortunate that guava still considers HostAndPort to be "beta". It's been in guava since 10.0 (Sept 2011). It's generally quite useful and I'd rather not use a roll-your-own solution, but it's unfortunate that they are so quick to remove functionality just because they technically haven't removed the "beta" designation after 6 years. |
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 classcom.google.common.net.HostAndPort
is marked@Beta
. See https://github.com/google/guava/wiki/PhilosophyExplained#beta-apisThis could be handled by switching from
getHostText
togetHost
, but this would force users to upgrade to Guava2220 (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:The text was updated successfully, but these errors were encountered: