Guillaume Laforge
added a comment - 27/Jul/04 10:52 AM As a temporary workaround, it seems you can do new Foo$Bar() instead of new Foo.Bar(). It seems we have a problem in the way we resolve class names currently :-/

I just tried this and it fails:
import org.drools.smf.SMFTestFrameWork;
SMFTestFrameWork.Cheese brie = new SMFTestFrameWork.Cheese("brie");

However if I do:
import org.drools.smf.SMFTestFrameWork.Cheese;
I can use it as:
Cheese brie = new Cheese("brie");

Trying to standadise some tests in drools, so would be nice if it could work the conventional way too.

The error:
groovy.lang.MissingClassException: No such class: SMFTestFrameWork in cast for c
lass: groovy. At [-1:-1] groovy.script
at org.codehaus.groovy.classgen.AsmClassGenerator2.checkValidType(AsmCla
ssGenerator2.java:4670)
at org.codehaus.groovy.classgen.AsmClassGenerator2.checkValidType(AsmCla
ssGenerator2.java:4659)
at org.codehaus.groovy.classgen.AsmClassGenerator2.visitCastExpression(A
smClassGenerator2.java:1806)
at org.codehaus.groovy.classgen.AsmClassGenerator2.evaluateEqual(AsmClas
sGenerator2.java:3937)
at org.codehaus.groovy.classgen.AsmClassGenerator2.visitBinaryExpression
(AsmClassGenerator2.java:1145)
at org.codehaus.groovy.ast.expr.BinaryExpression.visit(BinaryExpression.
java:335)
at org.codehaus.groovy.classgen.AsmClassGenerator2.visitAndAutoboxBoolea
n(AsmClassGenerator2.java:4094)
at org.codehaus.groovy.classgen.AsmClassGenerator2.evaluateExpression(As
mClassGenerator2.java:1113)
at org.codehaus.groovy.classgen.AsmClassGenerator2.visitReturnStatement(
AsmClassGenerator2.java:1040)
at org.codehaus.groovy.ast.stmt.ReturnStatement.visit(ReturnStatement.ja
va:69)
at org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVi
sitorSupport.java:108)
at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java
:79)
at org.codehaus.groovy.classgen.AsmClassGenerator2.visitMethod(AsmClassG
enerator2.java:404)
at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:811)
at org.codehaus.groovy.classgen.AsmClassGenerator2.visitClass(AsmClassGe
nerator2.java:306)
at org.codehaus.groovy.control.CompilationUnit$5.call(CompilationUnit.ja
va:579)
at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(
CompilationUnit.java:844)
at org.codehaus.groovy.control.CompilationUnit.classgen(CompilationUnit.
java:540)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.j
ava:446)

Mark Proctor
added a comment - 23/Oct/04 8:00 PM I just tried this and it fails:
import org.drools.smf.SMFTestFrameWork;
SMFTestFrameWork.Cheese brie = new SMFTestFrameWork.Cheese("brie");
However if I do:
import org.drools.smf.SMFTestFrameWork.Cheese;
I can use it as:
Cheese brie = new Cheese("brie");
Trying to standadise some tests in drools, so would be nice if it could work the conventional way too.
The error:
groovy.lang.MissingClassException: No such class: SMFTestFrameWork in cast for c
lass: groovy. At [-1:-1] groovy.script
at org.codehaus.groovy.classgen.AsmClassGenerator2.checkValidType(AsmCla
ssGenerator2.java:4670)
at org.codehaus.groovy.classgen.AsmClassGenerator2.checkValidType(AsmCla
ssGenerator2.java:4659)
at org.codehaus.groovy.classgen.AsmClassGenerator2.visitCastExpression(A
smClassGenerator2.java:1806)
at org.codehaus.groovy.classgen.AsmClassGenerator2.evaluateEqual(AsmClas
sGenerator2.java:3937)
at org.codehaus.groovy.classgen.AsmClassGenerator2.visitBinaryExpression
(AsmClassGenerator2.java:1145)
at org.codehaus.groovy.ast.expr.BinaryExpression.visit(BinaryExpression.
java:335)
at org.codehaus.groovy.classgen.AsmClassGenerator2.visitAndAutoboxBoolea
n(AsmClassGenerator2.java:4094)
at org.codehaus.groovy.classgen.AsmClassGenerator2.evaluateExpression(As
mClassGenerator2.java:1113)
at org.codehaus.groovy.classgen.AsmClassGenerator2.visitReturnStatement(
AsmClassGenerator2.java:1040)
at org.codehaus.groovy.ast.stmt.ReturnStatement.visit(ReturnStatement.ja
va:69)
at org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVi
sitorSupport.java:108)
at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java
:79)
at org.codehaus.groovy.classgen.AsmClassGenerator2.visitMethod(AsmClassG
enerator2.java:404)
at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:811)
at org.codehaus.groovy.classgen.AsmClassGenerator2.visitClass(AsmClassGe
nerator2.java:306)
at org.codehaus.groovy.control.CompilationUnit$5.call(CompilationUnit.ja
va:579)
at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(
CompilationUnit.java:844)
at org.codehaus.groovy.control.CompilationUnit.classgen(CompilationUnit.
java:540)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.j
ava:446)