Skip to content
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

why guava:31.0.1-android? #7254

Open
GGintama opened this issue Oct 11, 2022 · 3 comments
Open

why guava:31.0.1-android? #7254

GGintama opened this issue Oct 11, 2022 · 3 comments

Comments

@GGintama
Copy link

GGintama commented Oct 11, 2022

implementation("org.languagetool:language-en:5.9")

uesd in my gradle project (java8 ) ,it run errors.

Exception in thread "main" java.lang.IncompatibleClassChangeError: Class com.google.common.base.Suppliers$SupplierOfInstance does not implement the requested interface java.util.function.Supplier
at org.languagetool.rules.RuleMatch.getSuggestedReplacementObjects(RuleMatch.java:405)
at org.languagetool.JLanguageTool$TextCheckCallable.getTextLevelRuleMatches(JLanguageTool.java:1953)
at org.languagetool.JLanguageTool$TextCheckCallable.call(JLanguageTool.java:1905)
at org.languagetool.JLanguageTool$TextCheckCallable.call(JLanguageTool.java:1877)
at org.languagetool.JLanguageTool.performCheck(JLanguageTool.java:1338)
at org.languagetool.JLanguageTool.checkInternal(JLanguageTool.java:1016)
at org.languagetool.JLanguageTool.check(JLanguageTool.java:935)
at org.languagetool.JLanguageTool.check(JLanguageTool.java:920)
at org.languagetool.JLanguageTool.check(JLanguageTool.java:910)
at org.languagetool.JLanguageTool.check(JLanguageTool.java:892)
at org.languagetool.JLanguageTool.check(JLanguageTool.java:849)
at org.languagetool.JLanguageTool.check(JLanguageTool.java:833)
at TestMainClass.check(TestMainClass.java:27)
at TestMainClass.main(TestMainClass.java:17)

@nikialeksey
Copy link

The same issue for me on version 6.0

@nikialeksey
Copy link

I've fixed it using this:

    implementation('org.languagetool:language-all:6.0')
    implementation('com.google.guava:guava') {
        version {
            strictly '30.1-jre'
        }
    }

@mateuy-dev
Copy link

I've studied the issue.
Rule.java line 254 uses com.google.common.base.Suppliers.memoize function. This returns a com.google.common.base.Supplier. In older versions of guava this Google supplier implemented Java Supplier

public interface Supplier<T> extends java.util.function.Supplier<T>

However, in new versions it does not implement the java Supplier interface and LanguageTool fails to work.

I suppose that using the google supplier instead of the java Supplier inside this project should fix the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants