Error thrown when the same appControl element is present more than once in config.xml
authorTomasz Iwanek <t.iwanek@samsung.com>
Thu, 26 Sep 2013 15:35:58 +0000 (17:35 +0200)
committerSoo-Hyun Choi <sh9.choi@samsung.com>
Fri, 27 Sep 2013 09:49:26 +0000 (18:49 +0900)
[Issue#]   N_SE-53206
[Problem]  Instalaltion should fail in a proper way if the same elements of
           appControl are specified twice.
[Cause]    N/A
[Solution] Check for appControl similarity..

[Verification]
    * Try to reproduce steps described in the issue tracker.
    * Issue should not be reproduced.

Change-Id: I86e0e7754657a112e373c408a677293811c164ee

src/configuration_parser/widget_parser.cpp

index 084ad0e..9d7284a 100644 (file)
@@ -1173,6 +1173,11 @@ class AppControlParser : public ElementParser
             ThrowMsg(Exception::ParseError, "service element must have operation element");
         }
 
+        auto res = std::find(m_data.appControlList.begin(), m_data.appControlList.end(), m_appControl);
+        if(res != m_data.appControlList.end()) {
+            ThrowMsg(Exception::ParseError, "service element must be unique");
+        }
+
         m_data.appControlList.push_back(m_appControl);
     }