OneStatementPerLine and Java 7 try-with-resources

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

OneStatementPerLine and Java 7 try-with-resources

Eric Lewis
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
Reply | Threaded
Open this post in threaded view
|

Re: OneStatementPerLine and Java 7 try-with-resources

Oliver Burn
Hi,

This would be a feature request.

Regards,
Oliver


On Wed, Jul 3, 2013 at 9:54 PM, Lewis, Eric <[hidden email]> 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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user


------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
Reply | Threaded
Open this post in threaded view
|

Re: OneStatementPerLine and Java 7 try-with-resources

Eric Lewis

Hi Oliver

 

Ok, I created https://sourceforge.net/p/checkstyle/feature-requests/611/

 

Thanks & best regards,

Eric

 

Von: Oliver Burn [mailto:[hidden email]]
Gesendet: Mittwoch, 3. Juli 2013 23:25
An: [hidden email]
Betreff: Re: [Checkstyle-user] OneStatementPerLine and Java 7 try-with-resources

 

Hi,

This would be a feature request.

Regards,

Oliver

 

On Wed, Jul 3, 2013 at 9:54 PM, Lewis, Eric <[hidden email]> 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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user

 


------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user