Hi Tsukasa,

Thank you very much for your suggestions, and for working with the
jOOQ-checker module. Will you make your port publicly available to the
community?

I agree with 1). That appears to be a bug / leftover from early days of the
checker implementation, when @Require annotations would further restrict
each other over various scopes. This implementation (or at least the specs)
have been replaced by the current specification where only the
inner-most @Require annotation counts. In case of which, if the list of
required SQLDialects is empty, we should type check the jOOQ code, not
reject it. I've fixed this for jOOQ 3.12 and will backport to 3.11.6 and
3.10.9:
https://github.com/jOOQ/jOOQ/issues/7926

Regarding 2), Indeed, they should both have the same behaviour. @Support
should expand to @Support(SQLDialect.values()), conceptually. I've created
another issue, which will be fixed for jOOQ 3.12 and will backport to
3.11.6 and 3.10.9:
https://github.com/jOOQ/jOOQ/issues/7929

Thanks again!
Lukas

On Wed, Oct 10, 2018 at 5:03 PM Tsukasa Kitachi <[email protected]> wrote:

> Hello,
>
> I'm porting jOOQ-checker to WartRemover that is Scala linter.
> I have some suggestions to checker implementations.
>
> 1) The following code doesn't compile if SQLDialectChecker is enabled.
>
> @Allow(POSTGRES)
> public class AllowPostgres {
>     public void doesntCompile() {
>         DSL.cube(DSL.inline(1));
>     }
> }
>
> Error message is "No jOOQ API usage is allowed at current scope due to
> conflicting @Require specification".
> This is from these lines:
>
> https://github.com/jOOQ/jOOQ/blob/a8690a2b46a3eb056714f2ab2d14561570d1e8e6/jOOQ-checker/src/main/java/org/jooq/checker/SQLDialectChecker.java#L112-L113
>
> This seems to be unnecessary check.
>
> 2) Empty (no-args) @Support means all dialects are supported, right?
> So, next two methods have same semantics.
>
> @Support
> static void supportEmpty() {
> }
>
> @Support({SQL99, DEFAULT, CUBRID, ...And all of other dialect families...})
> static void supportAll() {
> }
>
> But use these methods in no @Allow scope, then result is different.
>
> void notAllowedAnything() {
>     supportEmpty(); // compiles
>     supportAll();   // error: No jOOQ API usage is allowed at current
> scope. Use @Allow.
> }
>
> This is confusing. I think that both should have same behavior. (both to
> be error is better.)
>
> What do you think?
>
> Regards,
> Tsukasa Kitachi
>
> --
> You received this message because you are subscribed to the Google Groups
> "jOOQ User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to