Mercurial > hg > monetdb-java
diff src/main/java/nl/cwi/monetdb/jdbc/MonetWrapper.java @ 295:003ae6d881db
Add "final" keyword to method arguments and local variables where possible.
It discovered some bugs in the MonetStatement constructor (changed the argument instead of object variable) which are fixed now.
See also https://en.wikipedia.org/wiki/Final_(Java)
author | Martin van Dinther <martin.van.dinther@monetdbsolutions.com> |
---|---|
date | Thu, 01 Aug 2019 20:18:43 +0200 (2019-08-01) |
parents | 2d62ca1f758b |
children | 54137aeb1f92 |
line wrap: on
line diff
--- a/src/main/java/nl/cwi/monetdb/jdbc/MonetWrapper.java +++ b/src/main/java/nl/cwi/monetdb/jdbc/MonetWrapper.java @@ -45,7 +45,7 @@ public class MonetWrapper implements jav * @since 1.6 */ @Override - public boolean isWrapperFor(Class<?> iface) throws SQLException { + public boolean isWrapperFor(final Class<?> iface) throws SQLException { return iface != null && iface.isAssignableFrom(getClass()); } @@ -70,7 +70,7 @@ public class MonetWrapper implements jav */ @Override @SuppressWarnings("unchecked") - public <T> T unwrap(Class<T> iface) throws SQLException { + public <T> T unwrap(final Class<T> iface) throws SQLException { if (isWrapperFor(iface)) { return (T) this; } @@ -85,7 +85,7 @@ public class MonetWrapper implements jav * @param name the method name * @return a new created SQLFeatureNotSupportedException object with SQLState 0A000 */ - static final SQLFeatureNotSupportedException newSQLFeatureNotSupportedException(String name) { + static final SQLFeatureNotSupportedException newSQLFeatureNotSupportedException(final String name) { return new SQLFeatureNotSupportedException("Method " + name + " not implemented", "0A000"); } }