False report of AvoidInlineConditionals?
<[email protected]> Fri, 16 Aug 2013 15:05:21 +0000
| Newsgroups | gmane.comp.java.audit.checkstyle.user |
|---|---|
| Message-ID | <9BB759DFA3BCFF4E8A4C5F9588AE83710943E402@C111WHRPMBX28.ERF.thomson.com> |
--===============5542795940866579687==
Content-Language: en-US
Content-Type: multipart/alternative;
boundary="_000_9BB759DFA3BCFF4E8A4C5F9588AE83710943E402C111WHRPMBX28ER_"
--_000_9BB759DFA3BCFF4E8A4C5F9588AE83710943E402C111WHRPMBX28ER_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
I am seeing a false violation for AvoidInlineConditional, when using Checks=
tyle 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 =3D
"INSERT INTO TEMP_PERMISSIONS (RESOURCE_ID) SELECT distinct " +
"V_ENTITY_PERMISSION.ENTITY_ID FROM V_ENTITY_PERMISSION, %s resourc=
e_table " +
"where V_ENTITY_PERMISSION.ENTITY_ID =3D resource_table.%s " +
"and V_ENTITY_PERMISSION.MEMBER_GUID in (%s) and V_ENTITY_PERMISSIO=
N.ENTITY_TYPE =3D ? " +
"and V_ENTITY_PERMISSION.ROLE <=3D ? and resource_table.CUSTOMER_ST=
ORAGE_ID =3D ? " +
"and resource_table.CUSTOMER_STORAGE_ID =3D V_ENTITY_PERMISSION.CUS=
TOMER_STORAGE_ID " +
"and V_ENTITY_PERMISSION.MEMBER_TYPE in (%s)";
Is this a potential CheckStyle bug, or is there a way to configure CheckSty=
le to avoid falsely reporting a violation for AvoidInlineConditional?
Mark C. Determan
--_000_9BB759DFA3BCFF4E8A4C5F9588AE83710943E402C111WHRPMBX28ER_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"Generator" content=3D"Microsoft Word 12 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0in;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=3D"EN-US" link=3D"blue" vlink=3D"purple">
<div class=3D"WordSection1">
<p class=3D"MsoNormal">I am seeing a false violation for AvoidInlineConditi=
onal, when using Checkstyle 5.6.<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal">The java code that triggers the Checkstyle violation=
is:<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal" style=3D"text-autospace:none"><span style=3D"font-si=
ze:10.0pt;font-family:Consolas;color:black">
</span><span style=3D"font-size:10.0pt;font-family:Consolas;color:#3F7F5F">=
//This is a SQL statement and not an
<u>inline</u> conditional</span><span style=3D"font-size:10.0pt;font-family=
:Consolas"><o:p></o:p></span></p>
<p class=3D"MsoNormal" style=3D"text-autospace:none"><span style=3D"font-si=
ze:10.0pt;font-family:Consolas;color:black">
</span><b><span style=3D"font-size:10.0pt;font-family:Consolas;color:#7F005=
5">private</span></b><span style=3D"font-size:10.0pt;font-family:Consolas;c=
olor:black">
</span><b><span style=3D"font-size:10.0pt;font-family:Consolas;color:#7F005=
5">static</span></b><span style=3D"font-size:10.0pt;font-family:Consolas;co=
lor:black">
</span><b><span style=3D"font-size:10.0pt;font-family:Consolas;color:#7F005=
5">final</span></b><span style=3D"font-size:10.0pt;font-family:Consolas;col=
or:black"> String
</span><span style=3D"font-size:10.0pt;font-family:Consolas;color:#6000A0">=
NON_ADMIN_USER_QUERY</span><span style=3D"font-size:10.0pt;font-family:Cons=
olas;color:black"> =3D</span><span style=3D"font-size:10.0pt;font-family:Co=
nsolas"><o:p></o:p></span></p>
<p class=3D"MsoNormal" style=3D"text-autospace:none"><span style=3D"font-si=
ze:10.0pt;font-family:Consolas;color:black"> &=
nbsp;
</span><span style=3D"font-size:10.0pt;font-family:Consolas;color:#2A00FF">=
"INSERT INTO TEMP_PERMISSIONS (RESOURCE_ID) SELECT distinct "</sp=
an><span style=3D"font-size:10.0pt;font-family:Consolas;color:black"> +=
</span><span style=3D"font-size:10.0pt;font-family:Consolas"><o:p></o:p></s=
pan></p>
<p class=3D"MsoNormal" style=3D"text-autospace:none"><span style=3D"font-si=
ze:10.0pt;font-family:Consolas;color:black"> &=
nbsp;
</span><span style=3D"font-size:10.0pt;font-family:Consolas;color:#2A00FF">=
"V_ENTITY_PERMISSION.ENTITY_ID FROM V_ENTITY_PERMISSION, %s resource_t=
able "</span><span style=3D"font-size:10.0pt;font-family:Consolas;colo=
r:black"> +</span><span style=3D"font-size:10.0pt;font-family:Consolas"=
><o:p></o:p></span></p>
<p class=3D"MsoNormal" style=3D"text-autospace:none"><span style=3D"font-si=
ze:10.0pt;font-family:Consolas;color:black"> &=
nbsp;
</span><span style=3D"font-size:10.0pt;font-family:Consolas;color:#2A00FF">=
"where V_ENTITY_PERMISSION.ENTITY_ID =3D resource_table.%s "</spa=
n><span style=3D"font-size:10.0pt;font-family:Consolas;color:black"> +<=
/span><span style=3D"font-size:10.0pt;font-family:Consolas"><o:p></o:p></sp=
an></p>
<p class=3D"MsoNormal" style=3D"text-autospace:none"><span style=3D"font-si=
ze:10.0pt;font-family:Consolas;color:black;background:red;mso-highlight:red=
">
</span><span style=3D"font-size:10.0pt;font-family:Consolas;color:#2A00FF;b=
ackground:red;mso-highlight:red">"and V_ENTITY_PERMISSION.MEMBER_GUID =
in (%s) and V_ENTITY_PERMISSION.ENTITY_TYPE =3D ? "</span><span style=
=3D"font-size:10.0pt;font-family:Consolas;color:black;background:red;mso-hi=
ghlight:red">
+</span><span style=3D"font-size:10.0pt;font-family:Consolas"><o:p></o=
:p></span></p>
<p class=3D"MsoNormal" style=3D"text-autospace:none"><span style=3D"font-si=
ze:10.0pt;font-family:Consolas;color:black"> &=
nbsp;
</span><span style=3D"font-size:10.0pt;font-family:Consolas;color:#2A00FF">=
"and V_ENTITY_PERMISSION.ROLE <=3D ? and resource_table.CUSTOMER_ST=
ORAGE_ID =3D ? "</span><span style=3D"font-size:10.0pt;font-family:Con=
solas;color:black"> +</span><span style=3D"font-size:10.0pt;font-family=
:Consolas"><o:p></o:p></span></p>
<p class=3D"MsoNormal" style=3D"text-autospace:none"><span style=3D"font-si=
ze:10.0pt;font-family:Consolas;color:black"> &=
nbsp;
</span><span style=3D"font-size:10.0pt;font-family:Consolas;color:#2A00FF">=
"and resource_table.CUSTOMER_STORAGE_ID =3D V_ENTITY_PERMISSION.CUSTOM=
ER_STORAGE_ID "</span><span style=3D"font-size:10.0pt;font-family:Cons=
olas;color:black"> +</span><span style=3D"font-size:10.0pt;font-family:=
Consolas"><o:p></o:p></span></p>
<p class=3D"MsoNormal" style=3D"text-autospace:none"><span style=3D"font-si=
ze:10.0pt;font-family:Consolas;color:black"> &=
nbsp;
</span><span style=3D"font-size:10.0pt;font-family:Consolas;color:#2A00FF">=
"and V_ENTITY_PERMISSION.MEMBER_TYPE in (%s)"</span><span style=
=3D"font-size:10.0pt;font-family:Consolas;color:black">;</span><span style=
=3D"font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class=3D"MsoNormal" style=3D"text-autospace:none"><span style=3D"font-si=
ze:10.0pt;font-family:Consolas"><o:p> </o:p></span></p>
<p class=3D"MsoNormal">Is this a potential CheckStyle bug, or is there a wa=
y to configure CheckStyle to avoid falsely reporting a violation for AvoidI=
nlineConditional?<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal">Mark C. Determan<o:p></o:p></p>
</div>
</body>
</html>
--_000_9BB759DFA3BCFF4E8A4C5F9588AE83710943E402C111WHRPMBX28ER_--
--===============5542795940866579687==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
------------------------------------------------------------------------------
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
--===============5542795940866579687==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Checkstyle-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
--===============5542795940866579687==--