Description
I accidently stumbled over the problem that I could not use Java classes packaged in namespace 'as'.
Example (Java-Code with embedded Groovy-script):
import as.AsTest;
public class TestAs
{
// different trials:
private static String groovyCode1 =
"import as.AsTest as a; " +
"return new AsTest(); ";
private static String groovyCode2 =
"import as.*; " +
"return new AsTest(); ";
private static String groovyCode3 =
"return new as.AsTest(); ";
private static String groovyCode4 =
"import as.AsTest; " +
"return new AsTest(); ";
public static void main(String[] args)
{ AsTest a = new AsTest(); // Ok GroovyShell shell = new GroovyShell(new Binding()); Object value = shell.evaluate(groovyCode3); // ..1-4 System.out.println(value); return; }}
Error message is 'MultipleCompilationErrorsException'.
'as' is a reserved word in Groovy. Nevertheless I think 'as' should be allowed as namespace-name (as it is allowed in Java).