<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">Hi,<DIV><BR class="khtml-block-placeholder"></DIV><DIV> Im trying to compare a field to a Class type but when parsing I get NPE and when I debug,</DIV><DIV>the constraint is a ReturnValueConstraint but the <FONT class="Apple-style-span" color="#0000C0" face="Monaco" size="3"><SPAN class="Apple-style-span" style="font-size: 11px;">restriction</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="3"><SPAN class="Apple-style-span" style="font-size: 11px;">.getRequiredDeclarations()</SPAN></FONT> </DIV><DIV>return a Declaration[] array initializated, but empty, so I can't get the declaration evaluated... </DIV><DIV>I needed because I'm working on a kind of parser for the rules for analisys and testing... but using </DIV><DIV>the already parsed package.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Here is a pseudo rule for test...</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" color="#960000" face="Monaco" size="3"><SPAN class="Apple-style-span" style="font-size: 11px;">rule</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="3"><SPAN class="Apple-style-span" style="font-size: 11px;"> </SPAN></FONT><FONT class="Apple-style-span" color="#008000" face="Monaco" size="3"><SPAN class="Apple-style-span" style="font-size: 11px;">"Test A"</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><FONT class="Apple-style-span" color="#960000" face="Monaco" size="3"><SPAN class="Apple-style-span" style="font-size: 11px;">when</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><FONT class="Apple-style-span" face="Monaco" size="3"><SPAN class="Apple-style-span" style="font-size: 11px;">$mf: MyFact(clazz == (SomeClass.class))</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><FONT class="Apple-style-span" color="#960000" face="Monaco" size="3"><SPAN class="Apple-style-span" style="font-size: 11px;">then</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><FONT class="Apple-style-span" face="Monaco" size="3"><SPAN class="Apple-style-span" style="font-size: 11px;">System.out.println(</SPAN></FONT><FONT class="Apple-style-span" color="#008000" face="Monaco" size="3"><SPAN class="Apple-style-span" style="font-size: 11px;">"Test A: OK"</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="3"><SPAN class="Apple-style-span" style="font-size: 11px;">);</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" color="#960000" face="Monaco" size="3"><SPAN class="Apple-style-span" style="font-size: 11px;">end</SPAN></FONT></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Actualy, the rule compiles (with the NPE output, not stackTrace, just the <FONT class="Apple-style-span" color="#000080" face="Monaco" size="3"><SPAN class="Apple-style-span" style="font-size: 11px; text-decoration: underline;">java.lang.NullPointerException</SPAN></FONT>, </DIV><DIV>and it works fine.. I mean I get "Test A: OK" as output, but cant get the SomeClass.class reference when I</DIV><DIV>look into the debugger.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Is this the right way to compare clases? if not, whats the right way? (Im trying to not do == "SomeClass")</DIV><DIV><DIV><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV><SPAN class="Apple-style-span" style="text-decoration: underline;; -khtml-text-decorations-in-effect: underline; "><SPAN class="Apple-style-span" style="-khtml-text-decorations-in-effect: underline; "> </SPAN></SPAN><DIV><FONT class="Apple-style-span" size="3"><SPAN class="Apple-style-span" style="font-size: 13px;"><B style="font-size: 13px; font-weight: bold; "><SPAN class="Apple-style-span" style="font-size: 13px; font-weight: bold; ">Felipe Piccolini M.</SPAN></B></SPAN></FONT></DIV><DIV><A href="mailto:felipe.piccolini@bluesoft.cl"><SPAN class="Apple-style-span" style="color: rgb(0, 0, 238); -khtml-text-decorations-in-effect: underline; ">felipe.piccolini@bluesoft.cl</SPAN></A></DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><BR class="Apple-interchange-newline"></SPAN> </DIV><BR></DIV></DIV></BODY></HTML>