Hahaha, I know this.
Have seen it on other cases, too. Seems to happen when you create long
lists based on methods that use generics for their return type.
The workaround is to hardcode the type in the asList() call, then the
code does not have to handle the generic return of each parameter:
Arrays.<Entry<String,String>>asList(....)
Uwe
Am 16.01.2025 um 16:36 schrieb Dawid Weiss:
Not directly related to Lucene, but I think many of you will
appreciate it (and review your code in case you're using this kind of
initialization pattern with multiple values...).
In short, if you're on Linux:
1:
( echo "import java.util.*; class Ouch { void o() {
List<Map.Entry<String, String>> v = Arrays.asList("; for i in `seq 1
1000`; do echo 'Map.entry("key", "value"), '; done; echo ' null); } }'
) > Ouch.java
2:
javac Ouch.java
3:
Go, make yourself a coffee and wait for the compilation of the above.
More details here:
https://mail.openjdk.org/pipermail/compiler-dev/2025-January/029197.html
As Vicente Romero pointed out on the mailing list, this seems to be a
known issue [1]. Surprising and unpleasant when it affects you (I
spent two hours debugging why gradle compilation all of a sudden got
so slow...).
Dawid
[1] https://bugs.openjdk.org/browse/JDK-8302292
--
Uwe Schindler
Achterdiek 19, D-28357 Bremen
https://www.thetaphi.de
eMail:u...@thetaphi.de