Bug #3416

Mis à jour par Serge Heiden il y a environ 2 ans

<pre>
def s = "$variable"
Partition p = ...(s)
p.compute()
</pre>

Raises excception:
<pre>
** class org.codehaus.groovy.runtime.GStringImpl cannot be cast to class java.lang.String (org.codehaus.groovy.runtime.GStringImpl is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @156106f5; java.lang.String is in module java.base of loader 'bootstrap').
</pre>

h3. Solution 0

Force resolution of the GStringImpl before using it
<pre>
String s = "$variable"
</pre>
or
<pre>
s = ''+"$variable"
</pre>
or
<pre>
s = "$variable".toString()
...
</pre>

h3. Solution

Understand why GStringImpl is not mutated in a String when called from the EquinoxLoader (org.txm.rcp) which has the Groovy classes in its classloader

Retour