cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jaya...@apache.org
Subject [03/50] [abbrv] git commit: updated refs/heads/dhcpoffload to 45721ae
Date Mon, 29 Jun 2015 07:00:24 GMT
Fix findbugs SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING warning in Upgrade410to420.java

Signed-off-by: Daan Hoogland <daan.hoogland@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/dhcpoffload
Commit: 53e42fb45e87ff7369bd72fdb80a101ca320a292
Parents: b929db1
Author: Rafael da Fonseca <rsafonseca@gmail.com>
Authored: Mon Jun 22 01:07:59 2015 +0200
Committer: Daan Hoogland <daan.hoogland@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);


Mime
View raw message