Re: OneStatementPerLine and Java 7 try-with-resources
Oliver Burn <[email protected]> Thu, 4 Jul 2013 07:25:19 +1000
| Newsgroups | gmane.comp.java.audit.checkstyle.user |
|---|---|
| Message-ID | <CAHZftdXGiTueS443CDGrqOEoJZD1T+sNkqjdGMoP3FL32Fq0Kg@mail.gmail.com> |
--===============6930221708791048809== Content-Type: multipart/alternative; boundary=047d7bacbcce362b7a04e0a21942 --047d7bacbcce362b7a04e0a21942 Content-Type: text/plain; charset=ISO-8859-1 Hi, This would be a feature request. Regards, Oliver On Wed, Jul 3, 2013 at 9:54 PM, Lewis, Eric <[email protected]> wrote: > Hi > > First of all: If this has been discussed before, I'm sorry. I've looked > around the mailing list archives and the issue tracker and haven't found > anything. > > 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 > per line: > > try (Reader xml = toXML(data); Reader xslt = createXSLReader(); > WritableByteBuffer out = createOutputBuffer();) { > ... > } catch (final IOException e) { > ... > } > > Is there a way to let OneStatementPerLine tolerate this? Or is this a bug > or 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] > https://lists.sourceforge.net/lists/listinfo/checkstyle-user > --047d7bacbcce362b7a04e0a21942 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div><div><div>Hi,<br><br></div>This would be a feature re= quest.<br><br></div>Regards,<br></div>Oliver<br></div><div class=3D"gmail_e= xtra"><br><br><div class=3D"gmail_quote">On Wed, Jul 3, 2013 at 9:54 PM, Le= wis, Eric <span dir=3D"ltr"><<a href=3D"mailto:[email protected]" target= =3D"_blank">[email protected]</a>></span> wrote:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex">Hi<br> <br> First of all: If this has been discussed before, I'm sorry. I've lo= oked around the mailing list archives and the issue tracker and haven't= found anything.<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 statemen= ts per line:<br> <br> try (Reader xml =3D toXML(data); Reader xslt =3D createXSLReader(); Writabl= eByteBuffer out =3D createOutputBuffer();) {<br> =A0 =A0...<br> } catch (final IOException e) {<br> =A0 =A0...<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><br> </blockquote></div><br></div> --047d7bacbcce362b7a04e0a21942-- --===============6930221708791048809== 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 --===============6930221708791048809== 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 --===============6930221708791048809==--