On upgrading Guava to the latest 23.5-jre
from 18.0
I am getting an exception like below
Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;Ljava/lang/Object;)V
at com.van.common.VanExecutors.getSpec(VanExecutors.java:91)
at com.van.common.VanExecutors.newFixedSizeExecutor(VanExecutors.java:114)
at com.van.storage.config.ConfigStoreFactory.getOrCreateUncachedStore(ConfigStoreFactory.java:56)
at com.van.storage.config.ConfigStoreFactory.getOrCreateStore(ConfigStoreFactory.java:74)
at com.van.storage.config.PolicyManager.loadFromSystemProperties(PolicyManager.java:79)
at com.van.tools.metric.HbaseMetricStoreSetup.main(HbaseMetricStoreSetup.java:25)
The relevant code
private ExecutorSpec getSpec(String executorName) {
Preconditions.checkArgument(isValid(), "Not initialized");
Preconditions.checkArgument(NullOrEmpty.isFalse(executorName), "No executor name given");
Preconditions.checkArgument(POOL_NAME_PATTERN.matcher(executorName).matches(), "Executor name %s must end with -exec", executorName);
for (ExecutorSpec spec : executorsSpec.getExecutorSpecList()) {
if (spec.getName().equalsIgnoreCase(executorName)) return spec;
}
return null;
}
As per the stacktrace line 91 is the last Preconditions check.
Can someone let me know what is going wrong?