Hi,
I've got a class that is initialized with Jena's registered languages:
public MediaTypes()
{
this(RDFLanguages.getRegisteredLanguages(), UTF8_PARAM);
}
protected MediaTypes(Collection<Lang> registered, Map<String,
String> parameters)
{
...
Iterator<Lang> langIt = registered.iterator();
while (langIt.hasNext())
{
Lang lang = langIt.next();
...
After the upgrade to 3.16.0-SNAPSHOT, I am getting a
ConcurrentModificationException on the langIt.next() (worked without
problems with 3.0.1).
I've been able to debug that the MediaTypes() constructor is being
called while Jena's languages are not done initializing yet.
The breakpoint at line 256 is from within RDFLanguages.register(Lang
lang); at line 71 is the MediaTypes() constructor.
...
Breakpoint hit at line 256 in class org.apache.jena.riot.RDFLanguages
by thread http-nio-8080-exec-290.
Breakpoint hit at line 256 in class org.apache.jena.riot.RDFLanguages
by thread http-nio-8080-exec-290.
Breakpoint hit at line 71 in class com.atomgraph.core.MediaTypes by
thread http-nio-8080-exec-290.
Breakpoint hit at line 256 in class org.apache.jena.riot.RDFLanguages
by thread http-nio-8080-exec-290.
Breakpoint hit at line 256 in class org.apache.jena.riot.RDFLanguages
by thread http-nio-8080-exec-290.
...
I cannot get the caller info with NetBeans, but I'm quite sure these
are Jena's internal RDFLanguages.register() calls as I've removed all
calls from our code for now.
This is more of a general static initialization problem I suppose, but
how would you go about addressing it? How does one get all the
languages from RDFLanguages.getRegisteredLanguages()? There's no hook
that would notify completed registration AFAIK.
Thanks.
Martynas