Moti Asayag has posted comments on this change.
Change subject: engine: Assigned resultset to a local var in
StandaloneDataSource:checkConnection()
......................................................................
Patch Set 1: (1 inline comment)
....................................................
File
backend/manager/tools/engine-tools-common/src/main/java/org/ovirt/engine/core/tools/common/db/StandaloneDataSource.java
Line 151: Statement statement = null;
Line 152: try {
Line 153: statement = connection.createStatement();
Line 154: @SuppressWarnings("unused")
Line 155: ResultSet r = statement.executeQuery("select
null");
please replace tabs with spaces.
Adding the warning won't change the fact an unused code was added :-)
if wishes to solve it completely, create the ResultSet before the try block and
close the result set in the finally block, before closing the prepared
statement.
I'd take it one step further and introducing a new method to
org.ovirt.engine.core.utils.db.DbUtils that performs closeQuitely for the
result set and for the statement
(or just call DbUtils.closeQuietly(rs, statement, null)
Line 156: }
Line 157: finally {
Line 158: if (statement != null) {
Line 159: statement.close();
--
To view, visit http://gerrit.ovirt.org/10959
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia5b35703c28560b6aa01497bfef7f09319aebb3c
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Asaf Shakarchi <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Moti Asayag <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches