3,645 questions
0
votes
1
answer
70
views
Gradle dependency `libs.guava` results in Gradle not Syncing anymore
After an upgrade whenever I try to Sync my gradle on a project I get this error:
Could not get unknown property 'guava' for extension 'libs' of type org.gradle.accessors.dm.LibrariesForLibs.
The ...
0
votes
1
answer
72
views
Is there any way to have a loading memory cache in PHP? [closed]
I want to avoid to use database connection to retrieve very repetitive content of my web app.
I would like to know if exists any way to use a memory cache (memcache?) with time expiration and loading ...
0
votes
1
answer
91
views
Is it correct that Guava DoubleMath.isMathematicalInteger(Double.MAX_VALUE) is true?
Passing Double.MAX_VALUE in Guava's DoubleMath.isMathematicalInteger() returns true. Is that correct?
I see that DoubleMath.isMathematicalInteger(Double.MIN_VALUE) returns false.
1
vote
1
answer
169
views
Cannot choose between the following variants of com.google.guava:guava:33.2.1-jre:
I've below build.gradle -
buildscript {
repositories {
maven {
name 'jenkins'
url 'https://repo.jenkins-ci.org/releases/'
}
}
}
plugins {
id '...
0
votes
0
answers
24
views
Hibernate: OneToMany Mapping with custom guava forwarding set
Consider a standard java entity BarEntity declaring a OneToMany relation to Set<FooEntity> fooEntities.
I would like to replace the Set<FooEntitty> with a guava ForwardingSet, giving me ...
0
votes
0
answers
47
views
Selenide + Selenium: NoSuchMethodError in Throwables.throwIfUnchecked() when launching Chrome
I am trying to run a simple Selenide test using Selenium 4.14.1, but I keep getting this error when launching Chrome:
Exception in thread "main" org.openqa.selenium....
0
votes
0
answers
39
views
Guava LRU cache that loads multiple keys in one shot
I am trying to find a mainstream cache for Java that supports:
LRU
Time-based eviction
Load multiple keys in one shot. The downstream service has an API to fetch multiple keys. I want to cache many ...
1
vote
0
answers
31
views
I cloned the Guava project and attempted to run the unit tests locally with JDK 11. Why do I encounter a java.lang.UnsupportedClassVersionError? [duplicate]
I cloned the Guava project and attempted to run the unit tests locally with JDK 11. Why do I encounter a java.lang.UnsupportedClassVersionError?I haven't made any modifications.
here is the error:
...
0
votes
0
answers
69
views
Guava Cache Entry Expiration
I have created a guava Cache indicating that entries should expire a fixed time after last access (using the expireAfterAccess() method of CacheBuilder).
I understand that calls to get() and put() on ...
0
votes
1
answer
405
views
How to create and use Resource with calendar by guava?
I'm using Calendar by guava tried to follow the documentation and the demo but couldn't get the result i'm looking for which is showing the appointments of a doctor. I succeeded to show the events ...
0
votes
1
answer
96
views
Guava RateLimiter doesn't allow within permit
I am using Guava (v 32.1.1) RateLimiter as following:
int permitsPerSecond = 10;
RateLimiter rateLimiter = RateLimiter.create(permitsPerSecond);
Stopwatch stopwatch = Stopwatch....
0
votes
0
answers
42
views
Maven build fails in Command line ; successful from eclipse
1.When I am trying to run jar file which is created by maven project through command line it is show error
2.After adding Guava version of 25.0-jre error occur
3.I am using selenium version 3.141.59 ...
-1
votes
1
answer
91
views
Why does Guava’s Preconditions class contain a private, empty and unused interface?
Guava’s Preconditions class is defined as:
public final class Preconditions {
private Preconditions() {}
private interface Impossible {}
// (static methods that are not using Impossible)
}
I ...
2
votes
0
answers
72
views
Why Lint recommends using standard Guava for an Android project
In my build.gradle I have defined Guava dependency as follows:
implementation("com.google.guava:guava:33.2.1-android")
This is flagged by Lint:
A newer version of com.google.guava:guava than ...
0
votes
1
answer
107
views
How to build a ImmutableListMultimap with sorted values
I am trying to build an ImmutableListMultimap which has sorted values. I tried the following but toImmutableListMultimap supports only value mapper and not the list of value mapper. Is there any other ...
0
votes
2
answers
113
views
Filter entries in Multimap to remove duplicates
I have a Google Guava MultiMap, namely com.google.common.collect.ArrayListMultimap, in Java that has a lot of entries. The entries are string, like this:
URL1=URL2
URL2=URL1
URL4=URL3
URL3=URL4
As ...
0
votes
0
answers
43
views
Google cache rebuild based on a condition
I have a requirement to rebuild the cache which is already declared and configured based on a condition.
private static final Cache<String, List<String>> CACHE = CacheBuilder.newBuilder()....
2
votes
1
answer
107
views
Guava minSdk is not a problem unless I shadow the library
I'm working on a public library, and I need to shadow some dependencies so that consumers of the library don't get conflicts. I'm working on adding Guava to the mix. When I add Guava directly I get no ...
1
vote
1
answer
761
views
How to avoid redundant configurations.all attribute declaration in Gradle multi-module project?
I'm working on a Gradle multi-module project where Service A (the library module) depends on the latest version of Guava (33.1.0-jre). To ensure proper Guava functionality, Service A's build.gradle ...
-2
votes
2
answers
121
views
Cannot resolve symbol 'MoreObjects'
I have this old legacy code:
dependency com.google.guava:guava:15.0
@Entity
@Table(name = "profiles")
public class Profile {
@Id
@Column(name = "id", nullable = false)
...
2
votes
1
answer
254
views
EhCache metrics do not appear in Prometheus if Guava cache is bound to MeterRegistry
Implicitly created EhCache caches
I have a Spring component which declares some caches using a file ehcache.xml with the following kind of configuration:
<?xml version="1.0" encoding=&...
1
vote
1
answer
75
views
Java: instantiate parametrized class by passing types as method parameter
My problem is that there is a generic class called TypedProducer<K, V> for key and value and I do have to instantiate it from configuration (let's say config tells me during runtime that key is ...
1
vote
0
answers
331
views
Exoplayer java.lang.NoSuchMethodError: No virtual method buildOrThrow()Lcom/google/common/collect/ImmutableMap. Activate Guava only for exoplayer
Hello i ran into an issue in my code, i was using Exploayer for a long time but i installed a new dependency to do something completely different(a .jar) and now every time i try to visualize ...
0
votes
1
answer
182
views
Does `onClose` propagates to underlying streams when they are merged?
My code merges (flatmap, concatenate) multiple IO streams into a single stream. Does wrapping that stream with a resource-with-try block properly close the underlying streams?
public ...
2
votes
0
answers
374
views
Java 21 virtual threads and Guava striped locks replacement
Striped locks, as popularized with Google Guava java library, allow the user to trade between required concurrency and memory footprint. However, I wonder if this is still true with Java 21 virtual ...
-1
votes
1
answer
187
views
Make Cache.get(key, mappingFunction) fail all waiting threads too if mappingFunction fails in Caffeine
Make Cache.get(key, mappingFunction) fail all waiting threads too if mappingFunction fails in Caffeine
If 3 threads come in parallel then currently if first get call fail after 1 mins, then second ...
0
votes
0
answers
52
views
Getting different result using same library in spark-shell and intellij project
I am using library guava from google to get the TLD and suffix from domains
my Implementation is like
def getTopPrivateDomain(urlString: String): String = {
try {
...
0
votes
1
answer
318
views
Can caffine cache removal listener may get called multiple times(concurrently) for the same entry
Can caffine cache removal listener may get called multiple times(concurrently) for the same entry.
Lets say Entry<Key,Value> is removed.
Can removal listener run multiple times(concurrently)for ...
0
votes
1
answer
1k
views
Caffeine Cache not working in Spring Boot
I have a Spring Boot application in which I have the following implementation of Caffeine to help me cache some tokens:
CacheConfig.java
@Configuration
@EnableCaching
@Profile("!test")
...
5
votes
3
answers
6k
views
How to exclude one of the variants of com.google.guava dependency while building Gradle projects
I have included the below dependency in the build.gradle file of my gradle project to work with VertexAi LLM Libraries.
implementation group: 'dev.langchain4j', name: 'langchain4j-vertex-ai', version: ...
0
votes
1
answer
134
views
Cannot use Guava library in iOS by Kotlin Multiplatform
I am trying to use Kotlin Multiplatform that targets both Android and iOS. But when running tests with the task "iosSimulatorArm64", these imports showed the error "unsolved reference&...
0
votes
0
answers
39
views
How can i add an library into my project repository on github?
Sorry for bad english. I made an java code and created a repository on github, but the library guava that i was using didnt go with the rest of the code. How can i add this library in my repository in ...
1
vote
0
answers
98
views
Java Map with Multimap values - how to efficient split the true entries from the false ones
I have a Map made up of this structure Map<String, Multimap<Boolean, String>> . I want to separate all the true entries in one new map and the false ones in a second. I have the following (...
0
votes
1
answer
295
views
Guava cache, one to many key-values
This is my first time posting a question here,and I'm new to Guava Cache, so please bare with me :).
Regarding the cache keys - In the DB itself the relation between my key to the values I'm ...
0
votes
0
answers
85
views
Is possible to construct a com.google.common.collect.Table from an existing map?
Suppose I have an existing Map<Integer, Map<Integer, String>> which contains items, I want to construct a com.google.common.collect.Table from that map for there's unnecessary data copy
0
votes
0
answers
281
views
Guava cache eviction before expireAfterWrite and before max size is reached
I'm using Guava cache as non-loading cache in my project and set the max size and expire after write
CacheBuilder.newBuilder()
.expireAfterWrite(1h)
.maximumSize(5000)
.recordStats()
I ...
4
votes
2
answers
746
views
Peeking into an iterator
Is there a way in Kotlin to "peek" into the next element of an iterator without advancing it? For an example use case, consider this function for merging two pre-sorted sequences:
fun merge(...
0
votes
2
answers
211
views
Best way to adapt Guava's AbstractExecutorService to achieve (gRPC) context propagation?
I had hoped to find a simple class that just does this in gRPC Context library, but sadly no luck. I want to wrap an arbitrary ExecutorService so it will wrap its tasks in order to propagate the ...
0
votes
1
answer
3k
views
Could not resolve com.google.guava:guava:31.1.-jre
I am trying to download the dependency serenity core 4xx version(testImplementation "net.serenity-bdd:serenity-core:4.0.0-beta-1") but its throwing the below error:
could not resolve com....
0
votes
1
answer
462
views
Xamarin Forms error with android 13: "Java.Lang.NoClassDefFoundError" Failed resolution of: Landroidx/concurrent/futures/AbstractResolvableFuture
After updating Xamarin Forms to version 5.0 and the Android project to version 13 (a lot of errors might be gone because the latest version requires Android 13, not 12 not 11 but it is not written ...
12
votes
2
answers
8k
views
How can I make Gradle pick the right guava variant?
I'm trying to use the OpenRewrite plugin in my Java project and it requires guava.
Gradle is unable to choose between two variants because the plugin doesn't check attribute org.gradle.jvm.environment....
1
vote
2
answers
632
views
Why is JSON serialization different in test than it is in main when using Spring Boot?
I am noticing that out of the box JSON serialization does not work the same in production vs. unit tests. Things that work perfectly fine when I run the app with ./gradlew bootRun fail in unit tests. ...
0
votes
1
answer
4k
views
Getting java.lang.NoClassDefFoundError for class io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder
I am running a jar on spark slave with version spark-2.5.6-bin-hadoop where i am getting this error on submitting the jar
Exception occurred while create new JwtSource
java.lang.NoClassDefFoundError: ...
0
votes
0
answers
34
views
Graph - How to use topological sort to execute dependency tasks [duplicate]
I have a usecase where I have jobs which can have dependencies or be boxes containing other jobs like in autosys.
For e.g JOB_BOX contains JOB1, JOB2 and JOB3 where JOB2 depends on JOB1 and JOB3 ...
2
votes
0
answers
156
views
How to build a guava LoadingCache with case insensitive String keys
I'm looking to make use of a guava loading cache, defined so far as follows. I would like the keys used as a string to be case insensitive. Ideally, I would prefer the cache to handle this, rather ...
-1
votes
1
answer
149
views
Guava issue when starting Asterisk-Java
I'm trying to compile a project and it uses guava. The project is Asterisk-Java (https://github.com/asterisk-java/asterisk-java) and when I'm trying to run the .jar with the command java -cp asterisk-...
0
votes
0
answers
322
views
What is the right way to call com.google.common.collect.Lists.cartesianProduct()?
I am trying to call com.google.common.collect.Lists.cartesianProduct(...), but I keep getting a NoSuchMethodError. I would happily use either the version that expects a List of Lists as an argument or ...
0
votes
1
answer
76
views
Sort list based on comparator defined on another list using Guava Ordering
I've two lists of same size : List<A>listA, List<B>listB that are completely independent of each other.
I'd like to sort listA based on how the elements move in listB.
Assume there's an ...
0
votes
0
answers
18
views
Compare more than 2 json file for common properties - Java [duplicate]
I have a list of json property files ( around 20 json property files)
Now, need is to find common properties across these json files.
I have used guava api json file comparison, it compares 2 json ...
0
votes
1
answer
2k
views
pom.xml file is showing these yellow color warnings in IntelliJIDEA while I can run the project just fine
I am using Appium 2.0.0-beta66, Java Client 8.5.0, node 18.xx, Selenium-java 4.9.1, Selenium Server 3.141.59, TestNG 7.7.1, and JDK 1.15.0-02, what is the next long term JDK I can go for ?
BTW, I am ...