Fix a static analysis issue 65/313665/1
authorSangyoon Jang <jeremy.jang@samsung.com>
Mon, 1 Jul 2024 01:30:33 +0000 (10:30 +0900)
committerSangyoon Jang <jeremy.jang@samsung.com>
Mon, 1 Jul 2024 01:30:33 +0000 (10:30 +0900)
Change-Id: I28f2e077ab72a6cbbbd3fc2469883be473c8b3e7
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
src/manifest_parser/manifest.cc
src/manifest_parser/manifest.h

index adf947dfdc95c5f435c27e131d3ca33a8cb7d9fd..3a1ffd5ccf90d49808e4c7b6bbb4aba20d7b6f5f 100644 (file)
@@ -24,16 +24,16 @@ bool Manifest::ValidateManifest(
 }
 
 bool Manifest::HasKey(const std::string& key) const {
-  return CanAccessKey(key) && data_->HasKey(key);
+  return data_->HasKey(key);
 }
 
 bool Manifest::HasPath(const std::string& path) const {
-  return CanAccessPath(path) && data_->Get(path, nullptr);
+  return data_->Get(path, nullptr);
 }
 
 bool Manifest::Get(
     const std::string& path, const Value** out_value) const {
-  return CanAccessPath(path) && data_->Get(path, out_value);
+  return data_->Get(path, out_value);
 }
 
 bool Manifest::Get(
@@ -45,30 +45,27 @@ bool Manifest::Get(
 
 bool Manifest::GetBoolean(
     const std::string& path, bool* out_value) const {
-  return CanAccessPath(path) && data_->GetBoolean(path, out_value);
+  return data_->GetBoolean(path, out_value);
 }
 
 bool Manifest::GetInteger(
     const std::string& path, int* out_value) const {
-  return CanAccessPath(path) && data_->GetInteger(path, out_value);
+  return data_->GetInteger(path, out_value);
 }
 
 bool Manifest::GetString(
     const std::string& path, std::string* out_value) const {
-  if (!CanAccessPath(path))
-    return false;
-
   return data_->GetString(path, out_value);
 }
 
 bool Manifest::GetDictionary(
     const std::string& path, const DictionaryValue** out_value) const {
-  return CanAccessPath(path) && data_->GetDictionary(path, out_value);
+  return data_->GetDictionary(path, out_value);
 }
 
 bool Manifest::GetList(
     const std::string& path, const ListValue** out_value) const {
-  return CanAccessPath(path) && data_->GetList(path, out_value);
+  return data_->GetList(path, out_value);
 }
 
 Manifest* Manifest::DeepCopy() const {
@@ -81,14 +78,6 @@ bool Manifest::Equals(const Manifest* other) const {
   return other && data_->Equals(other->value());
 }
 
-bool Manifest::CanAccessPath(const std::string& /*path*/) const {
-  return true;
-}
-
-bool Manifest::CanAccessKey(const std::string& /*key*/) const {
-  return true;
-}
-
 ManifestConstraints::ManifestConstraints() :
     max_attr_element_length_(0) {
 }
index 0d755b53a0e7d9766ffff9de819a45ebec18a8fd..e7dda202eb0abffe212bb69883e2b05ae9f3f571 100644 (file)
@@ -65,10 +65,6 @@ class Manifest {
   const DictionaryValue* value() const { return data_.get(); }
 
  private:
-  // Returns true if the application can specify the given |path|.
-  bool CanAccessPath(const std::string& path) const;
-  bool CanAccessKey(const std::string& key) const;
-
   // Unique package id for tizen platform
   std::string package_id_;