Re: OneStatementPerLine and Java 7 try-with-resources
"Lewis, Eric" <[email protected]> Thu, 4 Jul 2013 09:18:03 +0000
| Newsgroups | gmane.comp.java.audit.checkstyle.user |
|---|---|
| Message-ID | <F6110B5BB9C8EF409100FAC38728D5F3022CC6EE@ipipmsg018> |
--===============4344745327421122734== Content-Language: de-DE Content-Type: multipart/alternative; boundary="_000_F6110B5BB9C8EF409100FAC38728D5F3022CC6EEipipmsg018_" --_000_F6110B5BB9C8EF409100FAC38728D5F3022CC6EEipipmsg018_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Oliver Ok, I created https://sourceforge.net/p/checkstyle/feature-requests/611/ Thanks & best regards, Eric Von: Oliver Burn [mailto:[email protected]] Gesendet: Mittwoch, 3. Juli 2013 23:25 An: [email protected] Betreff: Re: [Checkstyle-user] OneStatementPerLine and Java 7 try-with-reso= urces Hi, This would be a feature request. Regards, Oliver On Wed, Jul 3, 2013 at 9:54 PM, Lewis, Eric <[email protected]<mailto:Eric.= [email protected]>> wrote: Hi First of all: If this has been discussed before, I'm sorry. I've looked aro= und the mailing list archives and the issue tracker and haven't found anyth= ing. We use the OneStatementPerLine check to keep Java code tidy. However, with = the new Java 7 try-with-resources, it's usual to write several statements p= er line: try (Reader xml =3D toXML(data); Reader xslt =3D createXSLReader(); Writabl= eByteBuffer out =3D createOutputBuffer();) { ... } catch (final IOException e) { ... } Is there a way to let OneStatementPerLine tolerate this? Or is this a bug o= r feature request? Best regards, Eric ---------------------------------------------------------------------------= --- This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev _______________________________________________ Checkstyle-user mailing list [email protected]<mailto:[email protected]= rge.net> https://lists.sourceforge.net/lists/listinfo/checkstyle-user --_000_F6110B5BB9C8EF409100FAC38728D5F3022CC6EEipipmsg018_ 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 14 (filtered medium)"> <style><!-- /* Font Definitions */ @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;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0cm; margin-bottom:.0001pt; font-size:12.0pt; font-family:"Times New Roman","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;} span.E-MailFormatvorlage17 {mso-style-type:personal-reply; font-family:"Calibri","sans-serif"; color:black;} .MsoChpDefault {mso-style-type:export-only; font-family:"Calibri","sans-serif"; mso-fareast-language:EN-US;} @page WordSection1 {size:612.0pt 792.0pt; margin:72.0pt 72.0pt 72.0pt 72.0pt;} 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"DE-CH" link=3D"blue" vlink=3D"purple"> <div class=3D"WordSection1"> <p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;font-family:"Ca= libri","sans-serif";color:black">Hi Oliver<o:p></o:p></span>= </p> <p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;font-family:"Ca= libri","sans-serif";color:black"><o:p> </o:p></span></p= > <p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:11.0pt;font-= family:"Calibri","sans-serif";color:black">Ok, I create= d <a href=3D"https://sourceforge.net/p/checkstyle/feature-requests/611/">http= s://sourceforge.net/p/checkstyle/feature-requests/611/</a><o:p></o:p></span= ></p> <p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:11.0pt;font-= family:"Calibri","sans-serif";color:black"><o:p> <= /o:p></span></p> <p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:11.0pt;font-= family:"Calibri","sans-serif";color:black">Thanks &= best regards,<o:p></o:p></span></p> <p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:11.0pt;font-= family:"Calibri","sans-serif";color:black">Eric<o:p></o= :p></span></p> <p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:11.0pt;font-= family:"Calibri","sans-serif";color:black"><o:p> <= /o:p></span></p> <p class=3D"MsoNormal" style=3D"margin-left:35.4pt"><b><span lang=3D"DE" st= yle=3D"font-size:10.0pt;font-family:"Tahoma","sans-serif&quo= t;">Von:</span></b><span lang=3D"DE" style=3D"font-size:10.0pt;font-family:= "Tahoma","sans-serif""> Oliver Burn [mailto:oliver@pupp= ycrawl.com] <br> <b>Gesendet:</b> Mittwoch, 3. Juli 2013 23:25<br> <b>An:</b> [email protected]<br> <b>Betreff:</b> Re: [Checkstyle-user] OneStatementPerLine and Java 7 try-wi= th-resources<o:p></o:p></span></p> <p class=3D"MsoNormal" style=3D"margin-left:35.4pt"><o:p> </o:p></p> <div> <div> <div> <div> <p class=3D"MsoNormal" style=3D"mso-margin-top-alt:0cm;margin-right:0cm;mar= gin-bottom:12.0pt;margin-left:35.4pt"> Hi,<o:p></o:p></p> </div> <p class=3D"MsoNormal" style=3D"mso-margin-top-alt:0cm;margin-right:0cm;mar= gin-bottom:12.0pt;margin-left:35.4pt"> This would be a feature request.<o:p></o:p></p> </div> <p class=3D"MsoNormal" style=3D"margin-left:35.4pt">Regards,<o:p></o:p></p> </div> <p class=3D"MsoNormal" style=3D"margin-left:35.4pt">Oliver<o:p></o:p></p> </div> <div> <p class=3D"MsoNormal" style=3D"mso-margin-top-alt:0cm;margin-right:0cm;mar= gin-bottom:12.0pt;margin-left:35.4pt"> <o:p> </o:p></p> <div> <p class=3D"MsoNormal" style=3D"margin-left:35.4pt">On Wed, Jul 3, 2013 at = 9:54 PM, Lewis, Eric <<a href=3D"mailto:[email protected]" target=3D"_bl= ank">[email protected]</a>> wrote:<o:p></o:p></p> <p class=3D"MsoNormal" style=3D"margin-left:35.4pt">Hi<br> <br> First of all: If this has been discussed before, I'm sorry. I've looked aro= und the mailing list archives and the issue tracker and haven't found anyth= ing.<br> <br> We use the OneStatementPerLine check to keep Java code tidy. However, with = the new Java 7 try-with-resources, it's usual to write several statements p= er line:<br> <br> try (Reader xml =3D toXML(data); Reader xslt =3D createXSLReader(); Writabl= eByteBuffer out =3D createOutputBuffer();) {<br> ...<br> } catch (final IOException e) {<br> ...<br> }<br> <br> Is there a way to let OneStatementPerLine tolerate this? Or is this a bug o= r feature request?<br> <br> Best regards,<br> Eric<br> <br> ---------------------------------------------------------------------------= ---<br> This SF.net email is sponsored by Windows:<br> <br> Build for Windows Store.<br> <br> <a href=3D"http://p.sf.net/sfu/windows-dev2dev" target=3D"_blank">http://p.= sf.net/sfu/windows-dev2dev</a><br> _______________________________________________<br> Checkstyle-user mailing list<br> <a href=3D"mailto:[email protected]">Checkstyle-user@li= sts.sourceforge.net</a><br> <a href=3D"https://lists.sourceforge.net/lists/listinfo/checkstyle-user" ta= rget=3D"_blank">https://lists.sourceforge.net/lists/listinfo/checkstyle-use= r</a><o:p></o:p></p> </div> <p class=3D"MsoNormal" style=3D"margin-left:35.4pt"><o:p> </o:p></p> </div> </div> </body> </html> --_000_F6110B5BB9C8EF409100FAC38728D5F3022CC6EEipipmsg018_-- --===============4344745327421122734== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------------ This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev --===============4344745327421122734== 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 --===============4344745327421122734==--