False report of AvoidInlineConditionals?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

False report of AvoidInlineConditionals?

mark.c.determan

I am seeing a false violation for AvoidInlineConditional, when using Checkstyle 5.6.

 

The java code that triggers the Checkstyle violation is:

 

    //This is a SQL statement and not an inline conditional

    private static final String NON_ADMIN_USER_QUERY =

        "INSERT INTO TEMP_PERMISSIONS (RESOURCE_ID) SELECT distinct " +

        "V_ENTITY_PERMISSION.ENTITY_ID FROM V_ENTITY_PERMISSION, %s resource_table " +

        "where V_ENTITY_PERMISSION.ENTITY_ID = resource_table.%s " +

        "and V_ENTITY_PERMISSION.MEMBER_GUID in (%s) and V_ENTITY_PERMISSION.ENTITY_TYPE = ? " +

        "and V_ENTITY_PERMISSION.ROLE <= ? and resource_table.CUSTOMER_STORAGE_ID = ? " +

        "and resource_table.CUSTOMER_STORAGE_ID = V_ENTITY_PERMISSION.CUSTOMER_STORAGE_ID " +

        "and V_ENTITY_PERMISSION.MEMBER_TYPE in (%s)";

 

Is this a potential CheckStyle bug, or is there a way to configure CheckStyle to avoid falsely reporting a violation for AvoidInlineConditional?

 

Mark C. Determan


------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
Reply | Threaded
Open this post in threaded view
|

Re: False report of AvoidInlineConditionals?

Oliver Burn

Can you provide a complete sample Java file and configuration file demonstrating the problem. That would be a great help

On 17 Aug 2013 01:06, <[hidden email]> wrote:

I am seeing a false violation for AvoidInlineConditional, when using Checkstyle 5.6.

 

The java code that triggers the Checkstyle violation is:

 

    //This is a SQL statement and not an inline conditional

    private static final String NON_ADMIN_USER_QUERY =

        "INSERT INTO TEMP_PERMISSIONS (RESOURCE_ID) SELECT distinct " +

        "V_ENTITY_PERMISSION.ENTITY_ID FROM V_ENTITY_PERMISSION, %s resource_table " +

        "where V_ENTITY_PERMISSION.ENTITY_ID = resource_table.%s " +

        "and V_ENTITY_PERMISSION.MEMBER_GUID in (%s) and V_ENTITY_PERMISSION.ENTITY_TYPE = ? " +

        "and V_ENTITY_PERMISSION.ROLE <= ? and resource_table.CUSTOMER_STORAGE_ID = ? " +

        "and resource_table.CUSTOMER_STORAGE_ID = V_ENTITY_PERMISSION.CUSTOMER_STORAGE_ID " +

        "and V_ENTITY_PERMISSION.MEMBER_TYPE in (%s)";

 

Is this a potential CheckStyle bug, or is there a way to configure CheckStyle to avoid falsely reporting a violation for AvoidInlineConditional?

 

Mark C. Determan


------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user


------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
Reply | Threaded
Open this post in threaded view
|

Re: False report of AvoidInlineConditionals?

mark.c.determan

A reply from the Listserver asked for a complete sample Java file, and a configuration file demonstrating the problem.

 

The request for the configuration file … revealed the cause of the problem.  In the configuration file, there is an entry for RegexpMultiline.  The “format” is not adequate, and thus falsely reported an error.  I made a bad assumption, that this configuration was a built-in check (and a built-in format) provided and initialized by the out-of-the-box Checkstyle configuration.

 

    <module name="RegexpMultiline">

        <property name="format" value="\? [^;,]* \?"/>

        <property name="message" value="Nested inline conditionals are not permitted"/>

    </module>

 

In short, this is a problem with our team’s configuration file, and it is not an issue/bug within the CheckStyle plugin.

 

// Mark Determan

 

>>>>>>>>>>>>>>>>>>>>>>>>>>> 

 

From: Oliver Burn [mailto:[hidden email]]
Sent: Friday, August 16, 2013 5:32 PM
To: [hidden email]
Subject: Re: [Checkstyle-user] False report of AvoidInlineConditionals?

 

Can you provide a complete sample Java file and configuration file demonstrating the problem. That would be a great help

On 17 Aug 2013 01:06, <[hidden email]> wrote:

I am seeing a false violation for AvoidInlineConditional, when using Checkstyle 5.6.

 

The java code that triggers the Checkstyle violation is:

 

    //This is a SQL statement and not an inline conditional

    private static final String NON_ADMIN_USER_QUERY =

        "INSERT INTO TEMP_PERMISSIONS (RESOURCE_ID) SELECT distinct " +

        "V_ENTITY_PERMISSION.ENTITY_ID FROM V_ENTITY_PERMISSION, %s resource_table " +

        "where V_ENTITY_PERMISSION.ENTITY_ID = resource_table.%s " +

        "and V_ENTITY_PERMISSION.MEMBER_GUID in (%s) and V_ENTITY_PERMISSION.ENTITY_TYPE = ? " +

        "and V_ENTITY_PERMISSION.ROLE <= ? and resource_table.CUSTOMER_STORAGE_ID = ? " +

        "and resource_table.CUSTOMER_STORAGE_ID = V_ENTITY_PERMISSION.CUSTOMER_STORAGE_ID " +

        "and V_ENTITY_PERMISSION.MEMBER_TYPE in (%s)";

 

Is this a potential CheckStyle bug, or is there a way to configure CheckStyle to avoid falsely reporting a violation for AvoidInlineConditional?

 

Mark C. Determan


------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user