[rules-dev] How to compare to Class type in LHS??
Felipe Piccolini
felipe.piccolini at bluesoft.cl
Tue Jul 24 16:14:46 EDT 2007
Thanks Edson. I'll get the last build from trunk... I'm working on an
idea for a testing framework I commented
to Michael Neale some time ago and needed that...
:)
On 24-07-2007, at 15:55, Edson Tirelli wrote:
>
> Felipe,
>
> The NPE is a bug that was fixed already.
> I can't think in another way of doing without using a return
> value restriction as you are doing...
>
> []s
> Edson
>
> 2007/7/24, Felipe Piccolini <felipe.piccolini at bluesoft.cl>:
> Hi,
>
> Im trying to compare a field to a Class type but when parsing I
> get NPE and when I debug,
> the constraint is a ReturnValueConstraint but the
> restriction.getRequiredDeclarations()
> return a Declaration[] array initializated, but empty, so I can't
> get the declaration evaluated...
> I needed because I'm working on a kind of parser for the rules for
> analisys and testing... but using
> the already parsed package.
>
> Here is a pseudo rule for test...
>
> rule "Test A"
> when
> $mf: MyFact(clazz == (SomeClass.class))
> then
> System.out.println("Test A: OK" );
> end
>
> Actualy, the rule compiles (with the NPE output, not stackTrace,
> just the java.lang.NullPointerException ,
> and it works fine.. I mean I get "Test A: OK" as output, but cant
> get the SomeClass.class reference when I
> look into the debugger.
>
> Is this the right way to compare clases? if not, whats the right
> way? (Im trying to not do == "SomeClass")
>
> Felipe Piccolini M.
> felipe.piccolini at bluesoft.cl
>
>
>
>
>
> _______________________________________________
> rules-dev mailing list
> rules-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev
>
>
>
>
> --
> Edson Tirelli
> Software Engineer - JBoss Rules Core Developer
> Office: +55 11 3529-6000
> Mobile: +55 11 9287-5646
> JBoss, a division of Red Hat @ www.jboss.com
> _______________________________________________
> rules-dev mailing list
> rules-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev
Atentamente,
______________________
Felipe Piccolini Marfull
Jefe de Proyectos
Agustina 1141 Piso 8-B
Santiago
Fono +(56 2) 68830837
E-mail felipe.piccolini at bluesoft.cl

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20070724/059b2ee0/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pastedGraphic.tiff
Type: image/tiff
Size: 262986 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/rules-dev/attachments/20070724/059b2ee0/attachment.tiff
More information about the rules-dev
mailing list