You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Emmanuel Bourg <eb...@apache.org> on 2016/02/08 23:08:12 UTC

Re: svn commit: r1729274 [3/7] - in /commons/proper/dbcp/trunk/src: main/java/org/apache/commons/dbcp2/ main/java/org/apache/commons/dbcp2/cpdsadapter/ main/java/org/apache/commons/dbcp2/datasources/ main/java/org/apache/commons/dbcp2/managed/ test/java/or...

Le 8/02/2016 22:56, ggregory@apache.org a écrit :
> Modified: commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/DelegatingPreparedStatement.java
> URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/DelegatingPreparedStatement.java?rev=1729274&r1=1729273&r2=1729274&view=diff
> ==============================================================================
> --- commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/DelegatingPreparedStatement.java (original)
> +++ commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/DelegatingPreparedStatement.java Mon Feb  8 21:56:48 2016
> @@ -82,7 +82,7 @@ public class DelegatingPreparedStatement
>          try {
>              return DelegatingResultSet.wrapResultSet(this,((PreparedStatement)getDelegate()).executeQuery());
>          }
> -        catch (SQLException e) {
> +        catch (final SQLException e) {
>              handleException(e);
>              throw new AssertionError();
>          }

Am I the only one to think this syntax is uselessly verbose ? I'm ok
with final class variables, less with final local parameters, but final
exceptions look really useless to me.

Emmanuel Bourg


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: svn commit: r1729274 [3/7] - in /commons/proper/dbcp/trunk/src: main/java/org/apache/commons/dbcp2/ main/java/org/apache/commons/dbcp2/cpdsadapter/ main/java/org/apache/commons/dbcp2/datasources/ main/java/org/apache/commons/dbcp2/managed/ test/java/or...

Posted by Mark Thomas <ma...@apache.org>.
On 8 February 2016 23:17:35 GMT+00:00, Emmanuel Bourg <eb...@apache.org> wrote:
>Le 8/02/2016 23:51, Gary Gregory a écrit :
>
>> It's simpler to be consistent when using final IMO. The intent is the
>same:
>> https://garygregory.wordpress.com/2013/01/26/the-final-kiss-in-java/
>
>"The road to hell is paved with good intentions" comes to mind here. I
>understand the intent but I don't think it's a good idea for catch
>statements. It brings no technical benefit and harms the readability.

For the record, while I understand where these final changes are coming from , I don't think what they add is worth what they take away in readability.

That said, I don't feel strongly enough to be particular bothered. If someone wants to spend their time on these changes, l'm not going to object ... as long as they don't break anything in the process.

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: svn commit: r1729274 [3/7] - in /commons/proper/dbcp/trunk/src: main/java/org/apache/commons/dbcp2/ main/java/org/apache/commons/dbcp2/cpdsadapter/ main/java/org/apache/commons/dbcp2/datasources/ main/java/org/apache/commons/dbcp2/managed/ test/java/or...

Posted by Gary Gregory <ga...@gmail.com>.
On Feb 8, 2016 3:17 PM, "Emmanuel Bourg" <eb...@apache.org> wrote:
>
> Le 8/02/2016 23:51, Gary Gregory a écrit :
>
> > It's simpler to be consistent when using final IMO. The intent is the
same:
> > https://garygregory.wordpress.com/2013/01/26/the-final-kiss-in-java/
>
> "The road to hell is paved with good intentions" comes to mind here. I
> understand the intent but I don't think it's a good idea for catch
> statements. It brings no technical benefit and harms the readability.

"Beauty is in the eye of the beholder".

I'd rather have less room for error than succinct code. Java is verbose by
design anyway. I want the compiler to stop me from possibly doing something
silly. If I really want to assign to the exception var, then I can remove
the final.

"Diff'rent strokes for diff'renr folks".

More quotes! As opposed to "more cowbell!"

:-)

Gary

>
> Emmanuel Bourg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>

Re: svn commit: r1729274 [3/7] - in /commons/proper/dbcp/trunk/src: main/java/org/apache/commons/dbcp2/ main/java/org/apache/commons/dbcp2/cpdsadapter/ main/java/org/apache/commons/dbcp2/datasources/ main/java/org/apache/commons/dbcp2/managed/ test/java/or...

Posted by Emmanuel Bourg <eb...@apache.org>.
Le 8/02/2016 23:51, Gary Gregory a écrit :

> It's simpler to be consistent when using final IMO. The intent is the same:
> https://garygregory.wordpress.com/2013/01/26/the-final-kiss-in-java/

"The road to hell is paved with good intentions" comes to mind here. I
understand the intent but I don't think it's a good idea for catch
statements. It brings no technical benefit and harms the readability.

Emmanuel Bourg


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: svn commit: r1729274 [3/7] - in /commons/proper/dbcp/trunk/src: main/java/org/apache/commons/dbcp2/ main/java/org/apache/commons/dbcp2/cpdsadapter/ main/java/org/apache/commons/dbcp2/datasources/ main/java/org/apache/commons/dbcp2/managed/ test/java/or...

Posted by Gary Gregory <ga...@gmail.com>.
On Feb 8, 2016 2:08 PM, "Emmanuel Bourg" <eb...@apache.org> wrote:
>
> Le 8/02/2016 22:56, ggregory@apache.org a écrit :
> > Modified:
commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/DelegatingPreparedStatement.java
> > URL:
http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/DelegatingPreparedStatement.java?rev=1729274&r1=1729273&r2=1729274&view=diff
> >
==============================================================================
> > ---
commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/DelegatingPreparedStatement.java
(original)
> > +++
commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/DelegatingPreparedStatement.java
Mon Feb  8 21:56:48 2016
> > @@ -82,7 +82,7 @@ public class DelegatingPreparedStatement
> >          try {
> >              return
DelegatingResultSet.wrapResultSet(this,((PreparedStatement)getDelegate()).executeQuery());
> >          }
> > -        catch (SQLException e) {
> > +        catch (final SQLException e) {
> >              handleException(e);
> >              throw new AssertionError();
> >          }
>
> Am I the only one to think this syntax is uselessly verbose ? I'm ok
> with final class variables, less with final local parameters, but final
> exceptions look really useless to me.

It's simpler to be consistent when using final IMO. The intent is the same:
https://garygregory.wordpress.com/2013/01/26/the-final-kiss-in-java/

Gary
>
> Emmanuel Bourg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>