You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by da...@apache.org on 2015/06/22 10:55:40 UTC

git commit: updated refs/heads/master to 53e42fb

Repository: cloudstack
Updated Branches:
  refs/heads/master b929db1f1 -> 53e42fb45


Fix findbugs SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING warning in Upgrade410to420.java

Signed-off-by: Daan Hoogland <da...@gmail.com>

This closes #505


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/53e42fb4
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/53e42fb4
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/53e42fb4

Branch: refs/heads/master
Commit: 53e42fb45e87ff7369bd72fdb80a101ca320a292
Parents: b929db1
Author: Rafael da Fonseca <rs...@gmail.com>
Authored: Mon Jun 22 01:07:59 2015 +0200
Committer: Daan Hoogland <da...@gmail.com>
Committed: Mon Jun 22 10:55:29 2015 +0200

----------------------------------------------------------------------
 engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/53e42fb4/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java
index 51da73f..7e7f7b7 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java
@@ -692,9 +692,10 @@ public class Upgrade410to420 implements DbUpgrade {
                         try(ResultSet rsLabel = sel_pstmt.executeQuery();) {
                             newLabel = getNewLabel(rsLabel, trafficTypeVswitchParamValue);
                             try(PreparedStatement update_pstmt =
-                                    conn.prepareStatement("update physical_network_traffic_types set vmware_network_label = " + newLabel + " where traffic_type = '" + trafficType +
-                                            "' and vmware_network_label is not NULL;");) {
+                                    conn.prepareStatement("update physical_network_traffic_types set vmware_network_label = ? where traffic_type = ? and vmware_network_label is not NULL;");) {
                                 s_logger.debug("Updating vmware label for " + trafficType + " traffic. Update SQL statement is " + pstmt);
+                                pstmt.setString(1, newLabel);
+                                pstmt.setString(2, trafficType);
                                 update_pstmt.executeUpdate();
                             }catch (SQLException e) {
                                 throw new CloudRuntimeException("Unable to set vmware traffic labels ", e);