[rules-dev] Implicit package imports

Michael Anstis michael.anstis at gmail.com
Sun May 8 03:22:13 EDT 2011


Hehe, yes it would Wolfgang. The clarity a nights sleep brings.

Thanks.

On 8 May 2011 07:22, Wolfgang Laun <wolfgang.laun at gmail.com> wrote:

> Surely using the (not extremely long) full class path would avoid all
> import callisthenics?
> -W
>
> On 7 May 2011 23:42, Michael Anstis <michael.anstis at gmail.com> wrote:
>
>> Hi,
>>
>> I'm fixing a bug in all of Guvnors' guided editors:
>> https://issues.jboss.org/browse/GUVNOR-1362
>>
>> The existing problem is if a model Date field is set in one of the guided
>> editors RHS we need to convert the String into a Date for use in the set
>> Method (currently we attempt to pass the String which fails).
>>
>> I have a working solution however it requires the user to explicitly add a
>> package import for "java.text.SimpleDateFormat" that handles the parsing.
>> This can be accomplished through the UI.
>>
>> I have two options to remove the need for the user to do anything:-
>>
>> (1) Pre-process all rules to be included in the package, check if one uses
>> Date in the RHS and if so add an import into the header. I'd need to
>> pre-process all rules as the package DRL String is built linearly and by the
>> time the package compiler gets to a rule that uses a Date in the RHS the
>> header, including imports, has already been built.
>>
>> (2) Add (another) implicit import into *all* packages. I assume we already
>> do something like this for the boxed primitives and some others (List?
>> Collection? Map? etc).
>>
>> Before I venture into option (1) can any (core) developer advise (1) where
>> can I add an additional implicit import (I assume the compiler somewhere),
>> (2) is this simpler solution acceptable to the (core) developers?
>>
>> Thanks,
>>
>> Mike
>>
>>
>> _______________________________________________
>> rules-dev mailing list
>> rules-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-dev
>>
>>
>
> _______________________________________________
> rules-dev mailing list
> rules-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20110508/073e0a54/attachment.html 


More information about the rules-dev mailing list