groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexey Belostotskiy <lexek...@ya.ru>
Subject GroovyDoc classloader issue
Date Tue, 19 Feb 2019 15:23:58 GMT
<div xmlns="http://www.w3.org/1999/xhtml">Hello,</div><div xmlns="http://www.w3.org/1999/xhtml"> </div><div
xmlns="http://www.w3.org/1999/xhtml">We're generating groovydocs in runtime in our app.
We use groovydoc as a library, not standalone tool.</div><div xmlns="http://www.w3.org/1999/xhtml"> </div><div
xmlns="http://www.w3.org/1999/xhtml">It mostly works, but we're experiencing issues with
some classes ending up unresolved. I found out that this happens because <span style="font-family:courier
new,monospace;">SimpleGroovyClassDoc</span> is calling its <span style="font-family:courier
new,monospace;">getClass().getClassLoader()</span> to get classloader for class resolution.
But in our case, most of classes that we want to link should be loaded via different classloader.</div><div
xmlns="http://www.w3.org/1999/xhtml"> </div><div xmlns="http://www.w3.org/1999/xhtml">Basically,
solution that would work for us, is to replace <span style="font-family:courier new,monospace;">getClass().getClassLoader()</span>
calls in <span style="font-family:courier new,monospace;">SimpleGroovyClassDoc</span>
with <span style="font-family:courier new,monospace;">Thread.currentThread().getContextClassLoader()</span>,
but that might be a breaking change.</div><div xmlns="http://www.w3.org/1999/xhtml"> </div><div
xmlns="http://www.w3.org/1999/xhtml">I'm not sure what the process is for requesting such
changes and whether it's something that Groovy team is willing to implement.</div>
Mime
View raw message